diff options
Diffstat (limited to 'sid/sidplay-libs-2.1.0/libsidplay')
113 files changed, 52423 insertions, 0 deletions
diff --git a/sid/sidplay-libs-2.1.0/libsidplay/AUTHORS b/sid/sidplay-libs-2.1.0/libsidplay/AUTHORS new file mode 100644 index 00000000..e2fbdfba --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/AUTHORS @@ -0,0 +1,34 @@ +LIBSIDPLAY2 is a C64 music player library which integrates the +reSID SID chip emulation into a cycle-based emulator environment. +Copyright (c) 2000 Simon White <sidplay2@email.com> + +This version of the freely available LIBSIDPLAY2 emulator engine source code +contains the following contributed or derived work. In the order they first +supplied contributions or code was derived from their work: + + Dag Lem - reSID library + Michael Schwendt - initial implementation of SidTune library, + Sid2Wav support, OSS/Free and SPARC audio + drivers + Rainer Sinsch - For help with the DirectX drivers + Jarno Paananen - 16 bit mixer code, Windows + MMSYSTEM Drivers + +Credit where credit is due, so if I missed anyone please let me know. + +----------------------------------------------------------------------------- + + 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 + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/COPYING b/sid/sidplay-libs-2.1.0/libsidplay/COPYING new file mode 100644 index 00000000..eeb586b3 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/sid/sidplay-libs-2.1.0/libsidplay/ChangeLog b/sid/sidplay-libs-2.1.0/libsidplay/ChangeLog new file mode 100644 index 00000000..7a11e01a --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/ChangeLog @@ -0,0 +1,493 @@ +Release Notes 2.1.0: + +Added: + +Introduction of sidbuilder classes. These classes can be used to create new sid +emulations for libsidplay2. The front end player owns these emulations and passes +them into libsidplay2 at runtime. Such emulations could be a revised SID emulation, +HardSID driver, Sidstation driver, etc... This feature will be used by sidplay/w +and sidplay2 in future. + +Implemetation of the component library classes. These classes provide a standard +way to create new components (e.g. VIC, CPU, etc). Note that the sidbuilder +classes use these. The current implementation is a half measure which sees +all components being seperated fully from the running environment. However, +due to the current design the components are static. A second version of these +classes will be released to allow dynamic allocation and linkage. This actually +means this project becomes a generic IC emulation test bed which are effectively +added and wired together at runtime. Given the right component emulations, this +project could be a C64, BBC, etc. + +Support for exporting credits. + +New event scheduler that is used by all components. The significantly improves +the speed of the emulation. + +Start time and fastforward support. + +Support for the PSID 2 proposal B (PSID 2NG). This allows relocation information +to be added to the tune such that it can be played on a real C64 (based emulation). +This is necessary as additional house keeping/contol code must be placed safely +in C64 ram without it running the risk of being overwritten by the song. + + +Changes: + +Code now builds under GCC3. + +Supporting and config requirements of the new builder classes required modification +to libsidplay2's configuration interface. + +Sidplay1 specific code moved to seperate components sid6510 and sid6526. This +provides the simple cut down versions of the CIA (6526) and a CPU which forgives +badly written tune code (6510). These components are only used in the old +sidplay/playsid modes. + +Direct ReSID support removed. Now supported through extenal sidbuilder class. + +Floating point code in critical code parts have been converted to fixed point. + +Relocatable C64 assembly driver added using PSID 2NG. + +Support for random tunes in Real C64 mode. + + +Fixes: + +The library has sufficient emulation to run PRGs. As such I managed to run the +C64 Emulator Testsuite 2.15 by Wolfram Roemhild. + +All CPU instructions (including extended ones) now run correctly with the correct +number of cycles. Results from other C64 environment tests are still being +worked on (nothing serious). + + + +Release Notes 2.0.7-5: + +Performance fix (corrected player.bin). + + +Release Notes 2.0.7-4: + +GCC 2.96 fixes. + + +Release Notes 2.0.7-3: + +Linux RPM fixes + +Changes: + +Fixed SidTune ('/' directory seperators are allowed on Microsoft platforms with +programs that use standard c/c++ libraries). + +Songs with there own interrupt handlers are no longer assumed to initialise +the VIC should the require it. Songs that do install there own handlers MUST +acknowledge the interrupt source else the song will play too fast. + + +Release Notes 2.0.7-2: + +Linux RPM fixes + + +Release Notes 2.0.7: + +This version sees a fully compliant C64 cycle based emulation. The emulation +only covers those parts which are necessary. Things like CIA and VIC are not +complete because it's not deemed usefull to play the tunes better. The +VIC emulation can still be improved a little to support bad cycles and perhaps +the light pen interrupt. The CIA emulation is also incomplete but now +supports both Timer A and B and all timer modes except those which use +external signals. The CIA emulation will probably be fully completed in a +near future release since I have the code pretty much written. It's not +been added because the rest of the player requires a design concept change to +use the C++ "observer model". + +Please note this version has a totally different concept design to the last. +The previous version is the last "SIDPlay Compatible" version. Since this +is the case SIDPlay specific songs which are possibly bad may no longer +work. If such songs are found please report them as they will be fixed. + +Lastly this version can run original tunes and even prgs taken from a real C64 +without any modifications. In most cases it's just a simple case of locating +the tunes INIT address, making a sid info header and then rename the *.prg to +*.dat. SIDPlay2 can then run the tune, it's even possible to create a PSID +all in one file using a conversion tool. One thing to note is that these +real tunes will mostly not play (correctly) in other SID Players apart from +VSID (Vice SIDPlayer). However, VICE is not pretending to be fully or even +mostly SIDPlay compatible. It therefore wont run as many tunes or play +extended samples like those found all the HSVC sample tunes. + +For those wishing to do the above you must set the play address to 0xffff. +This is an illegal address like 0 and behaves similiar, but it tells the +player to turn off extended sample support, ignore the CIA/VIC speed flag +and enable NMI support. + +NOTE FOR DEVELOPERS: + +You will require libtool 1.3b or greater to be able to link against +the libsidplay2 libraries. Versions of libtool prior to this +(including 1.3.5) DO NOT import library dependency information from the +installed *.la files. + +Libsidplay2 uses a modified version of ReSID. ReSID patches can be located +at: + +ftp://sidplay2.sourceforge.net/pub/sidplay2/resid + + +Changes: + +Partial VIC emulation which models both the NTSC and PAL chips. Full raster +interrupts supported and therefore VIC multispeed tunes. + +Partial CIA emulation with full interrupt capability for Timer A and B. NMI +interrupts are also supported for "real C64 samples". + +MOS6510s interrupts are now used. Interrupt/BRK now fixed to always run the +first instruction in the interrupt handler. This means the an IRQ cannot +interrupt an NMI should the first instruction in the handler be SEI. + +SID6510. SID specialisation of the processor now improved and those bits from +the player enviroment which should have been here now are. This module +provides most of the SIDPlay1 compatibility, but not everything can now be +supported as in version 2.0.6 due to other environment changes. + +XSID now is pretty much fixed for HardSID usage. It correctly determines +legal SID volume offsets and traps volume changes to the SID made by the +C64 program. This prevents song clicks, quiet main voices and even allows +the main voices to change there volume correctly whilst samples are playing. +The user now has the ability to select whether they would like samples through +SID or samples on there own idependent channel. The default is samples +through SID. Note that real Samples cannot be taken off the SID. + +Due to the Interrupt support the C64 now allows code execution overlaping. +E.g. the play routine might trigger before the INIT has completed and multiple +play calls may overlap each other. This also happens on a real C64 and as to +whether it works depends on if the ripped code still has the capability to +deal with it. Since it seems that some tune DO NOT do this properly, nor do +they acknowledge interrupts correctly, C64 code has been provided by Dag Lem +to deal with this issue. This code is the PSIDDRV from the Vice project. +The version available here has been modified by me to support almost +all tunes and deals with some of the SIDPlay compatibility issues better. + + +Problems: + +There are known problems with this version, but the benefits are far greater. + +Some tunes currently will just not play. These are tunes which install code +across the interrupt handlers and therefore don't behave correctly when an +interrupt occurs. These tunes are probably missing things which were setup +by the original game code. The methods used by SIDPlay1 and 2 to determine +the initial bank register state does not accomadate this fact. SIDPlay1 +like release 2.0.6 does not have this problem because interrupts are not +emulated. + +There are performance issues with this version and specifications have increased +due to the extra/modified component emulations :(. I hope to fix/improve on +this in a next release. + +Either the NMI or VIC interrupts seem to have jitter on them. For tunes in +HVSC this dosen't occur. For some real sample tunes the music can sound a little +distorted. This should be fixed for the next release. + +The PSIDDRV has to sit in RAM and therefore can be trashed by the tune. To stop +this the zero page has been reserved to store the PSIDDRV and some special non +standard C64 bankswitching added to flip in and out the driver. This means that +the tune cannot put any code on the zero page but it can store data on this page. +Since benefits of using this page are only available when storing data on it there +is no tune currently in HSVC that causes a problem. It is possible to put this +driver into roms, some code must still go in RAM do deal the calls to play/init +routines that may lie under the ROMS. However, this would break some of the older +modes e.g. playsid mode does not have ROMS, sidplay1 combatibilty modes prevent +code execution in ROMS. + + + +Changes since 2.0.6 (Note this version is intended mainly +for developers): + +(ms) Fixed fake6526.cpp to unlock timer upon reset. When playing +sub-tunes and switching from CIA to VBI speed and vice versa, the +speed is now correct. + +(ms) Fixed clock to [re]start at 0:00 upon [song] initialization. + +(ms) Converted complete source tree from kdevelop to native Automake +and made it build a library and the console player. Developers are +advised to configure the package with --disable-shared, so that they +don't need to install a shared library and/or set the +LD_LIBRARY_PATH, respectively. + + +Changes: + +Resid now linked against library and not against application. This +means that a application linking to the library does not need to know it's +using resid. + +External interface changed to hopefully allow better compatibilty. + + +Problems: + +For OSS left and right channels are reversed. According to OSS docs, +left channel in writing before right which is the order it's currently +being done (oss driver bug). Both Windows drivers are correct. + + +Bug Fixes: + +Fixed bug when reading tunes from stdin. + +Added new loadSong function to allow selecting another subsong without +reloading the file. This is important when reading files from stdin. + +External interface changed to hopefully allow better compatibilty. + +Fixed IO bug whereby a write to the IO registers could not be read back. + +Keyboard input is now read from stderr. This allows the keyboard to be +read whilst a file is passed using stdin. + +Stderr redefined as console output instead of stdout. This allows you to +redirect or pipe the output whilist allowing keyboard events to be processed +correctly + +Changin any of the sid settings effects both sids. + +The library can now be configured at run time by putting the library into paused +mode. If you are using a multiplte threads to drive the library, be carefull +as it's not thread safe. Use mutually exclusive semaphores to protect the library. + +Use of extended keys quiting the program. + + +Added: + +Null sound driver to allow faster songlength detection (Code for songlength +detection not provided in this library) and eventual hardsid support. + +Cursor keys now work on Linux and Windows. But there is a bug in Windows 98 +first Edition which prevents them from working properly. This information +has been admitted by Microsoft the the only proposed solution is to upgrade to +Win 98 Second Edition. (For the time being you can use the cursor keys on +the numpad). + +Added a mileage count to help determine the sid usuage since the begining of time. + +Added ability to use unforced PAL or NTSC. + +For -s, mono songs now get converted to stereo by spliting the +channels between multiple sids. + + +Removed: + +Timer changed test. This can easily be worked out another way. + + + +Release Notes 2.0.6: + +This version mainly sees bug fixes and finally gets both the Linux and +Windows versions to exactly the same code state. + +Bug Fixes: + +Tunes which didn't play. +DirectX fixes. +Timers fixed for both directx and mmsystem drivers and will therefore +never cache ahead by more than 0.5 secs. This still needs doing under +Linux to prevent the timers getting 3 seconds ahead. +And more... + + +Added: + +Most of the other features of the expermental version now classed as 2.0.5 +apart from fastforward/rewind and filter redefinition. +Ability to skip to the prev/next subtune using the '<' and '>' keys. +And more... + + +Features for next release: + +Ansi console support delayed till next release. +Songlength database support delayed. +Filter redefinition delayed. +Fastforward/rewind, delayed indefinately untill feedback is provided +on how good/bad it is (please any feedback at all!). +Player configuration file. + + + +Release Notes 2.0.4-2: + +Bug fixes to sid mixer. +Program termination now quicker from ^C. +New xSID code included for testing. +New man page added. +Thanks to those concerened for finding/fixing the bugs in this release. + +To follow shortly: +Again 2.0.5 will follow, with the last of the features from my unofficial +experimental version (found on the sidplay2 ftp site). Be warned that there +are now bug fixes in the main version which the experimental one does not +contain! + +From now on experimental versions will be released as patches on the +main release versions in CVS until they are determined to be stable. + + + +Release Notes 2.0.4: + +Temporary release to try and bring code upto date. A 2.0.5 will follow shortly +to achieve all that implemented in experimental release 2.0.4pre5 (This is available +at ftp://sidplay2.sourceforge.net/pub/sidplay2) + +Lots of new options added, bug fixes for Solaris drivers, 16 bit support... Other +additions will fall into 2.0.5 once they have stabalised. + + + +CHANGES since 2.0.2: + +Added: + +* Timer + +* Support for credits + +* Option -fd, overrides values returned by sidtune and forces dual sid support + with the second sid being mapped at 0xd500. Use this to support stereo sids + (not stereo mus) until the format is changed to support them properly. + +* Windows Drivers. Code now now be built as a Win32 console application. + The include paths need to be changed to Visual C++ so all the headers can + be seen. Paths need are PATH/libsidplay-<ver>/ and PATH/libsidplay-<ver>/win. + +* Sparc Driver (This driver hasn't been tested or compiled) + +* Support for playing of playsid smaples through reSID + + +Changed: + +* Changing the environment whilist the song is playing nolonger stops the song. + Environment changes are now delayed until a new song is loaded + +* environment class renamed to SidEnvironment to avoid some naming issues with + Visual C++. + +* xSID minior fixes to make code compile on Visual C++. + +* Structure of audio drivers for better auto detection and Win32 support. + +* Sidplayer structure now implements Cheshire Cat techniques to hide private members + This means that all header files required by private members no longer need to be + installed + +* Added workaround in CPU code for bug found in Visual C++ 5. + +* Finally corrected all playsid digi modes using information provided bu + Michael Schwendt from the original source of Game Over. + +* Removed nasty code hacks for Windows. + + +Fixed: + +* xSID bug preventing it from not playing some samples. + +* myTune now initialised to NULL (reported by Jarno) + +* Placing of an invalid switch on an otherwise legal line did not throw an error. + +* Use of bitfields which breaks portability of CPU emulation + +* Unions on Big Endian machines where all variables are varying sizes + + +Issues: + +* Timer is actually what has been decoded rather than what has been + played. This is due to the soundcard drivers buffer the samples. + Anyway, it's better than nothing. + + + +CHANGES since 2.0.1: + +Added: + +* Time count + +* xsidplays audio drivers (well linux one) + +* Command line options + +* Volume controls for left and right + +* 8 bit mixer + + +Changed: + +* Renamed the project to libsidplay (eventually this code will be a library). + main.cpp and the audio directory will form the basis of a new project called + sidplay-2.X.X. + +* Sidtune. Only need one player emulation for stereo MUS files. + +* WavFile now converted to be another driver. (Makes code have better re-use) + +* New are now have error checking + +* Configure files now work + +* Prevented the loadSong function initialising the player twice. + + + +CHANGES since 2.0.0: + +Added: + +* Extended sid support (xSID, written by myself from scratch). xSIDs interface is designed to look like reSID and can easily be used to help developers of other players. + +* Support for all libsidplay-1.X.X environment modes. + +* Stereo SID & MUS file support. + +* Sid2Wav support (thanks to Michael Schwendt). + + +Fixed: + +* CPU using wrong address for reset vector. + +* The use of statics in CPU a member function (Required to play stereo MUS files). + + +Changed: + +* All data types now use _sidt namespace. + +* Better handling of reSID clock calls to seriously reduce CPU overhead. + + + +CHANGES from libsidplay 1.X.X + +* Most of the code has been re-written by myself with all the new emulated IC's being cycle based. + +* The interface has been revamped and is based on standard functions provided by a music player e.g. play, stop, pause, etc + +* reSID is now the default and currently only provided SID emulation. (written by Dag Lem) + +* Sidtune library taken from libsidplay-1.X.X for file support. (written by Michael Schwendt) diff --git a/sid/sidplay-libs-2.1.0/libsidplay/INSTALL b/sid/sidplay-libs-2.1.0/libsidplay/INSTALL new file mode 100644 index 00000000..02a4a074 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/INSTALL @@ -0,0 +1,167 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/Makefile.am new file mode 100644 index 00000000..bc2fe8f8 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/Makefile.am @@ -0,0 +1,13 @@ + +AUTOMAKE_OPTIONS = foreign + +SUBDIRS = unix include src + +EXTRA_DIST = win + + +# Remove CVS directories from any subdirs that get +# included completely (e.g. win, directx,...). + +dist-hook: + rm -rf `find $(distdir) -path \*/CVS` diff --git a/sid/sidplay-libs-2.1.0/libsidplay/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/Makefile.in new file mode 100644 index 00000000..ad6c5db8 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/Makefile.in @@ -0,0 +1,535 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +AUTOMAKE_OPTIONS = foreign + +SUBDIRS = unix include src + +EXTRA_DIST = win +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ + Makefile.in TODO aclocal.m4 configure configure.ac +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): configure.ac + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +distdir = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/unix + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && $(mkinstalldirs) "$$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-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distuninstallcheck: + cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf autom4te.cache +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive dist dist-all dist-gzip distcheck distclean \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ + pdf-recursive ps ps-am ps-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + + +# Remove CVS directories from any subdirs that get +# included completely (e.g. win, directx,...). + +dist-hook: + rm -rf `find $(distdir) -path \*/CVS` +# 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/sid/sidplay-libs-2.1.0/libsidplay/README b/sid/sidplay-libs-2.1.0/libsidplay/README new file mode 100644 index 00000000..afea8f07 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/README @@ -0,0 +1,7 @@ +Known Problems: + +If you are having unresolved symbol problems when linking against the +libsidplay2 libraries then you need to update Libtool. Libtool versions +1.4b and greater are the only ones that use the installed .la files and +correctly support C++. The .la files contain all the library dependencies +required by libsidplay2. diff --git a/sid/sidplay-libs-2.1.0/libsidplay/TODO b/sid/sidplay-libs-2.1.0/libsidplay/TODO new file mode 100644 index 00000000..6de32a74 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/TODO @@ -0,0 +1,31 @@ +TODO <libsidplay2>: + +*New Bank Switching implementation for remappable componenets <Delayed> + +*Optimise reSID? <Clock, output, read, write> + +*Fastforward, Rewind. <Under test, please comment on it's performance, there + are both Windows and Linux versions available> + +*Length detection <Delayed> + +*What functions are required on the interface for other applications <Suggestions please> + +*MOS6510: Remove opcodes to individual files to support optimised versions. + I have these in asm already, but was written in BorlandC. <Needs converting> + This way a C functon will be used if an asm is not present. + +*Possibly provide a wds sync output for stereoplayer. These helps external players + which support this to sync properly to the music, there are some that use + non-real time. Needs stereosidplayer v10.3 being ripped + <Do not implement full wds support in libsidplay, SYNC ONLY>. If anyone knows + anything about the C64s stereosidplayers internals could they contact + sidplay2@email.com + +*Add 24 bit support. + +*Quad sids. + +*Provide a C interface to the library. + +*VIC. Possibility for more support. diff --git a/sid/sidplay-libs-2.1.0/libsidplay/aclocal.m4 b/sid/sidplay-libs-2.1.0/libsidplay/aclocal.m4 new file mode 100644 index 00000000..c5b8eaad --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/aclocal.m4 @@ -0,0 +1,5433 @@ +# generated automatically by aclocal 1.7.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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. + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_PREREQ([2.52]) + +# serial 6 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# 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. + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 8 + +# 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... + + +AC_PREREQ([2.54]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl + AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# 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], +[_am_stamp_count=`expr ${_am_stamp_count-0} + 1` +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# 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. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.7.1])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# 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. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# 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="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + +# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + 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], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST([DEPDIR]) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # 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 -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST(am__include) +AC_SUBST(am__quote) +AC_MSG_RESULT($_am_result) +rm -f confinc confmf +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +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])]) + +# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- + +# serial 46 AC_PROG_LIBTOOL + +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +]) + +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +_LT_AC_PROG_ECHO_BACKSLASH +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + 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 + 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_SAVE + AC_LANG_C + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_RESTORE]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one + AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, + [AC_TRY_LINK([], + [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); + DllMain (0, 0, 0);], + [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) + + case $host/$CC in + *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) + # old mingw systems require "-dll" to link a DLL, while more recent ones + # require "-mdll" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -mdll" + AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, + [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) + CFLAGS="$SAVE_CFLAGS" ;; + *-*-cygwin* | *-*-pw32*) + # cygwin systems need to pass --dll to the linker, and not link + # crt.o which will require a WinMain@16 definition. + lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; + esac + ;; + ]) +esac + +_LT_AC_LTCONFIG_HACK + +]) + +# AC_LIBTOOL_HEADER_ASSERT +# ------------------------ +AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], +[AC_CACHE_CHECK([whether $CC supports assert without backlinking], + [lt_cv_func_assert_works], + [case $host in + *-*-solaris*) + if test "$GCC" = yes && test "$with_gnu_ld" != yes; then + case `$CC --version 2>/dev/null` in + [[12]].*) lt_cv_func_assert_works=no ;; + *) lt_cv_func_assert_works=yes ;; + esac + fi + ;; + esac]) + +if test "x$lt_cv_func_assert_works" = xyes; then + AC_CHECK_HEADERS(assert.h) +fi +])# AC_LIBTOOL_HEADER_ASSERT + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h) +])# _LT_AC_CHECK_DLFCN + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix*) + symcode='[[BCDEGRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[[ABCDGISTW]]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. +lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + rm -f conftest* + cat > conftest.$ac_ext <<EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +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 egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat <<EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' + + cat <<EOF >> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[[]] = +{ +EOF + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if AC_TRY_EVAL(ac_link) && test -s conftest; then + pipe_works=yes + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AC_FD_CC + fi + else + echo "cannot find nm_test_var in $nlist" >&AC_FD_CC + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC + fi + else + echo "$progname: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" +if test -z "$lt_cv_sys_global_symbol_pipe"; then + global_symbol_to_cdecl= + global_symbol_to_c_name_address= +else + global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" + global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" +fi +if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; +then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + +# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR +# --------------------------------- +AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], +[# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac + PATH_SEPARATOR=$lt_cv_sys_path_separator +fi +])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<EOF +$* +EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +AC_DIVERT_POP +])# _LT_AC_PROG_ECHO_BACKSLASH + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[if test "$cross_compiling" = yes; then : + [$4] +else + AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + cygwin* | mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + *) + 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="-dld"], + [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="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + +AC_DEFUN([_LT_AC_LTCONFIG_HACK], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" +need_locks="$enable_libtool_lock" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case $host_os in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="[$]2" + +AC_MSG_CHECKING([for objdir]) +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +AC_MSG_RESULT($objdir) + + +AC_ARG_WITH(pic, +[ --with-pic try to use only PIC/non-PIC objects [default=use both]], +pic_mode="$withval", pic_mode=default) +test -z "$pic_mode" && pic_mode=default + +# We assume here that the value for lt_cv_prog_cc_pic will not be cached +# in isolation, and that seeing it set (from the cache) indicates that +# the associated values are set (in the cache) correctly too. +AC_MSG_CHECKING([for $compiler option to produce PIC]) +AC_CACHE_VAL(lt_cv_prog_cc_pic, +[ lt_cv_prog_cc_pic= + lt_cv_prog_cc_shlib= + lt_cv_prog_cc_wl= + lt_cv_prog_cc_static= + lt_cv_prog_cc_no_builtin= + lt_cv_prog_cc_can_build_shared=$can_build_shared + + if test "$GCC" = yes; then + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-static' + + case $host_os in + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # not sure about C++ programs. + lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_cv_prog_cc_pic='-fno-common' + ;; + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_cv_prog_cc_pic=-Kconform_pic + fi + ;; + *) + lt_cv_prog_cc_pic='-fPIC' + ;; + esac + else + # PORTME Check for PIC flags for the system compiler. + case $host_os in + aix3* | aix4* | aix5*) + lt_cv_prog_cc_wl='-Wl,' + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better lt_cv_prog_cc_static that works with the bundled CC? + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" + lt_cv_prog_cc_pic='+Z' + ;; + + irix5* | irix6*) + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + + newsos6) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + ;; + + sco3.2v5*) + lt_cv_prog_cc_pic='-Kpic' + lt_cv_prog_cc_static='-dn' + lt_cv_prog_cc_shlib='-belf' + ;; + + solaris*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + ;; + + sunos4*) + lt_cv_prog_cc_pic='-PIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + if test "x$host_vendor" = xsni; then + lt_cv_prog_cc_wl='-LD' + else + lt_cv_prog_cc_wl='-Wl,' + fi + ;; + + uts4*) + lt_cv_prog_cc_pic='-pic' + lt_cv_prog_cc_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_cv_prog_cc_pic='-Kconform_pic' + lt_cv_prog_cc_static='-Bstatic' + fi + ;; + + *) + lt_cv_prog_cc_can_build_shared=no + ;; + esac + fi +]) +if test -z "$lt_cv_prog_cc_pic"; then + AC_MSG_RESULT([none]) +else + AC_MSG_RESULT([$lt_cv_prog_cc_pic]) + + # Check to make sure the pic_flag actually works. + AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) + AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" + AC_TRY_COMPILE([], [], [dnl + case $host_os in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then + # they create non-PIC objects. So, if there were any warnings, we + # assume that PIC is not supported. + if test -s conftest.err; then + lt_cv_prog_cc_pic_works=no + else + lt_cv_prog_cc_pic_works=yes + fi + ;; + *) + lt_cv_prog_cc_pic_works=yes + ;; + esac + ], [dnl + lt_cv_prog_cc_pic_works=no + ]) + CFLAGS="$save_CFLAGS" + ]) + + if test "X$lt_cv_prog_cc_pic_works" = Xno; then + lt_cv_prog_cc_pic= + lt_cv_prog_cc_can_build_shared=no + else + lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" + fi + + AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) +fi + +# Check for any special shared library compilation flags. +if test -n "$lt_cv_prog_cc_shlib"; then + AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) + lt_cv_prog_cc_can_build_shared=no + fi +fi + +AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) +AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl + lt_cv_prog_cc_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" + AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) + LDFLAGS="$save_LDFLAGS" +]) + +# Belt *and* braces to stop my trousers falling down: +test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= +AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) + +pic_flag="$lt_cv_prog_cc_pic" +special_shlib_compile_flags="$lt_cv_prog_cc_shlib" +wl="$lt_cv_prog_cc_wl" +link_static_flag="$lt_cv_prog_cc_static" +no_builtin_flag="$lt_cv_prog_cc_no_builtin" +can_build_shared="$lt_cv_prog_cc_can_build_shared" + + +# Check to see if options -o and -c are simultaneously supported by compiler +AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) +AC_CACHE_VAL([lt_cv_compiler_c_o], [ +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest +echo "int some_variable = 0;" > conftest.$ac_ext +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" +compiler_c_o=no +if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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 + if test -s out/conftest.err; then + lt_cv_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi +else + # Append any errors to the config.log. + cat out/conftest.err 1>&AC_FD_CC + lt_cv_compiler_c_o=no +fi +CFLAGS="$save_CFLAGS" +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null +]) +compiler_c_o=$lt_cv_compiler_c_o +AC_MSG_RESULT([$compiler_c_o]) + +if test x"$compiler_c_o" = x"yes"; then + # Check to see if we can write to a .lo + AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) + AC_CACHE_VAL([lt_cv_compiler_o_lo], [ + lt_cv_compiler_o_lo=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -c -o conftest.lo" + save_objext="$ac_objext" + ac_objext=lo + AC_TRY_COMPILE([], [int some_variable = 0;], [dnl + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + lt_cv_compiler_o_lo=no + else + lt_cv_compiler_o_lo=yes + fi + ]) + ac_objext="$save_objext" + CFLAGS="$save_CFLAGS" + ]) + compiler_o_lo=$lt_cv_compiler_o_lo + AC_MSG_RESULT([$compiler_o_lo]) +else + compiler_o_lo=no +fi + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi + +if test "$GCC" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) + echo "int some_variable = 0;" > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" + compiler_rtti_exceptions=no + AC_TRY_COMPILE([], [int some_variable = 0;], [dnl + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + compiler_rtti_exceptions=no + else + compiler_rtti_exceptions=yes + fi + ]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT([$compiler_rtti_exceptions]) + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi +fi + +# See if the linker supports building shared libraries. +AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) + +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +old_archive_from_expsyms_cmds= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_into_libs=no +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +link_all_deplibs=unknown +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression 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_" +# 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. +extract_expsyms_cmds= + +case $host_os in +cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; +openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX, the GNU linker is very broken + # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. + ld_shlibs=no + cat <<EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + + amigaos*) + 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 + + # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ + sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ + test -f $output_objdir/impgen.exe || (cd $output_objdir && \ + if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ + else $CC -o impgen impgen.c ; fi)~ + $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' + + old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' + + # cygwin and mingw dlls have different entry points and sets of symbols + # to exclude. + # FIXME: what about values for MSVC? + dll_entry=__cygwin_dll_entry@12 + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ + case $host_os in + mingw*) + # mingw values + dll_entry=_DllMainCRTStartup@12 + dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ + ;; + esac + + # mingw and cygwin differ, and it's simplest to just exclude the union + # of the two symbol sets. + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one (in ltdll.c) + if test "x$lt_cv_need_dllmain" = "xyes"; then + ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " + ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ + test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' + else + ltdll_obj= + ltdll_cmds= + fi + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left be newer dlltools. + export_symbols_cmds="$ltdll_cmds"' + $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \[$]# in + 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ + '"$ltdll_cmds"' + $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ + $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' + ;; + + 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<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. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + 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 + ;; + + 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 | egrep ': supported targets:.* elf' > /dev/null; then + 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 + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw* | pw32*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + 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 "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + 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. + + hardcode_direct=yes + archive_cmds='' + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # 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' + else + # not using gcc + if test "$host_cpu" = ia64; then + shared_flag='${wl}-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall can do strange things, so it is better to + # generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; 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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='${wl}-berok' + # This is a bit strange, but is similar to how AIX traditionally builds + # it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[[012]]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' + # We need to add '_' to the symbols in $export_symbols first + #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' + hardcode_direct=yes + hardcode_shlibpath_var=no + whole_archive_flag_spec='-all_load $convenience' + ;; + + freebsd1*) + ld_shlibs=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*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case $host_os in + hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + 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 + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case "$host_os" in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + #Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + 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 + export_dynamic_flag_spec='${wl}-Bexport' + ;; + + solaris*) + # gcc --version < 3.0 without binutils cannot create self contained + # shared libraries reliably, requiring libgcc.a to resolve some of + # the object symbols generated in some cases. Libraries that use + # assert need libgcc.a to resolve __eprintf, for example. Linking + # a copy of libgcc.a into every shared library to guarantee resolving + # such symbols causes other problems: According to Tim Van Holder + # <tim.van.holder@pandora.be>, C++ libraries end up with a separate + # (to the application) exception stack for one thing. + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + case `$CC --version 2>/dev/null` in + [[12]].*) + cat <<EOF 1>&2 + +*** Warning: Releases of GCC earlier than version 3.0 cannot reliably +*** create self contained shared libraries on Solaris systems, without +*** introducing a dependency on libgcc.a. Therefore, libtool is disabling +*** -no-undefined support, which will at least allow you to build shared +*** libraries. However, you may find that when you link such libraries +*** into an application without using GCC, you have to manually add +*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to +*** upgrade to a newer version of GCC. Another option is to rebuild your +*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. + +EOF + no_undefined_flag= + ;; + esac + fi + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + 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' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + 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) + if test "x$host_vendor" = xsno; then + archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + else + 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 + fi + 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' + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + 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' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + 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.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5uw7* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi +AC_MSG_RESULT([$ld_shlibs]) +test "$ld_shlibs" = no && can_build_shared=no + +# Check hardcoding attributes. +AC_MSG_CHECKING([how to hardcode library paths into programs]) +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; 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 +AC_MSG_RESULT([$hardcode_action]) + +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 + AC_MSG_RESULT([no]) +fi + +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +# PORTME Fill in your ld.so characteristics +AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +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 /usr/X11R6/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib /usr/X11R6/lib" + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4* | aix5*) + version_type=linux + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can + # not hardcode correct soname into executable. Probably we can + # add versioning support to collect2, so additional links can + # be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$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" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $GCC,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + ;; + yes,mingw*) + library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + ;; + *) + library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' + soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + *) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") 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}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # 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}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case "$host_os" in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + 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" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=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 + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +# Report the final consequences. +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +AC_LIBTOOL_DLOPEN_SELF + +if test "$enable_shared" = yes && test "$GCC" = yes; 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. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], + [$rm conftest* + echo 'static int dummy;' > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile); then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_cv_prog_cc_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi]) + AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) + ;; + esac +fi +need_lc=${lt_cv_archive_cmds_need_lc-yes} + +# The second clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + : +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + +if test -f "$ltmain"; then + trap "$rm \"${ofile}T\"; exit 1" 1 2 15 + $rm -f "${ofile}T" + + echo creating $ofile + + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS \ + AR AR_FLAGS CC LD LN_S NM SHELL \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ + postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + global_symbol_to_c_name_address \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + + case $var in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + cat <<__EOF__ > "${ofile}T" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$need_lc + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# The default C compiler. +CC=$lt_CC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_pic_flag +pic_mode=$pic_mode + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_compiler_c_o + +# Can we write directly to a .lo ? +compiler_o_lo=$lt_compiler_o_lo + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_no_builtin_flag + +# 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 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_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 and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_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.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# 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 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + case $host_os in + aix3*) + cat <<\EOF >> "${ofile}T" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + case $host_os in + cygwin* | mingw* | pw32* | os2*) + cat <<'EOF' >> "${ofile}T" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include <windows.h> +# #undef WIN32_LEAN_AND_MEAN +# #include <stdio.h> +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include <cygwin/cygwin_dll.h> +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# 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. +# */ +# +# #include <stdio.h> /* for printf() */ +# #include <unistd.h> /* for open(), lseek(), read() */ +# #include <fcntl.h> /* for O_RDONLY, O_BINARY */ +# #include <string.h> /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i<nexp; i++) +# { +# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); +# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); +# } +# +# return 0; +# } +# /* impgen.c ends here */ + +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1) + + mv -f "${ofile}T" "$ofile" || \ + (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") + chmod +x "$ofile" +fi + +])# _LT_AC_LTCONFIG_HACK + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + +# AC_LIBTOOL_PICMODE - implement the --with-pic flag +# Usage: AC_LIBTOOL_PICMODE[(MODE)] +# Where MODE is either `yes' or `no'. If omitted, it defaults to +# `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default)]) + + +# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[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_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + 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 <<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 + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +]) + + +# AC_PATH_MAGIC - find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl +AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) + else + MAGIC_CMD=: + fi +fi +]) + + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | [[A-Za-z]]:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + 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 GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +]) + +# AC_PROG_LD_GNU - +AC_DEFUN([AC_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + lt_cv_prog_gnu_ld=yes +else + lt_cv_prog_gnu_ld=no +fi]) +with_gnu_ld=$lt_cv_prog_gnu_ld +]) + +# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], +[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, +[lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" +]) + +# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], +[AC_CACHE_CHECK([how to recognise dependant libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep 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 +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + 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* | mingw* | pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[[012]]) + lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + +freebsd*) + 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)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + +irix5* | irix6*) + case $host_os in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' + 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 + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv5uw[[78]]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + 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 + ;; + esac + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +]) + + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl +AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/${ac_tool_prefix}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 + if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + lt_cv_path_NM="$tmp_nm -B" + break + elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + lt_cv_path_NM="$tmp_nm -p" + break + else + 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 + fi + fi + done + IFS="$ac_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +AC_MSG_RESULT([$NM]) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-convenience to the +# configure arguments. Note that LIBLTDL and INCLTDL are not +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not +# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed +# with '${top_builddir}/' and INCLTDL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-install to the configure +# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is +# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed +# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed +# with '${top_srcdir}/' (note the single quotes!). If your package is +# not flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +dnl ------------------------------------------------------------------------- +dnl Try to find a file (or one of more files in a list of dirs). +dnl $1=files +dnl $2=dirs to search +dnl $3=found dir +dnl [$4=found file] +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_FIND_FILE, +[ + $3=NO + for i in $2; do + for j in $1; do + if test -r "$i/$j"; then + $3=$i + if test "$4" != ""; then + $4=$j + fi + break 2 + fi + done + done +]) + + +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_SUBST_DEF, +[ + eval "$1=\"#define $1\"" + AC_SUBST($1) +]) + +AC_DEFUN(MY_SUBST_UNDEF, +[ + eval "$1=\"#undef $1\"" + AC_SUBST($1) +]) + +AC_DEFUN(MY_SUBST, +[ + eval "$1=$2" + AC_SUBST($1) +]) + + + + + +dnl ------------------------------------------------------------------------- +dnl Check whether compiler has a working ``bool'' type. +dnl Will substitute @HAVE_BOOL@ with either a def or undef line. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_BOOL, +[ + AC_MSG_CHECKING([for bool]) + AC_CACHE_VAL(test_cv_have_bool, + [ + AC_TRY_COMPILE( + [], + [bool aBool = true;], + [test_cv_have_bool=yes], + [test_cv_have_bool=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_bool) + if test "$test_cv_have_bool" = yes; then + AC_DEFINE(HAVE_BOOL,,[Define if the C++ compiler supports BOOL]) + fi +]) + +dnl ------------------------------------------------------------------------- +dnl Check whether C++ library has member ios::bin instead of ios::binary. +dnl Will substitute @HAVE_IOS_BIN@ with either a def or undef line. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_IOS_BIN, +[ + AC_MSG_CHECKING([whether standard member ios::binary is available]) + AC_CACHE_VAL(test_cv_have_ios_binary, + [ + AC_TRY_COMPILE( + [#include <fstream.h>], + [ifstream myTest(ios::in|ios::binary);], + [test_cv_have_ios_binary=yes], + [test_cv_have_ios_binary=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_ios_binary) + if test "$test_cv_have_ios_binary" = yes; then + AC_DEFINE(HAVE_IOS_BIN,, + [Define if standard member ``ios::binary'' is called ``ios::bin''.] + ) + fi +]) + +dnl ------------------------------------------------------------------------- +dnl Check whether C++ library has member ios::bin instead of ios::binary. +dnl Will substitute @HAVE_IOS_OPENMODE@ with either a def or undef line. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_IOS_OPENMODE, +[ + AC_MSG_CHECKING([whether standard member ios::openmode is available]) + AC_CACHE_VAL(test_cv_have_ios_openmode, + [ + AC_TRY_COMPILE( + [#include <fstream.h> + #include <iomanip.h>], + [ios::openmode myTest = ios::in;], + [test_cv_have_ios_openmode=yes], + [test_cv_have_ios_openmode=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_ios_openmode) + if test "$test_cv_have_ios_openmode" = yes; then + AC_DEFINE(HAVE_IOS_OPENMODE,, + [Define if ``ios::openmode'' is supported.] + ) + fi +]) + +dnl ------------------------------------------------------------------------- +dnl Check whether C++ environment provides the "nothrow allocator". +dnl Will substitute @HAVE_EXCEPTIONS@ if test code compiles. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_EXCEPTIONS, +[ + AC_MSG_CHECKING([whether exceptions are available]) + AC_CACHE_VAL(test_cv_have_exceptions, + [ + AC_TRY_COMPILE( + [#include <new.h>], + [char* buf = new(nothrow) char[1024];], + [test_cv_have_exceptions=yes], + [test_cv_have_exceptions=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_exceptions) + if test "$test_cv_have_exceptions" = yes; then + AC_DEFINE(HAVE_EXCEPTIONS,, + [Define if your C++ compiler implements exception-handling.] + ) + fi +]) + + +dnl ------------------------------------------------------------------------- +dnl Pass C++ compiler options to libtool which supports C only. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CONFIG_LIBTOOL, +[ + my_save_cc=$CC + my_save_cflags=$CFLAGS + CC=$CXX + CFLAGS=$CXXFLAGS + AM_PROG_LIBTOOL + CC=$my_save_cc + CFLAGS=$my_save_cflags +]) + + +dnl ------------------------------------------------------------------------- +dnl Library compile test using libtool +dnl $1 = CXXFLAGS +dnl $2 = LDFLAGS +dnl $3 = include header +dnl $4 = program to compile +dnl $5 = variable name to store result +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_TRY_COMPILE, +[ + my_save_cxxflags=$CXXFLAGS + my_save_ldflags=$LDFLAGS + my_save_cxx=$CXX + + CXXFLAGS="$CXXFLAGS $1" + LDFLAGS="$LDFLAGS $2" + CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX" + + AC_TRY_LINK( + [#include <$3>], + [$4;], + [$5=YES], + [$5=NO] + ) + + CXXFLAGS=$my_save_cxxflags + LDFLAGS=$my_save_ldflags + CXX=$my_save_cxx +]) + + +dnl ------------------------------------------------------------------------- +dnl Expand prefix variable and others relying on it +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_EXPAND_PREFIX, +[ + # Expand prefix/exec_prefix + my_save_prefix="$prefix" + my_save_exec_prefix="$exec_prefix" + test "x$prefix" = xNONE && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix=$prefix + my_def_prefix=$prefix + my_def_exec_prefix=$exec_prefix + eval my_def_includedir=$includedir + eval my_def_libdir=$libdir + # Restore old prefix + prefix="$my_save_prefix" + exec_prefix="$my_save_exec_prefix" +]) + + +dnl ------------------------------------------------------------------------- +dnl Find pkg-config on the system +dnl Returns path to program in variable PKG_CONFIG +dnl Modifies PKG_CONFIG_PATH to contain default install prefix +dnl $1 - Version +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_CONFIG_PKG_CONFIG, +[ + dnl Find pkg-config + AC_PATH_PROG(PKG_CONFIG, pkg-config, NO) + if test "$PKG_CONFIG" = NO; then + AC_MSG_ERROR([ +pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/ + ]) + fi + + if ! pkg-config --atleast-pkgconfig-version $1 ; then + AC_MSG_ERROR([ +pkg-config too old; version $1 or better required + ]) + fi + + if test "$my_def_prefix" = ""; then + MY_EXPAND_PREFIX + fi + + # Now add libdir to the pkgconfig search path using + # expanded prefix + PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$my_def_libdir/pkgconfig" + export PKG_CONFIG_PATH + my_save_pkg_config_path="$PKG_CONFIG_PATH" +]) + + +dnl ------------------------------------------------------------------------- +dnl Find library on the system using pkgconfig. You will automatically +dnl get LDFLAGS & CXXFLAGS using modified include and library paths if +dnl necessary. Other variables will be obtained with the original intended +dnl install paths. Results in uppercase output variables $library_$variable. +dnl $1 - library +dnl $2 - version +dnl $3 - variables +dnl $4 - library header +dnl $5 - program body +dnl [$6 - used header] +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_FIND_PKG_CONFIG_LIB, +[ + dnl Check if pkg-config is configured + if test "$PKG_CONFIG" = ""; then + MY_CONFIG_PKG_CONFIG(0.5) + fi + + AC_MSG_CHECKING([for working $1 library and headers]) + + dnl Be pessimistic. + my_includedir=NO + my_libdir=NO + my_uname=LIB`echo $1 | tr [a-z] [A-Z]` + + AC_ARG_WITH($1, + [ --with-$1=DIR + where the $1 is located], + [my_includedir="$withval" + my_libdir="$withval"] + ) + + AC_ARG_WITH($1-includes, + [ --with-$1-includes=DIR + where the $1 includes are located], + [my_includedir="$withval"] + ) + + AC_ARG_WITH($1-library, + [ --with-$1-library=DIR + where the $1 library is installed], + [my_libdir="$withval"] + ) + + # Find paths to headers & package config. + if test "$my_includedir" != NO; then + my_dirs="$my_includedir $my_includedir/include" + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + else + my_dirs=`$PKG_CONFIG --variable=includedir lib$1` + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + fi + + dnl find libs + if test "$my_libdir" != NO; then + my_dirs="$my_libdir $my_libdir/lib $my_libdir/src" + MY_FIND_FILE(lib$1.la,$my_dirs,my_libdir) + if test "$my_libdir" = NO; then + AC_MSG_ERROR([ +Unable to locate lib$1 library in: + $my_dirs +Please check your installation! + ]) + fi + PKG_CONFIG_PATH="$my_libdir:$my_libdir/pkgconfig:$my_libdir/../unix" + export PKG_CONFIG_PATH + else + my_libdir=`$PKG_CONFIG --variable=libdir lib$1` + fi + + dnl See if pkg-config locates the library + if $PKG_CONFIG --atleast-version=$2 lib$1; then + : + else + AC_MSG_ERROR([ +pkg-config couldn't locate lib$1 $2 in: + $PKG_CONFIG_PATH +Please check your installation! + ]) + fi + + dnl Get cflags and ldflags seperatly + my_cxxflags=`$PKG_CONFIG --define-variable=includedir=$my_includedir --cflags lib$1` + my_ldflags=`$PKG_CONFIG --define-variable=libdir=$my_libdir --libs lib$1` + eval ${my_uname}_CXXFLAGS=\"$my_cxxflags\" + eval ${my_uname}_LDFLAGS=\"$my_ldflags\" + + if test "$3" != ""; then + my_vars="$3" + for my_var in $my_vars; do + my_out=${my_uname}_`echo $my_var | tr [a-z] [A-Z]` + eval $my_out=\`$PKG_CONFIG --variable=$my_var lib$1\` + done + fi + + AC_MSG_RESULT([$my_libdir, $my_includedir]) + + dnl Check if found library works + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$my_header,$5,my_works) + if test "$my_works" = NO; then + AC_MSG_ERROR([ +$1 build test failed with found library and header files. +Please check your installation! + ]) + fi + + dnl Optional parameter - return used header + if test "$6" != ""; then + $6=$my_header + fi + + dnl Restore path for next library + PKG_CONFIG_PATH=$my_save_pkg_config_path + export PKG_CONFIG_PATH +]) + + +dnl ------------------------------------------------------------------------- +dnl Find library on the system. You will automatically LDFLAGS & CXXFLAGS. +dnl Results in uppercase output variables $library_$variable. +dnl $1 - library +dnl $2 - additional include paths +dnl $3 - additional library paths +dnl $4 - library header +dnl $5 - program body +dnl [$6 - used header] +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_FIND_LIB, +[ + AC_MSG_CHECKING([for working $1 library and headers]) + + if test "$my_def_prefix" = ""; then + MY_EXPAND_PREFIX + fi + + dnl Be pessimistic. + my_libdir="" + my_includedir="" + my_uname=LIB`echo $1 | tr [a-z] [A-Z]` + + AC_ARG_WITH($1, + [ --with-$1=DIR + where the $1 is located], + [my_includedir="$withval" + my_libdir="$withval" + ] + ) + + AC_ARG_WITH($1-includes, + [ --with-$1-includes=DIR + where the $1 includes are located], + [my_includedir="$withval"] + ) + + AC_ARG_WITH($1-library, + [ --with-$1-library=DIR + where the $1 library is installed], + [my_libdir="$withval"] + ) + + # Test compilation with library and headers in standard path. + my_ldflags="-l$1" + my_cxxflags="" + my_works=NO + + # Use library path given by user (if any). + if test "$my_libdir" != ""; then + my_dirs="$my_libdir $my_libdir/lib $my_libdir/src" + MY_FIND_FILE(lib$1.la,$my_dirs,my_libdir) + my_ldflags="$my_libdir/lib$1.la" + fi + + if test "$my_libdir" != NO; then + # Use include path given by user (if any). + if test "$my_includedir" != ""; then + my_dirs="$my_includedir $my_includedir/include" + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + if test "$my_includedir" != NO; then + my_cxxflags="-I$my_includedir" + # Run test compilation. + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$my_header,$5,my_works) + fi + else + # Header files are on the system so run compile tests until + # we find the correct one + for i in $4; do + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$i,$5,my_works) + if test "$my_works" != NO; then + my_header="$i" + break + fi + done + fi + fi + + if test "$my_works" = NO; then + # Test compilation failed. + # Need to search for library and headers + # Search common locations where header files might be stored. + my_dirs="$2 $my_def_includedir $my_def_prefix/include \ + /usr/include /usr/local/include /usr/lib/$1/include \ + /usr/local/lib/$1/include" + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + my_cxxflags="-I$my_includedir" + + # Search common locations where library might be stored. + my_dirs="$3 $my_def_libdir $my_def_prefix/lib \ + /usr/lib /usr/local/lib /usr/lib/$1/lib /usr/local/lib/$1/lib" + MY_FIND_FILE(lib$1.la,$my_dirs,my_libdir) + my_ldflags="$my_libdir/lib$1.la" + + if test "$my_includedir" != NO && test "$my_libdir" != NO; then + # Test compilation with found paths. + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$my_header,$5,my_works) + fi + + AC_MSG_RESULT([library $my_libdir, headers $my_includedir]) + if test "$my_works" = NO; then + AC_MSG_ERROR([ +$1 build test failed with found library and header files. +Please check your installation! + ]) + fi + else + AC_MSG_RESULT(yes) + fi + + eval ${my_uname}_CXXFLAGS=\"$my_cxxflags\" + eval ${my_uname}_LDFLAGS=\"$my_ldflags\" + + dnl Optional parameter - return used header + if test "$6" != ""; then + $6=$my_header + fi +]) + + +dnl ------------------------------------------------------------------------- +dnl Find library on the system. This is used to find libraries that are not +dnl built/installed. The include, lib path must be provided individually and it +dnl is not possible to validate the library path. +dnl $1 - library +dnl $2 - library header +dnl [$3 - used header] +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_FIND_LIB_NO_CHECK, +[ + AC_MSG_CHECKING([for $1 library and headers]) + + my_libdir="" + my_includedir="" + my_uname=LIB`echo $1 | tr [a-z] [A-Z]` + + AC_ARG_WITH($1-includes, + [ --with-$1-includes=DIR + where the $1 includes are located], + [my_includedir="$withval"] + ) + + AC_ARG_WITH($1-library, + [ --with-$1-library=DIR + where the $1 library is installed], + [my_libdir="$withval"] + ) + + dnl Both paths must be provided + if test "$my_libdir" = ""; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ +$1 library path not supplied! + ]) + fi + + if test "$my_includedir" = ""; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ +$1 include path not supplied! + ]) + fi + + dnl Check the include path + my_dirs="$my_includedir" + MY_FIND_FILE($2,$my_dirs,my_includedir,my_header) + + if test "$my_includedir" = NO; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ +$1 headers not found! + ]) + fi + + AC_MSG_RESULT(yes) + eval ${my_uname}_CXXFLAGS=\"-I$my_includedir\" + eval ${my_uname}_LDFLAGS=\"$my_libdir/lib$1.la\" + + dnl Optional parameter - return used header + if test "$3" != ""; then + $3=$my_header + fi +]) + +dnl AC_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] -*- sh -*- +dnl +dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the +dnl existence of an include file <stdint.h> that defines a set of +dnl typedefs, especially uint8_t,int32_t,uintptr_t. +dnl Many older installations will not provide this file, but some will +dnl have the very same definitions in <inttypes.h>. In other enviroments +dnl we can use the inet-types in <sys/types.h> which would define the +dnl typedefs int8_t and u_int8_t respectivly. +dnl +dnl This macros will create a local "_stdint.h" or the headerfile given as +dnl an argument. In many cases that file will just have a singular +dnl "#include <stdint.h>" or "#include <inttypes.h>" statement, while +dnl in other environments it will provide the set of basic 'stdint's defined: +dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t +dnl int_least32_t.. int_fast32_t.. intmax_t +dnl which may or may not rely on the definitions of other files, +dnl or using the AC_COMPILE_CHECK_SIZEOF macro to determine the actual +dnl sizeof each type. +dnl +dnl if your header files require the stdint-types you will want to create an +dnl installable file mylib-int.h that all your other installable header +dnl may include. So if you have a library package named "mylib", just use +dnl AC_CREATE_STDINT_H(mylib-int.h) +dnl in configure.in and go to install that very header file in Makefile.am +dnl along with the other headers (mylib.h) - and the mylib-specific headers +dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types. +dnl +dnl Remember, if the system already had a valid <stdint.h>, the generated +dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... +dnl +dnl (this file is part of the http://ac-archive.sf.net/gstdint project) +dnl @version $Id: aclocal.m4,v 1.26 2002/12/23 19:57:34 s_a_white Exp $ +dnl @author Guido Draheim <guidod@gmx.de> STATUS: used on new platforms + +AC_DEFUN([AC_CREATE_STDINT_H], +[# ------ AC CREATE STDINT H ------------------------------------- +AC_MSG_CHECKING([for stdint-types....]) +ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` +if test "$ac_stdint_h" = "stdint.h" ; then + AC_MSG_RESULT("(are you sure you want them in ./stdint.h?)") +elif test "$ac_stdint_h" = "inttypes.h" ; then + AC_MSG_RESULT("(are you sure you want them in ./inttypes.h?)") +else + AC_MSG_RESULT("(putting them into $ac_stdint_h)") +fi + +inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h $2 \ +| sed -e 's/,/ /g'` + + ac_cv_header_stdint_x="no-file" + ac_cv_header_stdint_o="no-file" + ac_cv_header_stdint_u="no-file" + for i in stdint.h $inttype_headers ; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>]) + AC_MSG_RESULT(... seen our uintptr_t in $i $and64) + break; + done + if test "$ac_cv_header_stdint_x" = "no-file" ; then + for i in stdint.h $inttype_headers ; do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>]) + AC_MSG_RESULT(... seen our uint32_t in $i $and64) + break; + done + if test "$ac_cv_header_stdint_o" = "no-file" ; then + for i in sys/types.h $inttype_headers ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="(u_int64_t too)"],[and64=""],[#include<$i>]) + AC_MSG_RESULT(... seen our u_int32_t in $i $and64) + break; + done + fi + fi + +# ----------------- DONE inttypes.h checks MAYBE C basic types -------- + +if test "$ac_cv_header_stdint_x" = "no-file" ; then + AC_COMPILE_CHECK_SIZEOF(char) + AC_COMPILE_CHECK_SIZEOF(short) + AC_COMPILE_CHECK_SIZEOF(int) + AC_COMPILE_CHECK_SIZEOF(long) + AC_COMPILE_CHECK_SIZEOF(void*) + ac_cv_header_stdint_test="yes" +else + ac_cv_header_stdint_test="no" +fi + +# ----------------- DONE inttypes.h checks START header ------------- +_ac_stdint_h=AS_TR_CPP(_$ac_stdint_h) +AC_MSG_RESULT(creating $ac_stdint_h : $_ac_stdint_h) +echo "#ifndef" $_ac_stdint_h >$ac_stdint_h +echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h +if test "$GCC" = "yes" ; then + echo "/* generated using a gnu compiler version" `$CC --version` "*/" \ + >>$ac_stdint_h +else + echo "/* generated using $CC */" >>$ac_stdint_h +fi +echo "" >>$ac_stdint_h + +if test "$ac_cv_header_stdint_x" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "$ac_cv_header_stdint_o" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "$ac_cv_header_stdint_u" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +# ----------------- See if int_least and int_fast types are present +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) +AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) + +if test "$ac_cv_header_stdint" != "stddef.h" ; then +if test "$ac_cv_header_stdint" != "stdint.h" ; then +AC_MSG_RESULT(..adding include stddef.h) + echo "#include <stddef.h>" >>$ac_stdint_h +fi ; fi +AC_MSG_RESULT(..adding include $ac_cv_header_stdint) + echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h +echo "" >>$ac_stdint_h + +# ----------------- DONE header START basic int types ------------- +if test "$ac_cv_header_stdint_x" = "no-file" ; then + AC_MSG_RESULT(... need to look at C basic types) +dnl ac_cv_header_stdint_test="yes" # moved up before creating the file +else + AC_MSG_RESULT(... seen good stdint.h inttypes) +dnl ac_cv_header_stdint_test="no" # moved up before creating the file +fi + +if test "$ac_cv_header_stdint_u" != "no-file" ; then + AC_MSG_RESULT(... seen bsd/sysv typedefs) + cat >>$ac_stdint_h <<EOF + +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; +EOF + cat >>$ac_stdint_h <<EOF + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +EOF +fi + +ac_cv_sizeof_x="$ac_cv_sizeof_char:$ac_cv_sizeof_short" +ac_cv_sizeof_X="$ac_cv_sizeof_x:$ac_cv_sizeof_int" +ac_cv_sizeof_X="$ac_cv_sizeof_X:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" +if test "$ac_cv_header_stdint" = "stddef.h" ; then +# we must guess all the basic types. Apart from byte-adressable system, +# there a few 32-bit-only dsp-systems. nibble-addressable systems are way off. + cat >>$ac_stdint_h <<EOF +/* ------------ BITSPECIFIC INTTYPES SECTION --------------- */ +EOF + t="typedefs for a" + case "$ac_cv_sizeof_X" in + 1:2:2:2:4) AC_MSG_RESULT(..adding $t normal 16-bit system) + cat >>$ac_stdint_h <<EOF +/* a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +EOF +;; + 1:2:2:4:4) AC_MSG_RESULT(..adding $t 32-bit system derived from a 16-bit) + cat >>$ac_stdint_h <<EOF +/* a 32-bit system derived from a 16-bit */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:4:4) AC_MSG_RESULT(..adding $t normal 32-bit system) + cat >>$ac_stdint_h <<EOF +/* a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:4:8) AC_MSG_RESULT(..adding $t 32-bit system prepared for 64-bit) + cat >>$ac_stdint_h <<EOF + +/* a 32-bit system prepared for 64-bit */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:8:8) AC_MSG_RESULT(..adding $t normal 64-bit system) + cat >>$ac_stdint_h <<EOF + +/* a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:8:4) AC_MSG_RESULT(..adding $t 64-bit system derived from a 32-bit) + cat >>$ac_stdint_h <<EOF + +/* a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + *) + AC_MSG_ERROR([ $ac_cv_sizeof_X dnl + what is that a system? contact the author, quick! http://ac-archive.sf.net]) + exit 1 +;; + esac +fi + +# ------------- DONE basic int types START int64_t types ------------ +if test "$ac_cv_type_uint64_t" = "yes" +then AC_MSG_RESULT(... seen good uint64_t) + cat >>$ac_stdint_h <<EOF + +/* system headers have good uint64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#endif +EOF + +elif test "$ac_cv_type_u_int64_t" = "yes" +then AC_MSG_RESULT(..adding typedef u_int64_t uint64_t) + cat >>$ac_stdint_h <<EOF + +/* system headers have an u_int64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef u_int64_t uint64_t; +#endif +EOF +else AC_MSG_RESULT(..adding generic uint64_t runtime checks) + cat >>$ac_stdint_h <<EOF + +/* -------------------- 64 BIT GENERIC SECTION -------------------- */ +/* here are some common heuristics using compiler runtime specifics */ +#if defined __STDC_VERSION__ && defined __STDC_VERSION__ > 199901L + +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ + +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#endif + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ +dnl /* note: all ELF-systems seem to have loff-support which needs 64-bit */ + +#if !defined _NO_LONGLONG +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) + +#if !defined _NO_LONGLONG +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +#endif + /* compiler/cpu type ... or just ISO C99 */ +#endif +#endif +EOF + +# plus a default 64-bit for systems that are likely to be 64-bit ready + case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in + 1:2:8:8) AC_MSG_RESULT(..adding uint64_t default, normal 64-bit system) +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen normal 64-bit system, CC has sizeof(long and void*) == 8 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +EOF +;; + 1:2:4:8) AC_MSG_RESULT(..adding uint64_t default, typedef to long) +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen 32-bit system prepared for 64-bit, CC has sizeof(long) == 8 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +EOF +;; + 1:2:8:4) AC_MSG_RESULT(..adding uint64_t default, typedef long long) +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen 64-bit derived from a 32-bit, CC has sizeof(long) == 4 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif +EOF +;; + *) +cat >>$ac_stdint_h <<EOF +/* NOTE: */ +/* the configure-checks for the basic types did not make us believe */ +/* that we could add a fallback to a 'long long' typedef to int64_t */ +EOF + esac +fi + +# ------------- DONE int64_t types START intptr types ------------ +if test "$ac_cv_header_stdint_x" = "no-file" ; then + cat >>$ac_stdint_h <<EOF + +/* -------------------------- INPTR SECTION --------------------------- */ +EOF + case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp" in + 1:2:2) + a="int16_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 2 chars, hence we declare it 16-bit */ + +typedef uint16_t uintptr_t; +typedef int16_t intptr_t; +EOF +;; + 1:2:4) + a="int32_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 4 chars, hence we declare it 32-bit */ + +typedef uint32_t uintptr_t; +typedef int32_t intptr_t; +EOF +;; + 1:2:8) + a="int64_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 8 chars, hence we declare it 64-bit */ + +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +EOF +;; + *) + a="long" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) but got no guess, hence we declare it as if long */ + +typedef unsigned long uintptr_t; +typedef long intptr_t; +EOF +;; + esac +AC_MSG_RESULT(..adding typedef $a intptr_t) +fi + +# ------------- DONE intptr types START int_least types ------------ +if test "$ac_cv_type_int_least32_t" = "no"; then +AC_MSG_RESULT(..adding generic int_least-types) + cat >>$ac_stdint_h <<EOF + +/* --------------GENERIC INT_LEAST ------------------ */ + +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_INT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_INT64_T +typedef uint64_t uint_least64_t; +#endif +EOF +fi + +# ------------- DONE intptr types START int_least types ------------ +if test "$ac_cv_type_int_fast32_t" = "no"; then +AC_MSG_RESULT(..adding generic int_fast-types) + cat >>$ac_stdint_h <<EOF + +/* --------------GENERIC INT_FAST ------------------ */ + +typedef int8_t int_fast8_t; +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_INT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_INT64_T +typedef uint64_t uint_fast64_t; +#endif +EOF +fi + +if test "$ac_cv_header_stdint_x" = "no-file" ; then + cat >>$ac_stdint_h <<EOF + +#ifdef _HAVE_INT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long int intmax_t; +typedef unsigned long uintmax_t; +#endif +EOF +fi + +AC_MSG_RESULT(... DONE $ac_stdint_h) + cat >>$ac_stdint_h <<EOF + + /* once */ +#endif +#endif +EOF +]) + +dnl quote from SunOS-5.8 sys/inttypes.h: +dnl Use at your own risk. As of February 1996, the committee is squarely +dnl behind the fixed sized types; the "least" and "fast" types are still being +dnl discussed. The probability that the "fast" types may be removed before +dnl the standard is finalized is high enough that they are not currently +dnl implemented. + + +dnl @synopsis AC_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]]) +dnl +dnl This macro checks for the size of TYPE using compile checks, not +dnl run checks. You can supply extra HEADERS to look into. the check +dnl will cycle through 1 2 4 8 16 and any EXTRA_SIZES the user +dnl supplies. If a match is found, it will #define SIZEOF_`TYPE' to +dnl that value. Otherwise it will emit a configure time error +dnl indicating the size of the type could not be determined. +dnl +dnl The trick is that C will not allow duplicate case labels. While +dnl this is valid C code: +dnl +dnl switch (0) case 0: case 1:; +dnl +dnl The following is not: +dnl +dnl switch (0) case 0: case 0:; +dnl +dnl Thus, the AC_TRY_COMPILE will fail if the currently tried size +dnl does not match. +dnl +dnl Here is an example skeleton configure.in script, demonstrating the +dnl macro's usage: +dnl +dnl AC_PROG_CC +dnl AC_CHECK_HEADERS(stddef.h unistd.h) +dnl AC_TYPE_SIZE_T +dnl AC_CHECK_TYPE(ssize_t, int) +dnl +dnl headers='#ifdef HAVE_STDDEF_H +dnl #include <stddef.h> +dnl #endif +dnl #ifdef HAVE_UNISTD_H +dnl #include <unistd.h> +dnl #endif +dnl ' +dnl +dnl AC_COMPILE_CHECK_SIZEOF(char) +dnl AC_COMPILE_CHECK_SIZEOF(short) +dnl AC_COMPILE_CHECK_SIZEOF(int) +dnl AC_COMPILE_CHECK_SIZEOF(long) +dnl AC_COMPILE_CHECK_SIZEOF(unsigned char *) +dnl AC_COMPILE_CHECK_SIZEOF(void *) +dnl AC_COMPILE_CHECK_SIZEOF(size_t, $headers) +dnl AC_COMPILE_CHECK_SIZEOF(ssize_t, $headers) +dnl AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers) +dnl AC_COMPILE_CHECK_SIZEOF(off_t, $headers) +dnl +dnl @author Kaveh Ghazi <ghazi@caip.rutgers.edu> +dnl @version $Id: aclocal.m4,v 1.26 2002/12/23 19:57:34 s_a_white Exp $ +dnl +AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], +[changequote(<<, >>)dnl +dnl The name to #define. +define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl +changequote([, ])dnl +AC_MSG_CHECKING(size of $1) +AC_CACHE_VAL(AC_CV_NAME, +[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence. + AC_TRY_COMPILE([#include "confdefs.h" +#include <sys/types.h> +$2 +], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) + if test x$AC_CV_NAME != x ; then break; fi +done +]) +if test x$AC_CV_NAME = x ; then + AC_MSG_ERROR([cannot determine a size for $1]) +fi +AC_MSG_RESULT($AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +]) + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/configure b/sid/sidplay-libs-2.1.0/libsidplay/configure new file mode 100755 index 00000000..631d3a38 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/configure @@ -0,0 +1,12536 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.54. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# 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 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac + PATH_SEPARATOR=$lt_cv_sys_path_separator +fi + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<EOF + +EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="Makefile.am" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#if STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# if HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#if HAVE_STRINGS_H +# include <strings.h> +#endif +#if HAVE_INTTYPES_H +# include <inttypes.h> +#else +# if HAVE_STDINT_H +# include <stdint.h> +# endif +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE LIBVERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE LN_S ECHO RANLIB ac_ct_RANLIB CPP EGREP LIBTOOL SID_HAVE_STDBOOL_H SID_WORDS_ENDIANESS SID_SIZEOF_CHAR SID_SIZEOF_SHORT_INT SID_SIZEOF_INT SID_SIZEOF_LONG_INT SID_HAVE_BOOL builders ACLOCAL_AMFLAGS LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# 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. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +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 + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -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 | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$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 ;; + + -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 ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + 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 ;; + + -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=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 ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + 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'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +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 + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + 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 + + +# 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 its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + 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 + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# 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 this package 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --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] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_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 + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + --enable-shared=PKGS build shared libraries default=yes + --enable-static=PKGS build static libraries default=yes + --enable-fast-install=PKGS optimize for fast installation default=yes + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-pic try to use only PIC/non-PIC objects default=use both + --with-sidbuilders=DIR + where the sid builder libraries are to be installed + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have + headers in a nonstandard directory <include dir> + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +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 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.54. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(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=. + echo "PATH: $as_dir" +done + +} >&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. +# Also quote any args containing shell meta-characters. +ac_configure_args= +ac_sep= +for ac_arg +do + case $ac_arg in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n ) continue ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " +done + +# 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: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >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 + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + 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. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`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. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +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_aux_dir= +for ac_dir in unix $srcdir/unix; 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 + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in unix $srcdir/unix" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in unix $srcdir/unix" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + ac_config_headers="$ac_config_headers unix/config.h" + + +LIBCUR=1 +LIBREV=0 +LIBAGE=0 +am__api_version="1.7" +# 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" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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/* | \ + /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_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 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +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. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$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' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +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 $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="${MAKE}"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +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=libsidplay + VERSION=2.$LIBCUR.$LIBREV + + +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"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + +LIBVERSION=$LIBCUR:$LIBREV:$LIBAGE + + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 + (eval $ac_compiler --version </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 + (eval $ac_compiler -v </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 + (eval $ac_compiler -V </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# 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. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +check \`config.log' for details." >&5 +echo "$as_me: error: C compiler cannot create executables +check \`config.log' for details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$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 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* 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; +} +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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include <stdlib.h>' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <stdlib.h> +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-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='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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'. + 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 + + 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 + for depmode in $am_compiler_list; do + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$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=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 + (eval $ac_compiler --version </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 + (eval $ac_compiler -v </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 + (eval $ac_compiler -V </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cxx_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + ''\ + '#include <stdlib.h>' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <stdlib.h> +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +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="$CXX" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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'. + 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 + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + +# Check whether --enable-shared or --disable-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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_shared=yes +fi; +# Check whether --enable-static or --disable-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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_static=yes +fi; +# Check whether --enable-fast-install or --disable-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. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=yes +fi; +# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac + PATH_SEPARATOR=$lt_cv_sys_path_separator +fi + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + 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 GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$lt_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + lt_cv_prog_gnu_ld=yes +else + lt_cv_prog_gnu_ld=no +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/${ac_tool_prefix}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 + if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + lt_cv_path_NM="$tmp_nm -B" + break + elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + lt_cv_path_NM="$tmp_nm -p" + break + else + 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 + fi + fi + done + IFS="$ac_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi + +NM="$lt_cv_path_NM" +echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 +echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 +# which responds to the $file_magic_cmd with a given egrep 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 +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + 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* | mingw* | pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[012]) + lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + +freebsd*) + 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)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + +irix5* | irix6*) + case $host_os in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' + 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 + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv5uw[78]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + 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 + ;; + esac + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method + + + + + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output" >&5 +echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix*) + symcode='[BCDEGRST]' + ;; +solaris* | sysv5*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[ABCDGISTW]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. +lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + rm -f conftest* + cat > conftest.$ac_ext <<EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +EOF + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && 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 egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat <<EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' + + cat <<EOF >> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{ +EOF + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest; then + pipe_works=yes + fi + LIBS="$save_LIBS" + CFLAGS="$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 -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" +if test -z "$lt_cv_sys_global_symbol_pipe"; then + global_symbol_to_cdecl= + global_symbol_to_c_name_address= +else + global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" + global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" +fi +if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; +then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&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 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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. + # 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <assert.h> + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <ac_nonexistent.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f 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 +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$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. + # 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <assert.h> + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <ac_nonexistent.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +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 + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <ctype.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + 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 <<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 + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + 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 <<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 + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 4691 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + 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 + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +lt_cv_cc_needs_belf=no +fi +rm -f 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 +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + + +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" +need_locks="$enable_libtool_lock" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case $host_os in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="$2" + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +echo "$as_me:$LINENO: result: $objdir" >&5 +echo "${ECHO_T}$objdir" >&6 + + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; +test -z "$pic_mode" && pic_mode=default + +# We assume here that the value for lt_cv_prog_cc_pic will not be cached +# in isolation, and that seeing it set (from the cache) indicates that +# the associated values are set (in the cache) correctly too. +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 +if test "${lt_cv_prog_cc_pic+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_cc_pic= + lt_cv_prog_cc_shlib= + lt_cv_prog_cc_wl= + lt_cv_prog_cc_static= + lt_cv_prog_cc_no_builtin= + lt_cv_prog_cc_can_build_shared=$can_build_shared + + if test "$GCC" = yes; then + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-static' + + case $host_os in + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # not sure about C++ programs. + lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_cv_prog_cc_pic='-fno-common' + ;; + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_cv_prog_cc_pic=-Kconform_pic + fi + ;; + *) + lt_cv_prog_cc_pic='-fPIC' + ;; + esac + else + # PORTME Check for PIC flags for the system compiler. + case $host_os in + aix3* | aix4* | aix5*) + lt_cv_prog_cc_wl='-Wl,' + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better lt_cv_prog_cc_static that works with the bundled CC? + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" + lt_cv_prog_cc_pic='+Z' + ;; + + irix5* | irix6*) + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + + newsos6) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + ;; + + sco3.2v5*) + lt_cv_prog_cc_pic='-Kpic' + lt_cv_prog_cc_static='-dn' + lt_cv_prog_cc_shlib='-belf' + ;; + + solaris*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + ;; + + sunos4*) + lt_cv_prog_cc_pic='-PIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + if test "x$host_vendor" = xsni; then + lt_cv_prog_cc_wl='-LD' + else + lt_cv_prog_cc_wl='-Wl,' + fi + ;; + + uts4*) + lt_cv_prog_cc_pic='-pic' + lt_cv_prog_cc_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_cv_prog_cc_pic='-Kconform_pic' + lt_cv_prog_cc_static='-Bstatic' + fi + ;; + + *) + lt_cv_prog_cc_can_build_shared=no + ;; + esac + fi + +fi + +if test -z "$lt_cv_prog_cc_pic"; then + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +else + echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5 +echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6 + + # Check to make sure the pic_flag actually works. + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6 + if test "${lt_cv_prog_cc_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + case $host_os in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then + # they create non-PIC objects. So, if there were any warnings, we + # assume that PIC is not supported. + if test -s conftest.err; then + lt_cv_prog_cc_pic_works=no + else + lt_cv_prog_cc_pic_works=yes + fi + ;; + *) + lt_cv_prog_cc_pic_works=yes + ;; + esac + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + lt_cv_prog_cc_pic_works=no + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + +fi + + + if test "X$lt_cv_prog_cc_pic_works" = Xno; then + lt_cv_prog_cc_pic= + lt_cv_prog_cc_can_build_shared=no + else + lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" + fi + + echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5 +echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6 +fi + +# Check for any special shared library compilation flags. +if test -n "$lt_cv_prog_cc_shlib"; then + { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5 +echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;} + if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : + else + { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} + lt_cv_prog_cc_can_build_shared=no + fi +fi + +echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6 +if test "${lt_cv_prog_cc_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_cc_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_prog_cc_static_works=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi + + +# Belt *and* braces to stop my trousers falling down: +test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= +echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5 +echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6 + +pic_flag="$lt_cv_prog_cc_pic" +special_shlib_compile_flags="$lt_cv_prog_cc_shlib" +wl="$lt_cv_prog_cc_wl" +link_static_flag="$lt_cv_prog_cc_static" +no_builtin_flag="$lt_cv_prog_cc_no_builtin" +can_build_shared="$lt_cv_prog_cc_can_build_shared" + + +# Check to see if options -o and -c are simultaneously supported by compiler +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest +echo "int some_variable = 0;" > conftest.$ac_ext +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" +compiler_c_o=no +if { (eval echo configure:5209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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 + if test -s out/conftest.err; then + lt_cv_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi +else + # Append any errors to the config.log. + cat out/conftest.err 1>&5 + lt_cv_compiler_c_o=no +fi +CFLAGS="$save_CFLAGS" +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null + +fi + +compiler_c_o=$lt_cv_compiler_c_o +echo "$as_me:$LINENO: result: $compiler_c_o" >&5 +echo "${ECHO_T}$compiler_c_o" >&6 + +if test x"$compiler_c_o" = x"yes"; then + # Check to see if we can write to a .lo + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6 + if test "${lt_cv_compiler_o_lo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + lt_cv_compiler_o_lo=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -c -o conftest.lo" + save_objext="$ac_objext" + ac_objext=lo + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ +int some_variable = 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + lt_cv_compiler_o_lo=no + else + lt_cv_compiler_o_lo=yes + fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + ac_objext="$save_objext" + CFLAGS="$save_CFLAGS" + +fi + + compiler_o_lo=$lt_cv_compiler_o_lo + echo "$as_me:$LINENO: result: $compiler_o_lo" >&5 +echo "${ECHO_T}$compiler_o_lo" >&6 +else + compiler_o_lo=no +fi + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +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 + +if test "$GCC" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 + echo "int some_variable = 0;" > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" + compiler_rtti_exceptions=no + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ +int some_variable = 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + compiler_rtti_exceptions=no + else + compiler_rtti_exceptions=yes + fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$compiler_rtti_exceptions" >&6 + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi +fi + +# See if the linker supports building shared libraries. +echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6 + +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +old_archive_from_expsyms_cmds= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_into_libs=no +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +link_all_deplibs=unknown +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression 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_" +# 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. +extract_expsyms_cmds= + +case $host_os in +cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; +openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX, the GNU linker is very broken + # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. + ld_shlibs=no + cat <<EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + + amigaos*) + 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 + + # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ + sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ + test -f $output_objdir/impgen.exe || (cd $output_objdir && \ + if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ + else $CC -o impgen impgen.c ; fi)~ + $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' + + old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' + + # cygwin and mingw dlls have different entry points and sets of symbols + # to exclude. + # FIXME: what about values for MSVC? + dll_entry=__cygwin_dll_entry@12 + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ + case $host_os in + mingw*) + # mingw values + dll_entry=_DllMainCRTStartup@12 + dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ + ;; + esac + + # mingw and cygwin differ, and it's simplest to just exclude the union + # of the two symbol sets. + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one (in ltdll.c) + if test "x$lt_cv_need_dllmain" = "xyes"; then + ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " + ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ + test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' + else + ltdll_obj= + ltdll_cmds= + fi + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left be newer dlltools. + export_symbols_cmds="$ltdll_cmds"' + $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ + '"$ltdll_cmds"' + $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ + $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' + ;; + + 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<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. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + 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 + ;; + + 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 | egrep ': supported targets:.* elf' > /dev/null; then + 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 + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw* | pw32*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + 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 "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + 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. + + hardcode_direct=yes + archive_cmds='' + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # 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' + else + # not using gcc + if test "$host_cpu" = ia64; then + shared_flag='${wl}-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall can do strange things, so it is better to + # generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; 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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='${wl}-berok' + # This is a bit strange, but is similar to how AIX traditionally builds + # it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' + # We need to add '_' to the symbols in $export_symbols first + #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' + hardcode_direct=yes + hardcode_shlibpath_var=no + whole_archive_flag_spec='-all_load $convenience' + ;; + + freebsd1*) + ld_shlibs=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*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case $host_os in + hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + 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 + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + #Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + 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 + export_dynamic_flag_spec='${wl}-Bexport' + ;; + + solaris*) + # gcc --version < 3.0 without binutils cannot create self contained + # shared libraries reliably, requiring libgcc.a to resolve some of + # the object symbols generated in some cases. Libraries that use + # assert need libgcc.a to resolve __eprintf, for example. Linking + # a copy of libgcc.a into every shared library to guarantee resolving + # such symbols causes other problems: According to Tim Van Holder + # <tim.van.holder@pandora.be>, C++ libraries end up with a separate + # (to the application) exception stack for one thing. + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + case `$CC --version 2>/dev/null` in + [12].*) + cat <<EOF 1>&2 + +*** Warning: Releases of GCC earlier than version 3.0 cannot reliably +*** create self contained shared libraries on Solaris systems, without +*** introducing a dependency on libgcc.a. Therefore, libtool is disabling +*** -no-undefined support, which will at least allow you to build shared +*** libraries. However, you may find that when you link such libraries +*** into an application without using GCC, you have to manually add +*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to +*** upgrade to a newer version of GCC. Another option is to rebuild your +*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. + +EOF + no_undefined_flag= + ;; + esac + fi + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + 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' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + 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) + if test "x$host_vendor" = xsno; then + archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + else + 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 + fi + 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' + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + 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' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + 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.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5uw7* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +# Check hardcoding attributes. +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; 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 +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +# PORTME Fill in your ld.so characteristics +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +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 /usr/X11R6/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib /usr/X11R6/lib" + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4* | aix5*) + version_type=linux + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can + # not hardcode correct soname into executable. Probably we can + # add versioning support to collect2, so additional links can + # be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$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" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $GCC,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + ;; + yes,mingw*) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' + ;; + *) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' + soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + *) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") 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}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # 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}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case "$host_os" in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + 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" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=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 + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +# Report the final consequences. +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + cygwin* | mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +char (*f) (); + +int +main () +{ +/* 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_shl_load) || defined (__stub___shl_load) +choke me +#else +f = shl_load; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +char (*f) (); + +int +main () +{ +/* 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_dlopen) || defined (__stub___dlopen) +choke me +#else +f = dlopen; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; 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 <<EOF +#line 6954 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; 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 <<EOF +#line 7052 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$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 + + +if test "$enable_shared" = yes && test "$GCC" = yes; 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. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + if test "${lt_cv_archive_cmds_need_lc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + $rm conftest* + echo 'static int dummy;' > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_cv_prog_cc_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$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=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi +fi + + echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 +echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6 + ;; + esac +fi +need_lc=${lt_cv_archive_cmds_need_lc-yes} + +# The second clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + : +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + +if test -f "$ltmain"; then + trap "$rm \"${ofile}T\"; exit 1" 1 2 15 + $rm -f "${ofile}T" + + echo creating $ofile + + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS \ + AR AR_FLAGS CC LD LN_S NM SHELL \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ + postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + global_symbol_to_c_name_address \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + + case $var in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + cat <<__EOF__ > "${ofile}T" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$need_lc + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# The default C compiler. +CC=$lt_CC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_pic_flag +pic_mode=$pic_mode + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_compiler_c_o + +# Can we write directly to a .lo ? +compiler_o_lo=$lt_compiler_o_lo + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_no_builtin_flag + +# 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 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_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 and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_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.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# 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 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + case $host_os in + aix3*) + cat <<\EOF >> "${ofile}T" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + case $host_os in + cygwin* | mingw* | pw32* | os2*) + cat <<'EOF' >> "${ofile}T" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include <windows.h> +# #undef WIN32_LEAN_AND_MEAN +# #include <stdio.h> +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include <cygwin/cygwin_dll.h> +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# 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. +# */ +# +# #include <stdio.h> /* for printf() */ +# #include <unistd.h> /* for open(), lseek(), read() */ +# #include <fcntl.h> /* for O_RDONLY, O_BINARY */ +# #include <string.h> /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i<nexp; i++) +# { +# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); +# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); +# } +# +# return 0; +# } +# /* impgen.c ends here */ + +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1) + + mv -f "${ofile}T" "$ofile" || \ + (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") + chmod +x "$ofile" +fi + + + + + + my_save_cc=$CC + my_save_cflags=$CFLAGS + CC=$CXX + CFLAGS=$CXXFLAGS + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + CC=$my_save_cc + CFLAGS=$my_save_cflags + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <ctype.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + +for ac_header in stdbool.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +if test "$ac_cv_header_stdbool_h" = yes; then + + eval "SID_HAVE_STDBOOL_H=\"#define SID_HAVE_STDBOOL_H\"" + + +else + + eval "SID_HAVE_STDBOOL_H=\"#undef SID_HAVE_STDBOOL_H\"" + + +fi +# ------ AC CREATE STDINT H ------------------------------------- +echo "$as_me:$LINENO: checking for stdint-types...." >&5 +echo $ECHO_N "checking for stdint-types....... $ECHO_C" >&6 +ac_stdint_h=`echo unix/sidint.h` +if test "$ac_stdint_h" = "stdint.h" ; then + echo "$as_me:$LINENO: result: \"(are you sure you want them in ./stdint.h?)\"" >&5 +echo "${ECHO_T}\"(are you sure you want them in ./stdint.h?)\"" >&6 +elif test "$ac_stdint_h" = "inttypes.h" ; then + echo "$as_me:$LINENO: result: \"(are you sure you want them in ./inttypes.h?)\"" >&5 +echo "${ECHO_T}\"(are you sure you want them in ./inttypes.h?)\"" >&6 +else + echo "$as_me:$LINENO: result: \"(putting them into $ac_stdint_h)\"" >&5 +echo "${ECHO_T}\"(putting them into $ac_stdint_h)\"" >&6 +fi + +inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h \ +| sed -e 's/,/ /g'` + + ac_cv_header_stdint_x="no-file" + ac_cv_header_stdint_o="no-file" + ac_cv_header_stdint_u="no-file" + for i in stdint.h $inttype_headers ; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$i> + +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uintptr_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +if test $ac_cv_type_uintptr_t = yes; then + ac_cv_header_stdint_x=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include<$i> + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + and64="(uint64_t too)" +else + and64="" +fi + + echo "$as_me:$LINENO: result: ... seen our uintptr_t in $i $and64" >&5 +echo "${ECHO_T}... seen our uintptr_t in $i $and64" >&6 + break; + done + if test "$ac_cv_header_stdint_x" = "no-file" ; then + for i in stdint.h $inttype_headers ; do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$i> + +int +main () +{ +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + ac_cv_header_stdint_o=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include<$i> + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + and64="(uint64_t too)" +else + and64="" +fi + + echo "$as_me:$LINENO: result: ... seen our uint32_t in $i $and64" >&5 +echo "${ECHO_T}... seen our uint32_t in $i $and64" >&6 + break; + done + if test "$ac_cv_header_stdint_o" = "no-file" ; then + for i in sys/types.h $inttype_headers ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_u_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$i> + +int +main () +{ +if ((u_int32_t *) 0) + return 0; +if (sizeof (u_int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_u_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_u_int32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +if test $ac_cv_type_u_int32_t = yes; then + ac_cv_header_stdint_u=$i +else + continue +fi + + echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include<$i> + +int +main () +{ +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_uint64_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + and64="(u_int64_t too)" +else + and64="" +fi + + echo "$as_me:$LINENO: result: ... seen our u_int32_t in $i $and64" >&5 +echo "${ECHO_T}... seen our u_int32_t in $i $and64" >&6 + break; + done + fi + fi + +# ----------------- DONE inttypes.h checks MAYBE C basic types -------- + +if test "$ac_cv_header_stdint_x" = "no-file" ; then + echo "$as_me:$LINENO: checking size of char" >&5 +echo $ECHO_N "checking size of char... $ECHO_C" >&6 +if test "${ac_cv_sizeof_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include "confdefs.h" +#include <sys/types.h> + + +int +main () +{ +switch (0) case 0: case (sizeof (char) == $ac_size):; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_char=$ac_size +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_char != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_char = x ; then + { { echo "$as_me:$LINENO: error: cannot determine a size for char" >&5 +echo "$as_me: error: cannot determine a size for char" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6 + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + + echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include "confdefs.h" +#include <sys/types.h> + + +int +main () +{ +switch (0) case 0: case (sizeof (short) == $ac_size):; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_short=$ac_size +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_short != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_short = x ; then + { { echo "$as_me:$LINENO: error: cannot determine a size for short" >&5 +echo "$as_me: error: cannot determine a size for short" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + + echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include "confdefs.h" +#include <sys/types.h> + + +int +main () +{ +switch (0) case 0: case (sizeof (int) == $ac_size):; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=$ac_size +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_int != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_int = x ; then + { { echo "$as_me:$LINENO: error: cannot determine a size for int" >&5 +echo "$as_me: error: cannot determine a size for int" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + + echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include "confdefs.h" +#include <sys/types.h> + + +int +main () +{ +switch (0) case 0: case (sizeof (long) == $ac_size):; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=$ac_size +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_long != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_long = x ; then + { { echo "$as_me:$LINENO: error: cannot determine a size for long" >&5 +echo "$as_me: error: cannot determine a size for long" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + echo "$as_me:$LINENO: checking size of void*" >&5 +echo $ECHO_N "checking size of void*... $ECHO_C" >&6 +if test "${ac_cv_sizeof_voidp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include "confdefs.h" +#include <sys/types.h> + + +int +main () +{ +switch (0) case 0: case (sizeof (void*) == $ac_size):; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_voidp=$ac_size +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_voidp != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_voidp = x ; then + { { echo "$as_me:$LINENO: error: cannot determine a size for void*" >&5 +echo "$as_me: error: cannot determine a size for void*" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5 +echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6 + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOIDP $ac_cv_sizeof_voidp +_ACEOF + + + ac_cv_header_stdint_test="yes" +else + ac_cv_header_stdint_test="no" +fi + +# ----------------- DONE inttypes.h checks START header ------------- +_ac_stdint_h=`echo "_$ac_stdint_h" | $as_tr_cpp` +echo "$as_me:$LINENO: result: creating $ac_stdint_h : $_ac_stdint_h" >&5 +echo "${ECHO_T}creating $ac_stdint_h : $_ac_stdint_h" >&6 +echo "#ifndef" $_ac_stdint_h >$ac_stdint_h +echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h +if test "$GCC" = "yes" ; then + echo "/* generated using a gnu compiler version" `$CC --version` "*/" \ + >>$ac_stdint_h +else + echo "/* generated using $CC */" >>$ac_stdint_h +fi +echo "" >>$ac_stdint_h + +if test "$ac_cv_header_stdint_x" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "$ac_cv_header_stdint_o" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "$ac_cv_header_stdint_u" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +# ----------------- See if int_least and int_fast types are present +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +echo "$as_me:$LINENO: checking for int_least32_t" >&5 +echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int_least32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_cv_header_stdint> + +int +main () +{ +if ((int_least32_t *) 0) + return 0; +if (sizeof (int_least32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int_least32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_int_least32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6 + +echo "$as_me:$LINENO: checking for int_fast32_t" >&5 +echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int_fast32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include<$ac_cv_header_stdint> + +int +main () +{ +if ((int_fast32_t *) 0) + return 0; +if (sizeof (int_fast32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int_fast32_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_int_fast32_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6 + + +if test "$ac_cv_header_stdint" != "stddef.h" ; then +if test "$ac_cv_header_stdint" != "stdint.h" ; then +echo "$as_me:$LINENO: result: ..adding include stddef.h" >&5 +echo "${ECHO_T}..adding include stddef.h" >&6 + echo "#include <stddef.h>" >>$ac_stdint_h +fi ; fi +echo "$as_me:$LINENO: result: ..adding include $ac_cv_header_stdint" >&5 +echo "${ECHO_T}..adding include $ac_cv_header_stdint" >&6 + echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h +echo "" >>$ac_stdint_h + +# ----------------- DONE header START basic int types ------------- +if test "$ac_cv_header_stdint_x" = "no-file" ; then + echo "$as_me:$LINENO: result: ... need to look at C basic types" >&5 +echo "${ECHO_T}... need to look at C basic types" >&6 +else + echo "$as_me:$LINENO: result: ... seen good stdint.h inttypes" >&5 +echo "${ECHO_T}... seen good stdint.h inttypes" >&6 +fi + +if test "$ac_cv_header_stdint_u" != "no-file" ; then + echo "$as_me:$LINENO: result: ... seen bsd/sysv typedefs" >&5 +echo "${ECHO_T}... seen bsd/sysv typedefs" >&6 + cat >>$ac_stdint_h <<EOF + +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; +EOF + cat >>$ac_stdint_h <<EOF + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +EOF +fi + +ac_cv_sizeof_x="$ac_cv_sizeof_char:$ac_cv_sizeof_short" +ac_cv_sizeof_X="$ac_cv_sizeof_x:$ac_cv_sizeof_int" +ac_cv_sizeof_X="$ac_cv_sizeof_X:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" +if test "$ac_cv_header_stdint" = "stddef.h" ; then +# we must guess all the basic types. Apart from byte-adressable system, +# there a few 32-bit-only dsp-systems. nibble-addressable systems are way off. + cat >>$ac_stdint_h <<EOF +/* ------------ BITSPECIFIC INTTYPES SECTION --------------- */ +EOF + t="typedefs for a" + case "$ac_cv_sizeof_X" in + 1:2:2:2:4) echo "$as_me:$LINENO: result: ..adding $t normal 16-bit system" >&5 +echo "${ECHO_T}..adding $t normal 16-bit system" >&6 + cat >>$ac_stdint_h <<EOF +/* a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +EOF +;; + 1:2:2:4:4) echo "$as_me:$LINENO: result: ..adding $t 32-bit system derived from a 16-bit" >&5 +echo "${ECHO_T}..adding $t 32-bit system derived from a 16-bit" >&6 + cat >>$ac_stdint_h <<EOF +/* a 32-bit system derived from a 16-bit */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:4:4) echo "$as_me:$LINENO: result: ..adding $t normal 32-bit system" >&5 +echo "${ECHO_T}..adding $t normal 32-bit system" >&6 + cat >>$ac_stdint_h <<EOF +/* a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:4:8) echo "$as_me:$LINENO: result: ..adding $t 32-bit system prepared for 64-bit" >&5 +echo "${ECHO_T}..adding $t 32-bit system prepared for 64-bit" >&6 + cat >>$ac_stdint_h <<EOF + +/* a 32-bit system prepared for 64-bit */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:8:8) echo "$as_me:$LINENO: result: ..adding $t normal 64-bit system" >&5 +echo "${ECHO_T}..adding $t normal 64-bit system" >&6 + cat >>$ac_stdint_h <<EOF + +/* a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:8:4) echo "$as_me:$LINENO: result: ..adding $t 64-bit system derived from a 32-bit" >&5 +echo "${ECHO_T}..adding $t 64-bit system derived from a 32-bit" >&6 + cat >>$ac_stdint_h <<EOF + +/* a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + *) + { { echo "$as_me:$LINENO: error: $ac_cv_sizeof_X what is that a system? contact the author, quick! http://ac-archive.sf.net" >&5 +echo "$as_me: error: $ac_cv_sizeof_X what is that a system? contact the author, quick! http://ac-archive.sf.net" >&2;} + { (exit 1); exit 1; }; } + exit 1 +;; + esac +fi + +# ------------- DONE basic int types START int64_t types ------------ +if test "$ac_cv_type_uint64_t" = "yes" +then echo "$as_me:$LINENO: result: ... seen good uint64_t" >&5 +echo "${ECHO_T}... seen good uint64_t" >&6 + cat >>$ac_stdint_h <<EOF + +/* system headers have good uint64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#endif +EOF + +elif test "$ac_cv_type_u_int64_t" = "yes" +then echo "$as_me:$LINENO: result: ..adding typedef u_int64_t uint64_t" >&5 +echo "${ECHO_T}..adding typedef u_int64_t uint64_t" >&6 + cat >>$ac_stdint_h <<EOF + +/* system headers have an u_int64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef u_int64_t uint64_t; +#endif +EOF +else echo "$as_me:$LINENO: result: ..adding generic uint64_t runtime checks" >&5 +echo "${ECHO_T}..adding generic uint64_t runtime checks" >&6 + cat >>$ac_stdint_h <<EOF + +/* -------------------- 64 BIT GENERIC SECTION -------------------- */ +/* here are some common heuristics using compiler runtime specifics */ +#if defined __STDC_VERSION__ && defined __STDC_VERSION__ > 199901L + +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ + +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#endif + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ + +#if !defined _NO_LONGLONG +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) + +#if !defined _NO_LONGLONG +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +#endif + /* compiler/cpu type ... or just ISO C99 */ +#endif +#endif +EOF + +# plus a default 64-bit for systems that are likely to be 64-bit ready + case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in + 1:2:8:8) echo "$as_me:$LINENO: result: ..adding uint64_t default" >&5 +echo "${ECHO_T}..adding uint64_t default" >&6 +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen normal 64-bit system, CC has sizeof(long and void*) == 8 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +EOF +;; + 1:2:4:8) echo "$as_me:$LINENO: result: ..adding uint64_t default" >&5 +echo "${ECHO_T}..adding uint64_t default" >&6 +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen 32-bit system prepared for 64-bit, CC has sizeof(long) == 8 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +EOF +;; + 1:2:8:4) echo "$as_me:$LINENO: result: ..adding uint64_t default" >&5 +echo "${ECHO_T}..adding uint64_t default" >&6 +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen 64-bit derived from a 32-bit, CC has sizeof(long) == 4 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif +EOF +;; + *) +cat >>$ac_stdint_h <<EOF +/* NOTE: */ +/* the configure-checks for the basic types did not make us believe */ +/* that we could add a fallback to a 'long long' typedef to int64_t */ +EOF + esac +fi + +# ------------- DONE int64_t types START intptr types ------------ +if test "$ac_cv_header_stdint_x" = "no-file" ; then + cat >>$ac_stdint_h <<EOF + +/* -------------------------- INPTR SECTION --------------------------- */ +EOF + case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp" in + 1:2:2) + a="int16_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 2 chars, hence we declare it 16-bit */ + +typedef uint16_t uintptr_t; +typedef int16_t intptr_t; +EOF +;; + 1:2:4) + a="int32_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 4 chars, hence we declare it 32-bit */ + +typedef uint32_t uintptr_t; +typedef int32_t intptr_t; +EOF +;; + 1:2:8) + a="int64_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 8 chars, hence we declare it 64-bit */ + +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +EOF +;; + *) + a="long" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) but got no guess, hence we declare it as if long */ + +typedef unsigned long uintptr_t; +typedef long intptr_t; +EOF +;; + esac +echo "$as_me:$LINENO: result: ..adding typedef $a intptr_t" >&5 +echo "${ECHO_T}..adding typedef $a intptr_t" >&6 +fi + +# ------------- DONE intptr types START int_least types ------------ +if test "$ac_cv_type_int_least32_t" = "no"; then +echo "$as_me:$LINENO: result: ..adding generic int_least-types" >&5 +echo "${ECHO_T}..adding generic int_least-types" >&6 + cat >>$ac_stdint_h <<EOF + +/* --------------GENERIC INT_LEAST ------------------ */ + +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_INT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_INT64_T +typedef uint64_t uint_least64_t; +#endif +EOF +fi + +# ------------- DONE intptr types START int_least types ------------ +if test "$ac_cv_type_int_fast32_t" = "no"; then +echo "$as_me:$LINENO: result: ..adding generic int_fast-types" >&5 +echo "${ECHO_T}..adding generic int_fast-types" >&6 + cat >>$ac_stdint_h <<EOF + +/* --------------GENERIC INT_FAST ------------------ */ + +typedef int8_t int_fast8_t; +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_INT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_INT64_T +typedef uint64_t uint_fast64_t; +#endif +EOF +fi + +if test "$ac_cv_header_stdint_x" = "no-file" ; then + cat >>$ac_stdint_h <<EOF + +#ifdef _HAVE_INT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long int intmax_t; +typedef unsigned long uintmax_t; +#endif +EOF +fi + +echo "$as_me:$LINENO: result: ... DONE $ac_stdint_h" >&5 +echo "${ECHO_T}... DONE $ac_stdint_h" >&6 + cat >>$ac_stdint_h <<EOF + + /* once */ +#endif +#endif +EOF + + +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/param.h> + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/param.h> + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_bigendian=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + +if test $ac_cv_c_bigendian = yes; then + + eval "SID_WORDS_ENDIANESS=SID_WORDS_BIGENDIAN" + + +else + + eval "SID_WORDS_ENDIANESS=SID_WORDS_LITTLEENDIAN" + + +fi + +echo "$as_me:$LINENO: checking for char" >&5 +echo $ECHO_N "checking for char... $ECHO_C" >&6 +if test "${ac_cv_type_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((char *) 0) + return 0; +if (sizeof (char)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_char=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_char=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 +echo "${ECHO_T}$ac_cv_type_char" >&6 + +echo "$as_me:$LINENO: checking size of char" >&5 +echo $ECHO_N "checking size of char... $ECHO_C" >&6 +if test "${ac_cv_sizeof_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_char" = yes; then + # The cast to unsigned long 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. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo= ac_hi= +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_char=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77" >&5 +echo "$as_me: error: cannot compute sizeof (char), 77" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +long longval () { return (long) (sizeof (char)); } +unsigned long ulongval () { return (long) (sizeof (char)); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (char))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_char=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77" >&5 +echo "$as_me: error: cannot compute sizeof (char), 77" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_char=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + +echo "$as_me:$LINENO: checking for short int" >&5 +echo $ECHO_N "checking for short int... $ECHO_C" >&6 +if test "${ac_cv_type_short_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((short int *) 0) + return 0; +if (sizeof (short int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_short_int=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_short_int=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_short_int" >&5 +echo "${ECHO_T}$ac_cv_type_short_int" >&6 + +echo "$as_me:$LINENO: checking size of short int" >&5 +echo $ECHO_N "checking size of short int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_short_int" = yes; then + # The cast to unsigned long 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. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo= ac_hi= +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_short_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (short int), 77" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +long longval () { return (long) (sizeof (short int)); } +unsigned long ulongval () { return (long) (sizeof (short int)); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (short int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (short int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (short int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_short_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (short int), 77" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_short_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_short_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int +_ACEOF + + +echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((int *) 0) + return 0; +if (sizeof (int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_int=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long 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. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo= ac_hi= +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int), 77" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int), 77" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +echo "$as_me:$LINENO: checking for long int" >&5 +echo $ECHO_N "checking for long int... $ECHO_C" >&6 +if test "${ac_cv_type_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((long int *) 0) + return 0; +if (sizeof (long int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_int=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_long_int=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_long_int" >&6 + +echo "$as_me:$LINENO: checking size of long int" >&5 +echo $ECHO_N "checking size of long int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long_int" = yes; then + # The cast to unsigned long 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. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo= ac_hi= +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long int), 77" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +long longval () { return (long) (sizeof (long int)); } +unsigned long ulongval () { return (long) (sizeof (long int)); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long int), 77" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int +_ACEOF + + + + + eval "SID_SIZEOF_CHAR=$ac_cv_sizeof_char" + + + + eval "SID_SIZEOF_SHORT_INT=$ac_cv_sizeof_short_int" + + + + eval "SID_SIZEOF_INT=$ac_cv_sizeof_int" + + + + eval "SID_SIZEOF_LONG_INT=$ac_cv_sizeof_long_int" + + + +echo "$as_me:$LINENO: checking for strncasecmp" >&5 +echo $ECHO_N "checking for strncasecmp... $ECHO_C" >&6 +if test "${ac_cv_func_strncasecmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strncasecmp (); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strncasecmp (); +char (*f) (); + +int +main () +{ +/* 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_strncasecmp) || defined (__stub___strncasecmp) +choke me +#else +f = strncasecmp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strncasecmp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_strncasecmp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strncasecmp" >&5 +echo "${ECHO_T}$ac_cv_func_strncasecmp" >&6 +if test $ac_cv_func_strncasecmp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRNCASECMP +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for strcasecmp" >&5 +echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6 +if test "${ac_cv_func_strcasecmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strcasecmp (); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strcasecmp (); +char (*f) (); + +int +main () +{ +/* 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_strcasecmp) || defined (__stub___strcasecmp) +choke me +#else +f = strcasecmp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strcasecmp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_strcasecmp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strcasecmp" >&5 +echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6 +if test $ac_cv_func_strcasecmp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRCASECMP +_ACEOF + +fi + +if test "${ac_cv_header_strstrea_h+set}" = set; then + echo "$as_me:$LINENO: checking for strstrea.h" >&5 +echo $ECHO_N "checking for strstrea.h... $ECHO_C" >&6 +if test "${ac_cv_header_strstrea_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_strstrea_h" >&5 +echo "${ECHO_T}$ac_cv_header_strstrea_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking strstrea.h usability" >&5 +echo $ECHO_N "checking strstrea.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <strstrea.h> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking strstrea.h presence" >&5 +echo $ECHO_N "checking strstrea.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <strstrea.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: strstrea.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: strstrea.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: strstrea.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: strstrea.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: strstrea.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: strstrea.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: strstrea.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: strstrea.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: strstrea.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: strstrea.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for strstrea.h" >&5 +echo $ECHO_N "checking for strstrea.h... $ECHO_C" >&6 +if test "${ac_cv_header_strstrea_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_strstrea_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_strstrea_h" >&5 +echo "${ECHO_T}$ac_cv_header_strstrea_h" >&6 + +fi +if test $ac_cv_header_strstrea_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRSTREA_H +_ACEOF + +fi + + + +echo "$as_me:$LINENO: checking for long file names" >&5 +echo $ECHO_N "checking for long file names... $ECHO_C" >&6 +if test "${ac_cv_sys_long_file_names+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_long_file_names=yes +# Test for long file names in all the places we know might matter: +# . the current directory, where building will happen +# $prefix/lib where we will be installing things +# $exec_prefix/lib likewise +# eval it to expand exec_prefix. +# $TMPDIR if set, where it might want to write temporary files +# if $TMPDIR is not set: +# /tmp where it might want to write temporary files +# /var/tmp likewise +# /usr/tmp likewise +if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then + ac_tmpdirs=$TMPDIR +else + ac_tmpdirs='/tmp /var/tmp /usr/tmp' +fi +for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do + test -d $ac_dir || continue + test -w $ac_dir || continue # It is less confusing to not echo anything here. + ac_xdir=$ac_dir/cf$$ + (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue + ac_tf1=$ac_xdir/conftest9012345 + ac_tf2=$ac_xdir/conftest9012346 + (echo 1 >$ac_tf1) 2>/dev/null + (echo 2 >$ac_tf2) 2>/dev/null + ac_val=`cat $ac_tf1 2>/dev/null` + if test ! -f $ac_tf1 || test "$ac_val" != 1; then + ac_cv_sys_long_file_names=no + rm -rf $ac_xdir 2>/dev/null + break + fi + rm -rf $ac_xdir 2>/dev/null +done +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5 +echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 +if test $ac_cv_sys_long_file_names = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_FILE_NAMES 1 +_ACEOF + +fi + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + echo "$as_me:$LINENO: checking for bool" >&5 +echo $ECHO_N "checking for bool... $ECHO_C" >&6 + if test "${test_cv_have_bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +int +main () +{ +bool aBool = true; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + test_cv_have_bool=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +test_cv_have_bool=no + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + + echo "$as_me:$LINENO: result: $test_cv_have_bool" >&5 +echo "${ECHO_T}$test_cv_have_bool" >&6 + if test "$test_cv_have_bool" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BOOL +_ACEOF + + fi + +if test "$my_cv_have_bool" = yes; then + + eval "SID_HAVE_BOOL=\"#define SID_HAVE_BOOL\"" + + +else + + eval "SID_HAVE_BOOL=\"#undef SID_HAVE_BOOL\"" + + +fi + + + echo "$as_me:$LINENO: checking whether exceptions are available" >&5 +echo $ECHO_N "checking whether exceptions are available... $ECHO_C" >&6 + if test "${test_cv_have_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <new.h> +int +main () +{ +char* buf = new(nothrow) char[1024]; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + test_cv_have_exceptions=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +test_cv_have_exceptions=no + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + + echo "$as_me:$LINENO: result: $test_cv_have_exceptions" >&5 +echo "${ECHO_T}$test_cv_have_exceptions" >&6 + if test "$test_cv_have_exceptions" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_EXCEPTIONS +_ACEOF + + fi + + + + echo "$as_me:$LINENO: checking whether standard member ios::binary is available" >&5 +echo $ECHO_N "checking whether standard member ios::binary is available... $ECHO_C" >&6 + if test "${test_cv_have_ios_binary+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <fstream.h> +int +main () +{ +ifstream myTest(ios::in|ios::binary); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + test_cv_have_ios_binary=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +test_cv_have_ios_binary=no + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + + echo "$as_me:$LINENO: result: $test_cv_have_ios_binary" >&5 +echo "${ECHO_T}$test_cv_have_ios_binary" >&6 + if test "$test_cv_have_ios_binary" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_IOS_BIN +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking whether standard member ios::openmode is available" >&5 +echo $ECHO_N "checking whether standard member ios::openmode is available... $ECHO_C" >&6 + if test "${test_cv_have_ios_openmode+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <fstream.h> + #include <iomanip.h> +int +main () +{ +ios::openmode myTest = ios::in; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + test_cv_have_ios_openmode=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +test_cv_have_ios_openmode=no + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + + echo "$as_me:$LINENO: result: $test_cv_have_ios_openmode" >&5 +echo "${ECHO_T}$test_cv_have_ios_openmode" >&6 + if test "$test_cv_have_ios_openmode" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_IOS_OPENMODE +_ACEOF + + fi + + +builders=${libdir}/sidplay/builders + +# Check whether --with-sidbuilders or --without-sidbuilders was given. +if test "${with_sidbuilders+set}" = set; then + withval="$with_sidbuilders" + builders="$withval" + +fi; + + +CXXFLAGS="$CXXFLAGS -DHAVE_UNIX -I\$(top_srcdir)/include \ +-I\$(top_srcdir)/include/sidplay" +ACLOCAL_AMFLAGS="-I unix" + + + ac_config_files="$ac_config_files Makefile include/Makefile include/sidplay/Makefile src/Makefile src/c64/Makefile src/mos6510/Makefile src/mos6526/Makefile src/mos656x/Makefile src/sid6526/Makefile src/sidtune/Makefile src/xsid/Makefile unix/Makefile unix/libsidplay2.spec unix/libsidplay2.pc unix/sidconfig.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, don't put newlines in cache variables' values. +# 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. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *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 \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + 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}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ 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[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $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 +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.54. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -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 <bug-autoconf@gnu.org>." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.54, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +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=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" + exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/sidplay/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/sidplay/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/c64/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/c64/Makefile" ;; + "src/mos6510/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mos6510/Makefile" ;; + "src/mos6526/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mos6526/Makefile" ;; + "src/mos656x/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mos656x/Makefile" ;; + "src/sid6526/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/sid6526/Makefile" ;; + "src/sidtune/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/sidtune/Makefile" ;; + "src/xsid/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/xsid/Makefile" ;; + "unix/Makefile" ) CONFIG_FILES="$CONFIG_FILES unix/Makefile" ;; + "unix/libsidplay2.spec" ) CONFIG_FILES="$CONFIG_FILES unix/libsidplay2.spec" ;; + "unix/libsidplay2.pc" ) CONFIG_FILES="$CONFIG_FILES unix/libsidplay2.pc" ;; + "unix/sidconfig.h" ) CONFIG_FILES="$CONFIG_FILES unix/sidconfig.h" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "unix/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS unix/config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + 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 + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@LIBVERSION@,$LIBVERSION,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXDEPMODE@,$CXXDEPMODE,;t t +s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t +s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@SID_HAVE_STDBOOL_H@,$SID_HAVE_STDBOOL_H,;t t +s,@SID_WORDS_ENDIANESS@,$SID_WORDS_ENDIANESS,;t t +s,@SID_SIZEOF_CHAR@,$SID_SIZEOF_CHAR,;t t +s,@SID_SIZEOF_SHORT_INT@,$SID_SIZEOF_SHORT_INT,;t t +s,@SID_SIZEOF_INT@,$SID_SIZEOF_INT,;t t +s,@SID_SIZEOF_LONG_INT@,$SID_SIZEOF_LONG_INT,;t t +s,@SID_HAVE_BOOL@,$SID_HAVE_BOOL,;t t +s,@builders@,$builders,;t t +s,@ACLOCAL_AMFLAGS@,$ACLOCAL_AMFLAGS,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # 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. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #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. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # 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. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +_am_stamp_count=`expr ${_am_stamp_count-0} + 1` +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +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 + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # 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 -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# 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=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || 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 || { (exit 1); exit 1; } +fi + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/configure.ac b/sid/sidplay-libs-2.1.0/libsidplay/configure.ac new file mode 100644 index 00000000..0667bf55 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/configure.ac @@ -0,0 +1,112 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(Makefile.am) +AC_CONFIG_AUX_DIR(unix) +AM_CONFIG_HEADER(unix/config.h) + +dnl Setup library CURRENT, REVISION and AGE +LIBCUR=1 +LIBREV=0 +LIBAGE=0 +AM_INIT_AUTOMAKE(libsidplay,2.$LIBCUR.$LIBREV) +dnl libtool-style version-info number +LIBVERSION=$LIBCUR:$LIBREV:$LIBAGE +AC_SUBST(LIBVERSION) + +AC_CANONICAL_HOST + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX + +dnl Initialize libtool. +AC_LIBTOOL_WIN32_DLL +MY_CONFIG_LIBTOOL + +dnl Checks for header files. +AC_HEADER_STDC +dnl Check for AC99 headers +AC_CHECK_HEADERS(stdbool.h) +if test "$ac_cv_header_stdbool_h" = yes; then + MY_SUBST_DEF(SID_HAVE_STDBOOL_H) +else + MY_SUBST_UNDEF(SID_HAVE_STDBOOL_H) +fi +AC_CREATE_STDINT_H(unix/sidint.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_BIGENDIAN +if test $ac_cv_c_bigendian = yes; then + MY_SUBST(SID_WORDS_ENDIANESS,SID_WORDS_BIGENDIAN) +else + MY_SUBST(SID_WORDS_ENDIANESS,SID_WORDS_LITTLEENDIAN) +fi + +AC_CHECK_SIZEOF(char, 1) +AC_CHECK_SIZEOF(short int, 2) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(long int, 4) + +MY_SUBST(SID_SIZEOF_CHAR,$ac_cv_sizeof_char) +MY_SUBST(SID_SIZEOF_SHORT_INT,$ac_cv_sizeof_short_int) +MY_SUBST(SID_SIZEOF_INT,$ac_cv_sizeof_int) +MY_SUBST(SID_SIZEOF_LONG_INT,$ac_cv_sizeof_long_int) + +dnl Checks for library functions. +AC_CHECK_FUNC(strncasecmp,[AC_DEFINE(HAVE_STRNCASECMP,, + [Define if you have the strncasecmp function.])],[]) +AC_CHECK_FUNC(strcasecmp,[AC_DEFINE(HAVE_STRCASECMP,, + [Define if you have the strcasecmp function.])],[]) +AC_CHECK_HEADER(strstrea.h,[AC_DEFINE(HAVE_STRSTREA_H,, + [Define if you have the <strstrea.h> header file.])],[]) + +AC_SYS_LONG_FILE_NAMES + +dnl Use C++ for other tests. +AC_LANG_CPLUSPLUS + +dnl Check whether the compiler has bool. +MY_CHECK_BOOL +if test "$my_cv_have_bool" = yes; then + MY_SUBST_DEF(SID_HAVE_BOOL) +else + MY_SUBST_UNDEF(SID_HAVE_BOOL) +fi + +dnl Check for exceptions. +MY_CHECK_EXCEPTIONS + +dnl Check ANSI C++ ios features +MY_CHECK_IOS_BIN +MY_CHECK_IOS_OPENMODE + +builders=${libdir}/sidplay/builders +AC_ARG_WITH(sidbuilders, + [ --with-sidbuilders=DIR + where the sid builder libraries are to be installed], + [builders="$withval"] +) +AC_SUBST(builders) + +dnl Add absolute directory for header files +CXXFLAGS="$CXXFLAGS -DHAVE_UNIX -I\$(top_srcdir)/include \ +-I\$(top_srcdir)/include/sidplay" +ACLOCAL_AMFLAGS="-I unix" +AC_SUBST(ACLOCAL_AMFLAGS) + +AC_OUTPUT( +Makefile \ +include/Makefile \ +include/sidplay/Makefile \ +src/Makefile \ +src/c64/Makefile \ +src/mos6510/Makefile \ +src/mos6526/Makefile \ +src/mos656x/Makefile \ +src/sid6526/Makefile \ +src/sidtune/Makefile \ +src/xsid/Makefile \ +unix/Makefile \ +unix/libsidplay2.spec \ +unix/libsidplay2.pc \ +unix/sidconfig.h \ +) diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/include/Makefile.am new file mode 100644 index 00000000..9ccc23eb --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = sidplay +EXTRA_DIST = config.h sidenv.h diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/include/Makefile.in new file mode 100644 index 00000000..16cc3cde --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/Makefile.in @@ -0,0 +1,426 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = sidplay +EXTRA_DIST = config.h sidenv.h +subdir = include +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ + pdf-recursive ps ps-am ps-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +# 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/sid/sidplay-libs-2.1.0/libsidplay/include/config.h b/sid/sidplay-libs-2.1.0/libsidplay/include/config.h new file mode 100644 index 00000000..2e5c8ba4 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/config.h @@ -0,0 +1,33 @@ +/*************************************************************************** + config.h - Redirect to real config.h + ------------------- + begin : Tues Dec 4 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: config.h,v $ + * Revision 1.6 2001/12/07 00:40:22 s_a_white + * Windows fixes. + * + * Revision 1.5 2001/12/05 23:34:58 s_a_white + * Now redirects to real config.h + * + ***************************************************************************/ + +#if defined(HAVE_UNIX) +# include "../unix/config.h" +#elif defined(HAVE_MSWINDOWS) +# include "../win/VC/config.h" +#else +# error Platform no supported! +#endif diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidenv.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidenv.h new file mode 100644 index 00000000..0f02e31c --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidenv.h @@ -0,0 +1,131 @@ +/*************************************************************************** + environment.h - This is the environment file which + defines all the standard functions + to be inherited by the ICs. + ------------------- + begin : Thu May 11 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sidenv.h,v $ + * Revision 1.5 2002/01/29 21:53:25 s_a_white + * Fixed envSleep + * + * Revision 1.4 2002/01/29 08:02:22 s_a_white + * PSID sample improvements. + * + * Revision 1.3 2001/07/14 13:09:35 s_a_white + * Removed cache parameters. + * + * Revision 1.2 2000/12/11 19:10:59 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#ifndef _environment_h_ +#define _environment_h_ + +#include "sidtypes.h" + +/* +// Enviroment functions - THESE FUNTIONS MUST BE PROVIDED +// TO ALLOW THE COMPONENTS TO SPEAK TO EACH OTHER. ENVP +// CAN BE USED TO CREATE VERSIONS OF THESE FUNTIONS +// WHICH ACCESS MEMBER FUNTIONS OF OTHER C++ OBJECTS! +extern void reset (void); +extern uint8_t readMemByte (uint_least16_t addr); +extern void writeMemByte (uint_least16_t addr, uint8_t data); + +// Interrupts - You must raise the interrupt(s) +// every cycle if you have not yet been serviced +extern void triggerIRQ (void); +extern void triggerNMI (void); +extern void triggerRST (void); +extern void clearIRQ (void); + +// Sidplay compatibily funtions +extern bool checkBankJump (uint_least16_t addr); +extern uint8_t readEnvMemByte (uint_least16_t addr); +*/ + +class C64Environment +{ +/* +protected: + // Eniviroment functions + virtual inline void envReset (void) + { ::reset (); } + virtual inline uint8_t envReadMemByte (uint_least16_t addr) + { ::readMemByte (addr); } + virtual inline void envWriteMemByte (uint_least16_t addr, uint8_t data) + { ::writeMemByte (addr, data); } + + // Interrupts + virtual inline void encTriggerIRQ (void) + { ::triggerIRQ (); } + virtual inline void envTriggerNMI (void) + { ::triggerNMI (); } + virtual inline void envTriggerRST (void) + { ::triggerRST (); } + virtual inline void envClearIRQ (void) + { ::clearIRQ (); } + + // Sidplay compatibily funtions + virtual inline bool envCheckBankJump (uint_least16_t addr) + { ::checkBankJump (); } + virtual inline uint8_t envReadMemDataByte (uint_least16_t addr) + { ::readMemDataByte (); } + */ + +private: + C64Environment *m_envp; + + // Sidplay2 Player Environemnt +public: + virtual ~C64Environment () {} + virtual void setEnvironment (C64Environment *envp) + { + m_envp = envp; + } + +protected: + // Eniviroment functions + virtual inline void envReset (void) + { m_envp->envReset (); } + virtual inline uint8_t envReadMemByte (uint_least16_t addr) + { return m_envp->envReadMemByte (addr); } + virtual inline void envWriteMemByte (uint_least16_t addr, uint8_t data) + { m_envp->envWriteMemByte (addr, data); } + + // Interrupts + virtual inline void envTriggerIRQ (void) + { m_envp->envTriggerIRQ (); } + virtual inline void envTriggerNMI (void) + { m_envp->envTriggerNMI (); } + virtual inline void envTriggerRST (void) + { m_envp->envTriggerRST (); } + virtual inline void envClearIRQ (void) + { m_envp->envClearIRQ (); } + + // Sidplay compatibily funtions + virtual inline bool envCheckBankJump (uint_least16_t addr) + { return m_envp->envCheckBankJump (addr); } + virtual inline uint8_t envReadMemDataByte (uint_least16_t addr) + { return m_envp->envReadMemDataByte (addr); } + virtual inline void envSleep (void) + { m_envp->envSleep (); } + virtual inline void envLoadFile (char *file) + { m_envp->envLoadFile (file); } +}; + +#endif // _environment_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Buffer.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Buffer.h new file mode 100644 index 00000000..8e766e1c --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Buffer.h @@ -0,0 +1,121 @@ +/* + * /home/ms/files/source/libsidtune/RCS/Buffer.h,v + * + * Copyright (C) Michael Schwendt <mschwendt@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef BUFFER_H +#define BUFFER_H + +#include <assert.h> +#include "sidtypes.h" + +template <class T> class Buffer_sidtt +{ + public: + Buffer_sidtt(void) : dummy(0) + { + kill(); + } + + Buffer_sidtt(T* inBuf, uint_least32_t inLen) : dummy(0) + { + kill(); + if (inBuf!=0 && inLen!=0) + { + buf = inBuf; + bufLen = inLen; + } + } + + bool assign(T* newBuf, uint_least32_t newLen) + { + erase(); + buf = newBuf; + bufLen = newLen; + return (buf!=0); + } + + T* get(void) const { return buf; } + uint_least32_t len(void) const { return bufLen; } + + T* xferPtr(void) + { + T* tmpBuf = buf; + buf = 0; + return tmpBuf; + } + + uint_least32_t xferLen(void) + { + uint_least32_t tmpBufLen = bufLen; + bufLen = 0; + return tmpBufLen; + } + + T& operator[](uint_least32_t index) + { + if (index < bufLen) + return buf[index]; + else + return dummy; + } + + bool isEmpty(void) const { return (buf==0); } + + void erase(void) + { + if (buf!=0 && bufLen!=0) + { +#ifndef SID_HAVE_BAD_COMPILER + delete[] buf; +#else + delete[] (void *) buf; +#endif + } + kill(); + } + + ~Buffer_sidtt(void) + { + erase(); + } + + private: + T* buf; + uint_least32_t bufLen; + T dummy; + + void kill(void) + { + buf = 0; + bufLen = 0; + } + + private: // prevent copying + // SAW - Need function body so code can be fully instatiated + // for exporting from dll. Use asserts in debug mode as these + // should not be used. + Buffer_sidtt(const Buffer_sidtt&) : dummy (0) { assert(0); } + Buffer_sidtt& operator=(Buffer_sidtt& b) + { + assert(0); + return b; + } +}; + +#endif /* BUFFER_H */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Makefile.am new file mode 100644 index 00000000..adb87b6a --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST=sidconfig.h sidint.h + +sidplayincludedir = $(includedir)/sidplay +sidplayinclude_HEADERS = sidendian.h sidplay2.h \ +sidtypes.h sid2types.h SidTune.h Buffer.h SmartPtr.h \ +c64env.h component.h event.h sidbuilder.h sidusage.h diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Makefile.in new file mode 100644 index 00000000..f19799ca --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/Makefile.in @@ -0,0 +1,360 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +EXTRA_DIST = sidconfig.h sidint.h + +sidplayincludedir = $(includedir)/sidplay +sidplayinclude_HEADERS = sidendian.h sidplay2.h \ +sidtypes.h sid2types.h SidTune.h Buffer.h SmartPtr.h \ +c64env.h component.h event.h sidbuilder.h sidusage.h + +subdir = include/sidplay +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(sidplayinclude_HEADERS) + +DIST_COMMON = $(sidplayinclude_HEADERS) Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/sidplay/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +sidplayincludeHEADERS_INSTALL = $(INSTALL_HEADER) +install-sidplayincludeHEADERS: $(sidplayinclude_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sidplayincludedir) + @list='$(sidplayinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(sidplayincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(sidplayincludedir)/$$f"; \ + $(sidplayincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(sidplayincludedir)/$$f; \ + done + +uninstall-sidplayincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(sidplayinclude_HEADERS)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(sidplayincludedir)/$$f"; \ + rm -f $(DESTDIR)$(sidplayincludedir)/$$f; \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(sidplayincludedir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-sidplayincludeHEADERS + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-sidplayincludeHEADERS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-sidplayincludeHEADERS install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am uninstall-sidplayincludeHEADERS + +# 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/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/SidTune.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/SidTune.h new file mode 100644 index 00000000..f544afb6 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/SidTune.h @@ -0,0 +1,356 @@ +/* + * /home/ms/files/source/libsidtune/RCS/SidTune.h,v + * + * 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 + */ + +#ifndef SIDTUNE_H +#define SIDTUNE_H + + +#include "sidtypes.h" +#include "Buffer.h" +#include "SmartPtr.h" + +#include <fstream> + + +const uint_least16_t SIDTUNE_MAX_SONGS = 256; +// Also PSID file format limit. + +const uint_least16_t SIDTUNE_MAX_CREDIT_STRINGS = 10; +const uint_least16_t SIDTUNE_MAX_CREDIT_STRLEN = 80+1; +// 80 characters plus terminating zero. + +const uint_least32_t SIDTUNE_MAX_MEMORY = 65536; +const uint_least32_t SIDTUNE_MAX_FILELEN = 65536+2+0x7C; +// C64KB+LOAD+PSID + +const int SIDTUNE_SPEED_VBI = 0; // Vertical-Blanking-Interrupt +const int SIDTUNE_SPEED_CIA_1A = 60; // CIA 1 Timer A + +const int SIDTUNE_CLOCK_UNKNOWN = 0x00; +const int SIDTUNE_CLOCK_PAL = 0x01; // These are also used in the +const int SIDTUNE_CLOCK_NTSC = 0x02; // emulator engine! +const int SIDTUNE_CLOCK_ANY = (SIDTUNE_CLOCK_PAL | SIDTUNE_CLOCK_NTSC); + +const int SIDTUNE_SIDMODEL_UNKNOWN = 0x00; +const int SIDTUNE_SIDMODEL_6581 = 0x01; // These are also used in the +const int SIDTUNE_SIDMODEL_8580 = 0x02; // emulator engine! +const int SIDTUNE_SIDMODEL_ANY = (SIDTUNE_SIDMODEL_6581 | SIDTUNE_SIDMODEL_8580); + +const int SIDTUNE_COMPATIBILITY_C64 = 0x00; // File is C64 compatible +const int SIDTUNE_COMPATIBILITY_PSID = 0x01; // File is PSID specific +const int SIDTUNE_COMPATIBILITY_R64 = 0x02; // File is Real C64 only + + +// Required to export template +#ifndef _SidTune_cpp_ +extern +#endif +template class SID_EXTERN Buffer_sidtt<const uint_least8_t>; + +struct SidTuneInfo +{ + // An instance of this structure is used to transport values to + // and from SidTune objects. + + // You must read (i.e. activate) sub-song specific information + // via: + // const SidTuneInfo& tuneInfo = SidTune[songNumber]; + // const SidTuneInfo& tuneInfo = SidTune.getInfo(); + // void SidTune.getInfo(tuneInfo&); + + // Consider the following fields as read-only, because the SidTune class + // does not provide an implementation of: bool setInfo(const SidTuneInfo&). + // Currently, the only way to get the class to accept values which + // are written to these fields is by creating a derived class. + + const char* formatString; // the name of the identified file format + const char* statusString; // error/status message of last operation + + const char* speedString; // describing the speed a song is running at + + uint_least16_t loadAddr; + uint_least16_t initAddr; + uint_least16_t playAddr; + + uint_least16_t songs; + uint_least16_t startSong; + + // The SID chip base address(es) used by the sidtune. + uint_least16_t sidChipBase1; // 0xD400 (normal, 1st SID) + uint_least16_t sidChipBase2; // 0xD?00 (2nd SID) or 0 (no 2nd SID) + + // Available after song initialization. + // + uint_least16_t irqAddr; // if (playAddr == 0), interrupt handler has been + // installed and starts calling the C64 player + // at this address + uint_least16_t currentSong; // the one that has been initialized + uint_least8_t songSpeed; // intended speed, see top + uint_least8_t clockSpeed; // -"- + uint_least8_t relocStartPage; // First available page for relocation + uint_least8_t relocPages; // Number of pages available for relocation + bool musPlayer; // whether Sidplayer routine has been installed + int sidModel; // Sid Model required for this sid + int compatibility; // compatibility requirements + bool fixLoad; // whether load address might be duplicate + uint_least16_t songLength; // --- not yet supported --- + // + // Song title, credits, ... + // 0 = Title, 1 = Author, 2 = Copyright/Publisher + // + uint_least8_t numberOfInfoStrings; // the number of available text info lines + char* infoString[SIDTUNE_MAX_CREDIT_STRINGS]; + // + uint_least16_t numberOfCommentStrings; // --- not yet supported --- + char ** commentString; // --- not yet supported --- + // + uint_least32_t dataFileLen; // length of single-file sidtune file + uint_least32_t c64dataLen; // length of raw C64 data without load address + char* path; // path to sidtune files; "", if cwd + char* dataFileName; // a first file: e.g. "foo.c64"; "", if none + char* infoFileName; // a second file: e.g. "foo.sid"; "", if none + // +}; + + +class SID_EXTERN SidTune +{ + + public: // ---------------------------------------------------------------- + + // If your opendir() and readdir()->d_name return path names + // that contain the forward slash (/) as file separator, but + // your operating system uses a different character, there are + // extra functions that can deal with this special case. Set + // separatorIsSlash to true if you like path names to be split + // correctly. + // You do not need these extra functions if your systems file + // separator is the forward slash. + // + // Load a sidtune from a file. + // + // To retrieve data from standard input pass in filename "-". + // If you want to override the default filename extensions use this + // contructor. Please note, that if the specified ``sidTuneFileName'' + // does exist and the loader is able to determine its file format, + // this function does not try to append any file name extension. + // See ``sidtune.cpp'' for the default list of file name extensions. + // You can specific ``sidTuneFileName = 0'', if you do not want to + // load a sidtune. You can later load one with open(). + SidTune(const char* fileName, const char **fileNameExt = 0, + const bool separatorIsSlash = false); + + // Load a single-file sidtune from a memory buffer. + // Currently supported: PSID format + SidTune(const uint_least8_t* oneFileFormatSidtune, const uint_least32_t sidtuneLength); + + virtual ~SidTune(); + + // The sidTune class does not copy the list of file name extensions, + // so make sure you keep it. If the provided pointer is 0, the + // default list will be activated. This is a static list which + // is used by all SidTune objects. + void setFileNameExtensions(const char **fileNameExt); + + // Load a sidtune into an existing object. + // From a file. + bool load(const char* fileName, const bool separatorIsSlash = false); + + // From a buffer. + bool read(const uint_least8_t* sourceBuffer, const uint_least32_t bufferLen); + + // Select sub-song (0 = default starting song) + // and retrieve active song information. + const SidTuneInfo& operator[](const uint_least16_t songNum); + + // Select sub-song (0 = default starting song) + // and return active song number out of [1,2,..,SIDTUNE_MAX_SONGS]. + uint_least16_t selectSong(const uint_least16_t songNum); + + // Retrieve sub-song specific information. + // Beware! Still member-wise copy! + const SidTuneInfo& getInfo(); + + // Get a copy of sub-song specific information. + // Beware! Still member-wise copy! + void getInfo(SidTuneInfo&); + + // Determine current state of object (true = okay, false = error). + // Upon error condition use ``getInfo'' to get a descriptive + // text string in ``SidTuneInfo.statusString''. + operator bool() { return status; } + bool getStatus() { return status; } + + // Whether sidtune uses two SID chips. + bool isStereo() + { + return (info.sidChipBase1!=0 && info.sidChipBase2!=0); + } + + // Copy sidtune into C64 memory (64 KB). + bool placeSidTuneInC64mem(uint_least8_t* c64buf); + + // --- file save & format conversion --- + + // These functions work for any successfully created object. + // overWriteFlag: true = Overwrite existing file. + // false = Default, return error when file already + // exists. + // One could imagine an "Are you sure ?"-checkbox before overwriting + // any file. + // returns: true = Successful, false = Error condition. + bool saveC64dataFile( const char* destFileName, const bool overWriteFlag = false ); + bool saveSIDfile( const char* destFileName, const bool overWriteFlag = false ); + bool savePSIDfile( const char* destFileName, const bool overWriteFlag = false ); + + // This function can be used to remove a duplicate C64 load address in + // the C64 data (example: FE 0F 00 10 4C ...). A duplicate load address + // of offset 0x02 is indicated by the ``fixLoad'' flag in the SidTuneInfo + // structure. + // + // The ``force'' flag here can be used to remove the first load address + // and set new INIT/PLAY addresses regardless of whether a duplicate + // load address has been detected and indicated by ``fixLoad''. + // For instance, some position independent sidtunes contain a load address + // of 0xE000, but are loaded to 0x0FFE and call the player code at 0x1000. + // + // Do not forget to save the sidtune file. + void fixLoadAddress(const bool force = false, uint_least16_t initAddr = 0, + uint_least16_t playAddr = 0); + + // Does not affect status of object, and therefore can be used + // to load files. Error string is put into info.statusString, though. + bool loadFile(const char* fileName, Buffer_sidtt<const uint_least8_t>& bufferRef); + + bool saveToOpenFile( std::ofstream& toFile, const uint_least8_t* buffer, uint_least32_t bufLen ); + + protected: // ------------------------------------------------------------- + + SidTuneInfo info; + bool status; + + uint_least8_t songSpeed[SIDTUNE_MAX_SONGS]; + uint_least8_t clockSpeed[SIDTUNE_MAX_SONGS]; + uint_least16_t songLength[SIDTUNE_MAX_SONGS]; + + // holds text info from the format headers etc. + char infoString[SIDTUNE_MAX_CREDIT_STRINGS][SIDTUNE_MAX_CREDIT_STRLEN]; + + // See instructions at top. + bool isSlashedFileName; + + public: + // For files with header: offset to real data + uint_least32_t fileOffset; + protected: + + // Needed for MUS/STR player installation. + uint_least16_t musDataLen; + + public: + Buffer_sidtt<const uint_least8_t> cache; + + protected: + + // Filename extensions to append for various file types. + static const char** fileNameExtensions; + + // --- protected member functions --- + + // Convert 32-bit PSID-style speed word to internal tables. + void convertOldStyleSpeedToTables(uint_least32_t speed, + int clock = SIDTUNE_CLOCK_PAL); + + // Check SidTuneInfo fields for all real c64 only formats + bool checkRealC64Info(uint_least32_t speed); + // Check the init address is legal for real C64 only tunes + bool checkRealC64Init(void); + // Check for valid relocation information + bool checkRelocInfo(void); + // Common address resolution procedure + bool resolveAddrs(const uint_least8_t* c64data); + + // Support for various file formats. + + virtual bool PSID_fileSupport(const void* buffer, const uint_least32_t bufLen); + virtual bool PSID_fileSupportSave(std::ofstream& toFile, const uint_least8_t* dataBuffer); + + virtual bool SID_fileSupport(const void* dataBuffer, uint_least32_t dataBufLen, + const void* sidBuffer, uint_least32_t sidBufLen); + virtual bool SID_fileSupportSave(std::ofstream& toFile); + + virtual bool MUS_fileSupport(Buffer_sidtt<const uint_least8_t>& musBufRef, + Buffer_sidtt<const uint_least8_t>& strBufRef); + virtual bool MUS_detect(const void* buffer, const uint_least32_t bufLen, + uint_least32_t& voice3Index); + virtual bool MUS_mergeParts(Buffer_sidtt<const uint_least8_t>& musBufRef, + Buffer_sidtt<const uint_least8_t>& strBufRef); + virtual void MUS_setPlayerAddress(); + virtual void MUS_installPlayer(uint_least8_t *c64buf); + virtual int MUS_decodePetLine(SmartPtr_sidtt<const uint_least8_t>&, char*); + + virtual bool INFO_fileSupport(const void* dataBuffer, uint_least32_t dataBufLen, + const void* infoBuffer, uint_least32_t infoBufLen); + + // Error and status message strings. + static const char* txt_songNumberExceed; + static const char* txt_empty; + static const char* txt_unrecognizedFormat; + static const char* txt_noDataFile; + static const char* txt_notEnoughMemory; + static const char* txt_cantLoadFile; + static const char* txt_cantOpenFile; + static const char* txt_fileTooLong; + static const char* txt_dataTooLong; + static const char* txt_cantCreateFile; + static const char* txt_fileIoError; + static const char* txt_VBI; + static const char* txt_CIA; + static const char* txt_noErrors; + static const char* txt_na; + static const char* txt_badAddr; + static const char* txt_badReloc; + + private: // --------------------------------------------------------------- + + void init(); + void cleanup(); +#if !defined(SIDTUNE_NO_STDIN_LOADER) + void getFromStdIn(); +#endif + void getFromFiles(const char* name); + + void deleteFileNameCopies(); + + // Try to retrieve single-file sidtune from specified buffer. + void getFromBuffer(const uint_least8_t* const buffer, const uint_least32_t bufferLen); + + // Cache the data of a single-file or two-file sidtune and its + // corresponding file names. + bool acceptSidTune(const char* dataFileName, const char* infoFileName, + Buffer_sidtt<const uint_least8_t>& buf); + + bool createNewFileName(Buffer_sidtt<char>& destString, + const char* sourceName, const char* sourceExt); + + private: // prevent copying + SidTune(const SidTune&); + SidTune& operator=(SidTune&); +}; + +#endif /* SIDTUNE_H */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/SmartPtr.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/SmartPtr.h new file mode 100644 index 00000000..0cc7c046 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/SmartPtr.h @@ -0,0 +1,228 @@ +/* Simple smart pointer class. */ + +#ifndef SMARTPTR_H +#define SMARTPTR_H + +typedef unsigned long int ulint_smartpt; + +template <class T> +class SmartPtrBase_sidtt +{ + public: + + /* --- constructors --- */ + + SmartPtrBase_sidtt(T* buffer, ulint_smartpt bufferLen, bool bufOwner = false) : dummy(0) + { + doFree = bufOwner; + if ( bufferLen >= 1 ) + { + pBufCurrent = ( bufBegin = buffer ); + bufEnd = bufBegin + bufferLen; + bufLen = bufferLen; + status = true; + } + else + { + pBufCurrent = ( bufBegin = ( bufEnd = 0 )); + bufLen = 0; + status = false; + } + } + + /* --- destructor --- */ + + virtual ~SmartPtrBase_sidtt() + { + if ( doFree && (bufBegin != 0) ) + { +#ifndef SID_HAVE_BAD_COMPILER + delete[] bufBegin; +#else + delete[] (void*)bufBegin; +#endif + } + } + + /* --- public member functions --- */ + + virtual T* tellBegin() { return bufBegin; } + virtual ulint_smartpt tellLength() { return bufLen; } + virtual ulint_smartpt tellPos() { return (ulint_smartpt)(pBufCurrent-bufBegin); } + + virtual bool checkIndex(ulint_smartpt index) + { + return ((pBufCurrent+index)<bufEnd); + } + + virtual bool reset() + { + if ( bufLen >= 1 ) + { + pBufCurrent = bufBegin; + return (status = true); + } + else + { + return (status = false); + } + } + + virtual bool good() + { + return (pBufCurrent<bufEnd); + } + + virtual bool fail() + { + return (pBufCurrent==bufEnd); + } + + virtual void operator ++() + { + if ( good() ) + { + pBufCurrent++; + } + else + { + status = false; + } + } + + virtual void operator ++(int) + { + if ( good() ) + { + pBufCurrent++; + } + else + { + status = false; + } + } + + virtual void operator --() + { + if ( !fail() ) + { + pBufCurrent--; + } + else + { + status = false; + } + } + + virtual void operator --(int) + { + if ( !fail() ) + { + pBufCurrent--; + } + else + { + status = false; + } + } + + virtual void operator +=(ulint_smartpt offset) + { + if (checkIndex(offset)) + { + pBufCurrent += offset; + } + else + { + status = false; + } + } + + virtual void operator -=(ulint_smartpt offset) + { + if ((pBufCurrent-offset) >= bufBegin) + { + pBufCurrent -= offset; + } + else + { + status = false; + } + } + + virtual T operator*() + { + if ( good() ) + { + return *pBufCurrent; + } + else + { + status = false; + return dummy; + } + } + + virtual T& operator [](ulint_smartpt index) + { + if (checkIndex(index)) + { + return pBufCurrent[index]; + } + else + { + status = false; + return dummy; + } + } + + virtual operator bool() { return status; } + protected: + + T* bufBegin; + T* bufEnd; + T* pBufCurrent; + ulint_smartpt bufLen; + bool status; + bool doFree; + T dummy; + +}; + + +template <class T> +class SmartPtr_sidtt : public SmartPtrBase_sidtt<T> +{ + public: + + /* --- constructors --- */ + + SmartPtr_sidtt(T* buffer, ulint_smartpt bufferLen, bool bufOwner = false) + : SmartPtrBase_sidtt<T>(buffer, bufferLen, bufOwner) + { + } + + SmartPtr_sidtt() + : SmartPtrBase_sidtt<T>(0,0) + { + } + + void setBuffer(T* buffer, ulint_smartpt bufferLen) + { + if ( bufferLen >= 1 ) + { + this->pBufCurrent = ( this->bufBegin = buffer ); + this->bufEnd = this->bufBegin + bufferLen; + this->bufLen = bufferLen; + this->status = true; + } + else + { + this->pBufCurrent = this->bufBegin = this->bufEnd = 0; + this->bufLen = 0; + this->status = false; + } + } +}; + +#endif /* SMARTPTR_H */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/c64env.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/c64env.h new file mode 100644 index 00000000..044dd0d0 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/c64env.h @@ -0,0 +1,46 @@ +/*************************************************************************** + c64env.h - The C64 environment interface. + ------------------- + begin : Fri Apr 4 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _c64env_h_ +#define _c64env_h_ + +#include "sidtypes.h" +#include "event.h" + +/* An implementation of of this class can be created to perform the C64 + specifics. A pointer to this child class can then be passed to + each of the conponents so they can interact with it. +*/ + +class c64env +{ +private: + EventContext &m_context; + +public: + c64env (EventContext *context) + :m_context (*context) {} + EventContext &context (void) const { return m_context; } + virtual void interruptIRQ (bool state) = 0; + virtual void interruptNMI (void) = 0; + virtual void interruptRST (void) = 0; + virtual void signalBA (bool state) = 0; + virtual void signalAEC (bool state) = 0; + virtual uint8_t readMemRamByte (uint_least16_t addr) = 0; +}; + +#endif // _c64env_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/component.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/component.h new file mode 100644 index 00000000..ee8a76c1 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/component.h @@ -0,0 +1,33 @@ +/*************************************************************************** + component.h - Standard IC interface functions. + ------------------- + begin : Fri Apr 4 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _component_h_ +#define _component_h_ + +#include "sidtypes.h" + +class component +{ +public: + virtual void reset (void) = 0; + virtual uint8_t read (uint_least8_t addr) = 0; + virtual void write (uint_least8_t addr, uint8_t data) = 0; + virtual const char *credits (void) = 0; + virtual const char *error (void) = 0; +}; + +#endif // _component_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/event.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/event.h new file mode 100644 index 00000000..b89af24e --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/event.h @@ -0,0 +1,138 @@ +/*************************************************************************** + event.h - Event scheduler (based on alarm + from Vice) + ------------------- + begin : Wed May 9 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _event_h_ +#define _event_h_ + +#include <stdio.h> +#include "sidtypes.h" + +typedef uint_fast32_t event_clock_t; +#define EVENT_CONTEXT_MAX_PENDING_EVENTS 0x100 + +class SID_EXTERN Event +{ +private: + friend class EventScheduler; + const char * const m_name; + event_clock_t m_clk; + + /* This variable is set by the event context + when it is scheduled */ + bool m_pending; + + /* Link to the next and previous events in the + list. */ + Event *m_next, *m_prev; + +public: + Event(const char * const name) + : m_name(name), + m_pending(false) {} + + virtual void event (void) = 0; +}; + +// Public Event Context +class EventContext +{ +public: + virtual void cancel (Event *event) = 0; + virtual void schedule (Event *event, event_clock_t cycles) = 0; + virtual event_clock_t getTime (void) const = 0; + virtual event_clock_t getTime (event_clock_t clock) const = 0; +}; + +// Private Event Context Object (The scheduler) +class EventScheduler: public EventContext +{ +private: + const char * const m_name; + event_clock_t m_eventClk, m_schedClk; + uint m_pendingEventClk; + uint m_pendingEventCount; + + class SID_EXTERN EventDummy: public Event + { + private: + void event (void) {;} + public: + EventDummy () : Event("Bad Event: Dummy") {;} + } m_pendingEvents; + + class SID_EXTERN EventTimeWarp: public Event + { + private: + EventScheduler &m_scheduler; + + void event (void) + { + m_scheduler.timeWarp (); + } + + public: + EventTimeWarp (EventScheduler *context) + :Event("Time Warp"), + m_scheduler(*context) + {;} + } m_timeWarp; + friend class EventTimeWarp; + +private: + void timeWarp (void); + void dispatch (void) + { + Event &e = *m_pendingEvents.m_next; + cancelPending (e); + //printf ("Event \"%s\"\n", e.m_name); + e.event (); + } + + void cancelPending (Event &event) + { + event.m_pending = false; + event.m_prev->m_next = event.m_next; + event.m_next->m_prev = event.m_prev; + m_pendingEventClk = m_pendingEvents.m_next->m_clk; + m_pendingEventCount--; + } + +public: + EventScheduler (const char * const name); + void cancel (Event *event); + void reset (void); + void schedule (Event *event, event_clock_t cycles); + + void clock (void) + { + if (m_pendingEventCount) + { + event_clock_t delta = m_pendingEventClk - m_eventClk; + m_schedClk += delta; + m_eventClk += delta; + dispatch (); + } + } + + event_clock_t getTime (void) const + { return m_schedClk; } + event_clock_t getTime (event_clock_t clock) const + { return m_schedClk - clock; } +}; + +#endif // _event_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sid2types.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sid2types.h new file mode 100644 index 00000000..55cbe75c --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sid2types.h @@ -0,0 +1,87 @@ +/*************************************************************************** + sid2types.h - sidplay2 specific types + ------------------- + begin : Fri Aug 10 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _sid2types_h_ +#define _sid2types_h_ + +#include "sidtypes.h" +#include "event.h" + +class sidbuilder; +struct SidTuneInfo; + +typedef enum {sid2_playing = 0, sid2_paused, sid2_stopped} sid2_player_t; +typedef enum {sid2_left = 0, sid2_mono, sid2_stereo, sid2_right} sid2_playback_t; +typedef enum {sid2_envPS = 0, sid2_envTP, sid2_envBS, sid2_envR, + sid2_envTR} sid2_env_t; +typedef enum {SID2_MODEL_CORRECT, SID2_MOS6581, SID2_MOS8580} sid2_model_t; +typedef enum {SID2_CLOCK_CORRECT, SID2_CLOCK_PAL, SID2_CLOCK_NTSC} sid2_clock_t; + +typedef enum +{ // Soundcard sample format + SID2_LITTLE_SIGNED, + SID2_LITTLE_UNSIGNED, + SID2_BIG_SIGNED, + SID2_BIG_UNSIGNED +} sid2_sample_t; + +/* Environment Modes +sid2_envPS = Playsid +sid2_envTP = Sidplay - Transparent Rom +sid2_envBS = Sidplay - Bankswitching +sid2_envR = Sidplay2 - Real C64 Environment +*/ + +struct sid2_config_t +{ + sid2_clock_t clockDefault; // Intended tune speed when unknown + bool clockForced; + sid2_clock_t clockSpeed; // User requested emulation speed + sid2_env_t environment; + bool forceDualSids; + uint_least32_t frequency; + uint_least8_t optimisation; + sid2_playback_t playback; + int precision; + sid2_model_t sidDefault; // Intended sid model when unknown + sidbuilder *sidEmulation; + sid2_model_t sidModel; // User requested sid model + bool sidSamples; + uint_least32_t leftVolume; + uint_least32_t rightVolume; + sid2_sample_t sampleFormat; +}; + +struct sid2_info_t +{ + const char **credits; + uint channels; + uint_least16_t driverAddr; + uint_least16_t driverLength; + const char *name; + const SidTuneInfo *tuneInfo; // May not need this + const char *version; + // load, config and stop calls will reset this + // and remove all pending events! 10th sec resolution. + EventContext *eventContext; + uint maxsids; + sid2_env_t environment; + // Random delay used before starting the sid + uint_least16_t rnddelay; +}; + +#endif // _sid2types_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidbuilder.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidbuilder.h new file mode 100644 index 00000000..8dde0548 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidbuilder.h @@ -0,0 +1,77 @@ +/*************************************************************************** + sidbuilder.h - Sid Builder Classes + ------------------- + begin : Sat May 6 2001 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _sidbuilder_h_ +#define _sidbuilder_h_ + +#include "sid2types.h" +#include "component.h" +#include "c64env.h" + + +// Inherit this class to create a new SID emulations for libsidplay2. +class sidbuilder; +class sidemu: public component +{ +private: + sidbuilder *m_builder; + +public: + sidemu (sidbuilder *builder) + :m_builder (builder) {;} + virtual ~sidemu () {;} + + // Standard component functions + void reset () { reset (0); } + virtual void reset (uint8_t volume) = 0; + virtual uint8_t read (uint_least8_t addr) = 0; + virtual void write (uint_least8_t addr, uint8_t data) = 0; + virtual const char *credits (void) = 0; + + // Standard SID functions + virtual int_least32_t output (uint_least8_t bits) = 0; + virtual void voice (uint_least8_t num, + uint_least8_t vol, + bool mute) = 0; + virtual void gain (int_least8_t precent) = 0; + sidbuilder *builder (void) const { return m_builder; } +}; + + +class sidbuilder +{ +private: + const char * const m_name; + +protected: + bool m_status; + +public: + // Determine current state of object (true = okay, false = error). + sidbuilder(const char * const name) + : m_name(name), m_status (true) {;} + virtual ~sidbuilder() {;} + + virtual sidemu *lock (c64env *env, sid2_model_t model) = 0; + virtual void unlock (sidemu *device) = 0; + const char *name (void) const { return m_name; } + virtual const char *error (void) const = 0; + virtual const char *credits (void) = 0; + operator bool() const { return m_status; } +}; + +#endif // _sidbuilder_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidconfig.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidconfig.h new file mode 100644 index 00000000..fa8af23e --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidconfig.h @@ -0,0 +1,33 @@ +/*************************************************************************** + sidconfig.h - Redirect to real sidconfig.h + ------------------- + begin : Tues Dec 4 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sidconfig.h,v $ + * Revision 1.5 2001/12/07 00:40:22 s_a_white + * Windows fixes. + * + * Revision 1.4 2001/12/05 23:37:39 s_a_white + * Now redirects to real sidfig.hy/i + * + ***************************************************************************/ + +#if defined(HAVE_UNIX) +# include "../../unix/sidconfig.h" +#elif defined(HAVE_MSWINDOWS) +# include "../../win/VC/sidconfig.h" +#else +# error Platform not supported! +#endif diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidendian.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidendian.h new file mode 100644 index 00000000..9fa8582d --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidendian.h @@ -0,0 +1,415 @@ +/*************************************************************************** + sidendian.h - Improtant endian functions + ------------------- + begin : Mon Jul 3 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sidendian.h,v $ + * Revision 1.5 2001/07/03 22:44:13 s_a_white + * Added endian_16 to convert a 16 bit value to an array of 8s. + * + * Revision 1.4 2001/05/07 16:27:24 s_a_white + * Fix optimisation issues with gcc 2.96. + * + * Revision 1.3 2001/03/25 19:46:12 s_a_white + * _endian_h_ changed to _sidendian_h_. + * + * Revision 1.2 2001/03/10 19:49:32 s_a_white + * Removed bad include. + * + * Revision 1.1 2001/03/02 19:04:38 s_a_white + * Include structure modified for better compatibility + * + * Revision 1.5 2001/01/07 16:01:33 s_a_white + * sidendian.h is now installed, therefore endian defines updated. + * + * Revision 1.4 2000/12/13 17:53:01 s_a_white + * Fixes some of the endian calls. + * + * Revision 1.3 2000/12/12 19:39:15 s_a_white + * Removed bad const. + * + * Revision 1.2 2000/12/11 19:10:59 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#ifndef _sidendian_h_ +#define _sidendian_h_ + +// NOTE: The optimisations in this file rely on the structure of memory +// e.g. 2 shorts being contained in 1 long. Although these sizes are +// checked to make sure the optimisation is ok, gcc 2.96 (and above) +// introduced better optimisations. This results in caching of values +// in internal registers and therefore writes to ram through the aliases +// not being reflected in the CPU regs. The use of the volatile keyword +// fixes this. + +#include "sidtypes.h" + +#if defined(SID_WORDS_BIGENDIAN) +/* byte-order: HIHI..3210..LO */ +#elif defined(SID_WORDS_LITTLEENDIAN) +/* byte-order: LO..0123..HIHI */ +#else + #error Please check source code configuration! +#endif + +/* +Labeling: +0 - LO +1 - HI +2 - HILO +3 - HIHI +*/ + +/////////////////////////////////////////////////////////////////// +// INT16 FUNCTIONS +/////////////////////////////////////////////////////////////////// +// Set the lo byte (8 bit) in a word (16 bit) +inline void endian_16lo8 (uint_least16_t &word, uint8_t byte) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + ((volatile uint8_t *) &word)[0] = byte; +# else + ((volatile uint8_t *) &word)[1] = byte; +# endif + word = *((volatile uint_least16_t *) &word); +#else + word &= 0xff00; + word |= byte; +#endif +} + +// Get the lo byte (8 bit) in a word (16 bit) +inline uint8_t endian_16lo8 (uint_least16_t word) +{ + return (uint8_t) word; +} + +// Set the hi byte (8 bit) in a word (16 bit) +inline void endian_16hi8 (uint_least16_t &word, uint8_t byte) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + ((volatile uint8_t *) &word)[1] = byte; +# else + ((volatile uint8_t *) &word)[0] = byte; +# endif + word = *((volatile uint_least16_t *) &word); +#else + word &= 0x00ff; + word |= (uint_least16_t) byte << 8; +#endif +} + +// Set the hi byte (8 bit) in a word (16 bit) +inline uint8_t endian_16hi8 (uint_least16_t word) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + return ((uint8_t *) &word)[1]; +# else + return ((uint8_t *) &word)[0]; +# endif +#else + return (uint8_t) (word >> 8); +#endif +} + +// Swap word endian. +inline void endian_16swap8 (uint_least16_t &word) +{ + uint8_t lo = endian_16lo8 (word); + uint8_t hi = endian_16hi8 (word); + endian_16lo8 (word, hi); + endian_16hi8 (word, lo); +} + +// Convert high-byte and low-byte to 16-bit word. +inline uint_least16_t endian_16 (uint8_t hi, uint8_t lo) +{ + uint_least16_t word; + endian_16lo8 (word, lo); + endian_16hi8 (word, hi); + return word; +} + +// Convert high-byte and low-byte to 16-bit little endian word. +inline void endian_16 (uint8_t ptr[2], uint_least16_t word) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) + *((uint_least16_t *) ptr) = word; +#else +# if defined(SID_WORDS_BIGENDIAN) + ptr[0] = endian_16hi8 (word); + ptr[1] = endian_16lo8 (word); +# else + ptr[0] = endian_16lo8 (word); + ptr[1] = endian_16hi8 (word); +# endif +#endif +} + +inline void endian_16 (char ptr[2], uint_least16_t word) +{ + endian_16 ((uint8_t *) ptr, word); +} + +// Convert high-byte and low-byte to 16-bit little endian word. +inline uint_least16_t endian_little16 (const uint8_t ptr[2]) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_LITTLEENDIAN) + return *((uint_least16_t *) ptr); +#else + return endian_16 (ptr[1], ptr[0]); +#endif +} + +// Write a little-endian 16-bit word to two bytes in memory. +inline void endian_little16 (uint8_t ptr[2], uint_least16_t word) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_LITTLEENDIAN) + *((uint_least16_t *) ptr) = word; +#else + ptr[0] = endian_16lo8 (word); + ptr[1] = endian_16hi8 (word); +#endif +} + +// Convert high-byte and low-byte to 16-bit big endian word. +inline uint_least16_t endian_big16 (const uint8_t ptr[2]) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_BIGENDIAN) + return *((uint_least16_t *) ptr); +#else + return endian_16 (ptr[0], ptr[1]); +#endif +} + +// Write a little-big 16-bit word to two bytes in memory. +inline void endian_big16 (uint8_t ptr[2], uint_least16_t word) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_BIGENDIAN) + *((uint_least16_t *) ptr) = word; +#else + ptr[0] = endian_16hi8 (word); + ptr[1] = endian_16lo8 (word); +#endif +} + + +/////////////////////////////////////////////////////////////////// +// INT32 FUNCTIONS +/////////////////////////////////////////////////////////////////// +// Set the lo word (16bit) in a dword (32 bit) +inline void endian_32lo16 (uint_least32_t &dword, uint_least16_t word) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + ((volatile uint_least16_t *) &dword)[0] = word; +# else + ((volatile uint_least16_t *) &dword)[1] = word; +# endif + dword = *((volatile uint_least32_t *) &dword); +#else + dword &= (uint_least32_t) 0xffff0000; + dword |= word; +#endif +} + +// Get the lo word (16bit) in a dword (32 bit) +inline uint_least16_t endian_32lo16 (uint_least32_t dword) +{ + return (uint_least16_t) dword & 0xffff; +} + +// Set the hi word (16bit) in a dword (32 bit) +inline void endian_32hi16 (uint_least32_t &dword, uint_least16_t word) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + ((volatile uint_least16_t *) &dword)[1] = word; +# else + ((volatile uint_least16_t *) &dword)[0] = word; +# endif + dword = *((volatile uint_least32_t *) &dword); +#else + dword &= (uint_least32_t) 0x0000ffff; + dword |= (uint_least32_t) word << 16; +#endif +} + +// Get the hi word (16bit) in a dword (32 bit) +inline uint_least16_t endian_32hi16 (uint_least32_t dword) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + return ((uint_least16_t *) &dword)[1]; +# else + return ((uint_least16_t *) &dword)[0]; +# endif +#else + return (uint_least16_t) (dword >> 16); +#endif +} + +// Set the lo byte (8 bit) in a dword (32 bit) +inline void endian_32lo8 (uint_least32_t &dword, uint8_t byte) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + ((volatile uint8_t *) &dword)[0] = byte; +# else + ((volatile uint8_t *) &dword)[3] = byte; +# endif + dword = *((volatile uint_least32_t *) &dword); +#else + dword &= (uint_least32_t) 0xffffff00; + dword |= (uint_least32_t) byte; +#endif +} + +// Get the lo byte (8 bit) in a dword (32 bit) +inline uint8_t endian_32lo8 (uint_least32_t dword) +{ + return (uint8_t) dword; +} + +// Set the hi byte (8 bit) in a dword (32 bit) +inline void endian_32hi8 (uint_least32_t &dword, uint8_t byte) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + ((volatile uint8_t *) &dword)[1] = byte; +# else + ((volatile uint8_t *) &dword)[2] = byte; +# endif + dword = *((volatile uint_least32_t *) &dword); +#else + dword &= (uint_least32_t) 0xffff00ff; + dword |= (uint_least32_t) byte << 8; +#endif +} + +// Get the hi byte (8 bit) in a dword (32 bit) +inline uint8_t endian_32hi8 (uint_least32_t dword) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) +# if defined(SID_WORDS_LITTLEENDIAN) + return ((uint8_t *) &dword)[1]; +# else + return ((uint8_t *) &dword)[2]; +# endif +#else + return (uint8_t) (dword >> 8); +#endif +} + +// Swap hi and lo words endian in 32 bit dword. +inline void endian_32swap16 (uint_least32_t &dword) +{ + uint_least16_t lo = endian_32lo16 (dword); + uint_least16_t hi = endian_32hi16 (dword); + endian_32lo16 (dword, hi); + endian_32hi16 (dword, lo); +} + +// Swap word endian. +inline void endian_32swap8 (uint_least32_t &dword) +{ + uint_least16_t lo, hi; + lo = endian_32lo16 (dword); + hi = endian_32hi16 (dword); + endian_16swap8 (lo); + endian_16swap8 (hi); + endian_32lo16 (dword, hi); + endian_32hi16 (dword, lo); +} + +// Convert high-byte and low-byte to 32-bit word. +inline uint_least32_t endian_32 (uint8_t hihi, uint8_t hilo, uint8_t hi, uint8_t lo) +{ + uint_least32_t dword; + uint_least16_t word; + endian_32lo8 (dword, lo); + endian_32hi8 (dword, hi); + endian_16lo8 (word, hilo); + endian_16hi8 (word, hihi); + endian_32hi16 (dword, word); + return dword; +} + +// Convert high-byte and low-byte to 32-bit little endian word. +inline uint_least32_t endian_little32 (const uint8_t ptr[4]) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_LITTLEENDIAN) + return *((uint_least32_t *) ptr); +#else + return endian_32 (ptr[3], ptr[2], ptr[1], ptr[0]); +#endif +} + +// Write a little-endian 32-bit word to four bytes in memory. +inline void endian_little32 (uint8_t ptr[4], uint_least32_t dword) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_LITTLEENDIAN) + *((uint_least32_t *) ptr) = dword; +#else + uint_least16_t word; + ptr[0] = endian_32lo8 (dword); + ptr[1] = endian_32hi8 (dword); + word = endian_32hi16 (dword); + ptr[2] = endian_16lo8 (word); + ptr[3] = endian_16hi8 (word); +#endif +} + +// Convert high-byte and low-byte to 32-bit big endian word. +inline uint_least32_t endian_big32 (const uint8_t ptr[4]) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_BIGENDIAN) + return *((uint_least32_t *) ptr); +#else + return endian_32 (ptr[0], ptr[1], ptr[2], ptr[3]); +#endif +} + +// Write a big-endian 32-bit word to four bytes in memory. +inline void endian_big32 (uint8_t ptr[4], uint_least32_t dword) +{ +#if defined(SID_OPTIMISE_MEMORY_ACCESS) && \ + defined(SID_WORDS_BIGENDIAN) + *((uint_least32_t *) ptr) = dword; +#else + uint_least16_t word; + word = endian_32hi16 (dword); + ptr[1] = endian_16lo8 (word); + ptr[0] = endian_16hi8 (word); + ptr[2] = endian_32hi8 (dword); + ptr[3] = endian_32lo8 (dword); +#endif +} + +#endif // _sidendian_h_ + + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidint.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidint.h new file mode 100644 index 00000000..c2387d78 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidint.h @@ -0,0 +1,24 @@ +/*************************************************************************** + sidint.h - redirect to os dependent sidint + ------------------- + begin : Wed Dec 26 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#if defined(HAVE_UNIX) +# include "../../unix/sidint.h" +#elif defined(HAVE_MSWINDOWS) +# include "../../win/VC/sidint.h" +#else +# error Platform not supported! +#endif diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidplay2.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidplay2.h new file mode 100644 index 00000000..ccb54bca --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidplay2.h @@ -0,0 +1,73 @@ +/*************************************************************************** + sidplay2.h - Public sidplay header + ------------------- + begin : Fri Jun 9 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _sidplay2_h_ +#define _sidplay2_h_ + +#include "sidtypes.h" +#include "SidTune.h" +#include "sidbuilder.h" + +#ifndef SIDPLAY2_DEFAULTS +#define SIDPLAY2_DEFAULTS + // Default settings + const uint_least32_t SID2_DEFAULT_SAMPLING_FREQ = 44100; + const uint_least8_t SID2_DEFAULT_PRECISION = 16; + const uint_least8_t SID2_DEFAULT_OPTIMISATION = 0; + const bool SID2_DEFAULT_SID_SAMPLES = true; // Samples through sid + // Maximum values + const uint_least8_t SID2_MAX_PRECISION = 16; + const uint_least8_t SID2_MAX_OPTIMISATION = 2; +#endif // SIDPLAY2_DEFAULTS + +// Private Sidplayer +namespace SIDPLAY2_NAMESPACE +{ + class Player; +} + +class SID_EXTERN sidplay2 +{ +private: + SIDPLAY2_NAMESPACE::Player &sidplayer; + +public: + sidplay2 (); + virtual ~sidplay2 (); + + const sid2_config_t &config (void) const; + const sid2_info_t &info (void) const; + + int config (const sid2_config_t &cfg); + const char *error (void) const; + int fastForward (uint percent); + int load (SidTune *tune); + void pause (void); + uint_least32_t play (void *buffer, uint_least32_t length); + sid2_player_t state (void) const; + void stop (void); + void debug (bool enable); + + // Timer functions with respect to 10ths of a second + uint_least32_t time (void) const; + uint_least32_t mileage (void) const; + + operator bool() const { return (&sidplayer ? true: false); } + bool operator!() const { return (&sidplayer ? false: true); } +}; + +#endif // _sidplay2_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidtypes.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidtypes.h new file mode 100644 index 00000000..788c21ab --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidtypes.h @@ -0,0 +1,62 @@ +/*************************************************************************** + sidtypes.h - type definition file + ------------------- + begin : Mon Jul 3 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _sidtypes_h_ +#define _sidtypes_h_ + +#include "sidint.h" +#include "sidconfig.h" + +#if SID_SIZEOF_CHAR == 1 +# if (SID_SIZEOF_SHORT_INT == 2) || (SID_SIZEOF_INT == 2) +# if (SID_SIZEOF_INT == 4) || (SID_SIZEOF_LONG_INT == 4) +//# define SID_OPTIMISE_MEMORY_ACCESS +# endif +# endif +#endif + +#if SID_SIZEOF_CHAR != 1 +# error Code cannot work correctly on this platform as no real 8 bit data type supported! +#endif + +#ifndef SID_HAVE_BOOL +# ifdef SID_HAVE_STDBOOL_H +# include <stdbool.h> +# else + typedef int bool; +# define true 1 +# define false 0 +# endif /* SID_HAVE_STDBOOL_H */ +#endif /* HAVE_BOOL */ + +/* Custom types */ +typedef int sid_fc_t[2]; +typedef struct +{ + sid_fc_t cutoff[0x800]; + uint_least16_t points; +} sid_filter_t; +#define sid_filter_t sid_filter_t + +typedef unsigned int uint; +typedef float float32_t; +typedef double float64_t; + +#define SID_FOREVER for(;;) +#define SID_SWAP(x,y) ((x)^=(y)^=(x)^=(y)) + +#endif /* _sidtypes_h_ */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidusage.h b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidusage.h new file mode 100644 index 00000000..7d35e676 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/include/sidplay/sidusage.h @@ -0,0 +1,72 @@ +/*************************************************************************** + sidusage.h - sid usage definitions + ------------------- + begin : Tues Nov 19 2002 + copyright : (C) 2002 by Simon White + email : sidplay2@yahoo.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _sidusage_h_ +#define _sidusage_h_ + +#include "sidtypes.h" + +enum +{ + SID_READ = 1 << 0, + SID_WRITE = 1 << 1, + SID_EXECUTE = 1 << 2, + SID_STACK = 1 << 3, + SID_SAMPLE = 1 << 4, + SID_BAD_READ = 1 << 5, + SID_BAD_EXECUTE = 1 << 6, + + // Next byte provides extended information + SID_EXTENSION = 1 << 7, + + // Once SID_EXTENSION has been tested for, you + // are recommened to throw that bit away and + // assign it the following meaning where + // appropriate. This bit is not saved to file. + SID_LOAD_IMAGE = 1 << 7 +}; + +enum +{ + SID_IRQ = 1 << 0, // Play == 0 + SID_IRQ_RTI = 1 << 1, // Switch out kernal with no I flag + SID_IRQ_IFLAG = 1 << 2, // Bad I flag + SID_IRQ_DISABLE = 1 << 3, // Permently disables IRQ source + SID_IRQ_NOACK = 1 << 4, // Dosen't acknowledge IRQ source + SID_NMI = 1 << 5, // Enables NMI IRQs + SID_EXECUTE_IO = 1 << 6, // Execution in IO (under) + SID_EXECUTE_ROM = 1 << 7, // Execution in ROM (under) + SID_IRQ_OTHER = 1 << 8, // Enabled alternative IRQ + SID_BAD_STACK = 1 << 9, // Tune corrupts stack contents + SID_INSTR_EX = 1 << 10, // Extended 6510 instructions + SID_INSTR_ILL = 1 << 11, // Illegal 6510 instructions + //SID_PSID_RANDOM = 1 << 12, // PSID Random extension + SID_INSTR_BRK = 1 << 13 // 6510 BRK, indications of a bad tune... +}; + +// All unused have a reserved meaning and must contain +// a zero value +typedef struct sid_usage_t +{ + uint_least32_t flags; + // The next value may change to 16 bits + uint_least8_t memory[0x10000]; + char md5[33]; // MD5 key + uint_least16_t length; // usage scan length +} sid_usage_t; + +#endif // _sidusage_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/Makefile.am new file mode 100644 index 00000000..8c586b8b --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/Makefile.am @@ -0,0 +1,31 @@ + +SUBDIRS = c64 mos6510 mos6526 mos656x xsid sid6526 sidtune +EXTRA_DIST = psiddrv.bin kernal.bin poweron.bin + + +# The library. + +lib_LTLIBRARIES = libsidplay2.la + +libsidplay2_la_SOURCES = config.cpp event.cpp \ +player.cpp player.h \ +psiddrv.cpp mixer.cpp \ +reloc65.c sidplay2.cpp \ +nullsid.h psiddrv.a65 + +libsidplay2_la_LIBADD = \ +./mos6510/libmos6510.la ./mos6526/libmos6526.la \ +./mos656x/libmos656x.la ./xsid/libxsid.la \ +./sidtune/libsidtune.la ./sid6526/libsid6526.la + +# We substitute the libtool-specific library version in configure.in. +libsidplay2_la_LDFLAGS = -version-info $(LIBVERSION) + +# Remove bad default includes +DEFAULT_INCLUDES= + +SUFFIXES = .a65 + +%.bin : %.a65 + xa -R -G $< -o $(srcdir)/$*.o65 + od -v -An -w8 -tx1 $(srcdir)/$*.o65 | sed 's/\w\w/0x&,/g' > $(srcdir)/$@ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/Makefile.in new file mode 100644 index 00000000..5475c200 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/Makefile.in @@ -0,0 +1,607 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +SUBDIRS = c64 mos6510 mos6526 mos656x xsid sid6526 sidtune +EXTRA_DIST = psiddrv.bin kernal.bin poweron.bin + + +# The library. +lib_LTLIBRARIES = libsidplay2.la + +libsidplay2_la_SOURCES = config.cpp event.cpp \ +player.cpp player.h \ +psiddrv.cpp mixer.cpp \ +reloc65.c sidplay2.cpp \ +nullsid.h psiddrv.a65 + + +libsidplay2_la_LIBADD = \ +./mos6510/libmos6510.la ./mos6526/libmos6526.la \ +./mos656x/libmos656x.la ./xsid/libxsid.la \ +./sidtune/libsidtune.la ./sid6526/libsid6526.la + + +# We substitute the libtool-specific library version in configure.in. +libsidplay2_la_LDFLAGS = -version-info $(LIBVERSION) + +# Remove bad default includes +DEFAULT_INCLUDES = + +SUFFIXES = .a65 +subdir = src +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + +libsidplay2_la_DEPENDENCIES = ./mos6510/libmos6510.la \ + ./mos6526/libmos6526.la ./mos656x/libmos656x.la \ + ./xsid/libxsid.la ./sidtune/libsidtune.la \ + ./sid6526/libsid6526.la +am_libsidplay2_la_OBJECTS = config.lo event.lo player.lo psiddrv.lo \ + mixer.lo reloc65.lo sidplay2.lo +libsidplay2_la_OBJECTS = $(am_libsidplay2_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/unix/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/config.Plo ./$(DEPDIR)/event.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/mixer.Plo ./$(DEPDIR)/player.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/psiddrv.Plo ./$(DEPDIR)/reloc65.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/sidplay2.Plo +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libsidplay2_la_SOURCES) + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = $(libsidplay2_la_SOURCES) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .a65 .c .cpp .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +libLTLIBRARIES_INSTALL = $(INSTALL) +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libsidplay2.la: $(libsidplay2_la_OBJECTS) $(libsidplay2_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libsidplay2_la_LDFLAGS) $(libsidplay2_la_OBJECTS) $(libsidplay2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mixer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psiddrv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reloc65.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sidplay2.Plo@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(libdir) + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-recursive distclean-tags distdir \ + dvi dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive \ + install-libLTLIBRARIES install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ + ps-recursive tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-info-recursive \ + uninstall-libLTLIBRARIES uninstall-recursive + + +%.bin : %.a65 + xa -R -G $< -o $(srcdir)/$*.o65 + od -v -An -w8 -tx1 $(srcdir)/$*.o65 | sed 's/\w\w/0x&,/g' > $(srcdir)/$@ +# 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/sid/sidplay-libs-2.1.0/libsidplay/src/c64/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/Makefile.am new file mode 100644 index 00000000..94d8e182 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = c64cia.h \ +c64vic.h \ +c64xsid.h diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/c64/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/Makefile.in new file mode 100644 index 00000000..a9a93154 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/Makefile.in @@ -0,0 +1,286 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +EXTRA_DIST = c64cia.h \ +c64vic.h \ +c64xsid.h + +subdir = src/c64 +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/c64/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64cia.h b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64cia.h new file mode 100644 index 00000000..b9626405 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64cia.h @@ -0,0 +1,70 @@ +/*************************************************************************** + c64cia.h - C64 CIAs + ------------------- + begin : Fri Apr 4 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _c64cia_h_ +#define _c64cia_h_ + +// The CIA emulations are very generic and here we need to effectively +// wire them into the computer (like adding a chip to a PCB). + +#include "c64env.h" +#include "../mos6526/mos6526.h" + +/* CIA 1 specifics: + Generates IRQs +*/ +class c64cia1: public MOS6526 +{ +private: + c64env &m_env; + +protected: + void interrupt (bool state) + { + m_env.interruptIRQ (state); + } + +public: + c64cia1 (c64env *env) + :MOS6526(&(env->context ())), + m_env(*env) {} + const char *error (void) {return "";} +}; + +/* CIA 2 specifics: + Generates NMIs +*/ +class c64cia2: public MOS6526 +{ +private: + c64env &m_env; + +protected: + void interrupt (bool state) + { + if (state) + m_env.interruptNMI (); + } + +public: + c64cia2 (c64env *env) + :MOS6526(&(env->context ())), + m_env(*env) {} + const char *error (void) {return "";} +}; + +#endif // _c64cia_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64vic.h b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64vic.h new file mode 100644 index 00000000..d9b2f934 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64vic.h @@ -0,0 +1,54 @@ +/*************************************************************************** + c64vic.h - C64 VIC + ------------------- + begin : Fri Apr 4 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _c64vic_h_ +#define _c64vic_h_ + +// The VIC emulation is very generic and here we need to effectively +// wire it into the computer (like adding a chip to a PCB). +#include "c64env.h" +#include "../mos656x/mos656x.h" + +class c64vic: public MOS656X +{ +private: + c64env &m_env; + +protected: + void interrupt (bool state) + { + m_env.interruptIRQ (state); + } + + void busaccess (bool state) + { + m_env.signalBA (state); + } + + void addrctrl (bool state) + { + m_env.signalAEC (state); + } + +public: + c64vic (c64env *env) + :MOS656X(&(env->context ())), + m_env(*env) {} + const char *error (void) {return "";} +}; + +#endif // _c64vic_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64xsid.h b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64xsid.h new file mode 100644 index 00000000..e8385adb --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/c64/c64xsid.h @@ -0,0 +1,96 @@ +/*************************************************************************** + c64sid.h - ReSid Wrapper + ------------------- + begin : Fri Apr 4 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +/* This file could be a specialisation of a sid implementation. + * However since the sid emulation is not part of this project + * we are actually creating a wrapper instead. + */ + +#include "c64env.h" +#include "sidbuilder.h" +#include "../xsid/xsid.h" + +class c64xsid: public XSID +{ +private: + c64env &m_env; + sidemu *m_sid; + int_least32_t m_gain; + +private: + uint8_t readMemByte (uint_least16_t addr) + {return m_env.readMemRamByte (addr);} + void writeMemByte (uint8_t data) + {m_sid->write (0x18, data);} + +public: + c64xsid (c64env *env, sidemu *sid) + :XSID(&env->context ()), + m_env(*env), m_sid(sid), m_gain(100) + {;} + + // Standard component interface + const char *error (void) {return "";} + void reset () { sidemu::reset (); } + void reset (uint8_t volume) + { + XSID::reset (volume); + m_sid->reset (volume); + } + + uint8_t read (uint_least8_t addr) + { return m_sid->read (addr); } + + void write (uint_least8_t addr, uint8_t data) + { + if (addr == 0x18) + XSID::storeSidData0x18 (data); + else + m_sid->write (addr, data); + } + + void write16 (uint_least16_t addr, uint8_t data) + { + XSID::write (addr, data); + } + + // Standard SID interface + int_least32_t output (uint_least8_t bits) + { return m_sid->output (bits) + (XSID::output (bits) * m_gain / 100); } + + void voice (uint_least8_t num, uint_least8_t vol, + bool mute) + { + if (num == 3) + XSID::mute (mute); + else + m_sid->voice (num, vol, mute); + } + + void gain (int_least8_t percent) + { + // 0 to 99 is loss, 101 - 200 is gain + m_gain = percent; + m_gain += 100; + if (m_gain > 200) + m_gain = 200; + } + + // Xsid specific + void emulation (sidemu *sid) {m_sid = sid;} + sidemu *emulation (void) { return m_sid; } +}; diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/config.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/config.cpp new file mode 100644 index 00000000..0b4a71da --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/config.cpp @@ -0,0 +1,616 @@ +/*************************************************************************** + config.cpp - Library Configuration Code + ------------------- + begin : Fri Jul 27 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: config.cpp,v $ + * Revision 1.29 2002/10/15 18:14:02 s_a_white + * Removed upper limit frequency limit check to allow for oversampling. + * + * Revision 1.28 2002/10/02 19:46:36 s_a_white + * RSID support & fix sid model forced operation. + * + * Revision 1.27 2002/09/09 18:09:06 s_a_white + * Added error message for psid specific flag set in strict real C64 mode. + * + * Revision 1.26 2002/08/10 22:35:56 s_a_white + * Small clock speed fix for when both clockSpeed and clockDefault are set + * to SID2_CLOCK_CORRECT. + * + * Revision 1.25 2002/07/17 19:25:28 s_a_white + * Temp fix to allow SID model to change for current builder. + * + * Revision 1.24 2002/04/14 21:46:50 s_a_white + * PlaySID reads fixed to come from RAM only. + * + * Revision 1.23 2002/03/11 18:01:30 s_a_white + * Prevent lockup if config call fails with existing and old configurations. + * + * Revision 1.22 2002/03/04 19:05:49 s_a_white + * Fix C++ use of nothrow. + * + * Revision 1.21 2002/03/03 22:01:58 s_a_white + * New clock speed & sid model interface. + * + * Revision 1.20 2002/02/18 21:59:10 s_a_white + * Added two new clock modes (FIXED). Seems to be a requirement for + * HVSC/sidplayw. + * + * Revision 1.19 2002/02/04 22:08:14 s_a_white + * Fixed main voice/sample gains. + * + * Revision 1.18 2002/01/29 21:50:33 s_a_white + * Auto switching to a better emulation mode. m_tuneInfo reloaded after a + * config. Initial code added to support more than two sids. + * + * Revision 1.17 2002/01/16 19:11:38 s_a_white + * Always release sid emulations now on a call to sidCreate until a better + * method is implemented for hardware emulations with locked sids. + * + * Revision 1.16 2002/01/16 08:23:45 s_a_white + * Force a clock speed when unknown. + * + * Revision 1.15 2002/01/15 19:12:54 s_a_white + * PSID2NG update. + * + * Revision 1.14 2002/01/14 23:18:56 s_a_white + * Make sure xsid releases the old sid emulation when there are errors gaining + * a new one. + * + * Revision 1.13 2001/12/20 20:15:23 s_a_white + * Fixed bad environment initialisation when switching to legacy modes. + * + * Revision 1.12 2001/12/13 08:28:08 s_a_white + * Added namespace support to fix problems with xsidplay. + * + * Revision 1.11 2001/12/11 19:24:15 s_a_white + * More GCC3 Fixes. + * + * Revision 1.10 2001/11/23 22:59:59 s_a_white + * Added new header + * + * Revision 1.9 2001/10/02 18:27:55 s_a_white + * Updated to use new sidbuilder classes. + * + * Revision 1.8 2001/09/20 20:33:54 s_a_white + * sid2 now gets correctly set to nullsid for a bad create call. + * + * Revision 1.7 2001/09/20 19:34:11 s_a_white + * Error checking added for the builder create calls. + * + * Revision 1.6 2001/09/17 19:02:38 s_a_white + * Now uses fixed point maths for sample output and rtc. + * + * Revision 1.5 2001/09/01 11:13:56 s_a_white + * Fixes sidplay1 environment modes. + * + * Revision 1.4 2001/08/20 18:24:50 s_a_white + * tuneInfo in the info structure now correctly has the sid revision setup. + * + * Revision 1.3 2001/08/12 18:22:45 s_a_white + * Fixed bug in Player::sidEmulation call. + * + * Revision 1.2 2001/07/27 12:51:40 s_a_white + * Removed warning. + * + * Revision 1.1 2001/07/27 12:12:23 s_a_white + * Initial release. + * + ***************************************************************************/ + +#include "sid2types.h" +#include "player.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif + +SIDPLAY2_NAMESPACE_START + +// An instance of this structure is used to transport emulator settings +// to and from the interface class. + +int Player::config (const sid2_config_t &cfg) +{ + if (m_running) + { + m_errorString = ERR_CONF_WHILST_ACTIVE; + goto Player_configure_error; + } + + // Check for base sampling frequency + if (cfg.frequency < 4000) + { // Rev 1.6 (saw) - Added descriptive error + m_errorString = ERR_UNSUPPORTED_FREQ; + goto Player_configure_error; + } + + // Check for legal precision + switch (cfg.precision) + { + case 8: + case 16: + case 24: + if (cfg.precision > SID2_MAX_PRECISION) + { // Rev 1.6 (saw) - Added descriptive error + m_errorString = ERR_UNSUPPORTED_PRECISION; + goto Player_configure_error; + } + break; + + default: + // Rev 1.6 (saw) - Added descriptive error + m_errorString = ERR_UNSUPPORTED_PRECISION; + goto Player_configure_error; + } + + // Only do these if we have a loaded tune + if (m_tune) + { + float64_t cpuFreq; + // Reset tune info + m_tune->getInfo(m_tuneInfo); + + // External Setups + if (sidCreate (cfg.sidEmulation, cfg.sidModel, cfg.sidDefault) < 0) + { + m_errorString = cfg.sidEmulation->error (); + m_cfg.sidEmulation = NULL; + goto Player_configure_restore; + } + // Must be this order: + // Determine clock speed + cpuFreq = clockSpeed (cfg.clockSpeed, cfg.clockDefault, + cfg.clockForced); + // Fixed point conversion 16.16 + m_samplePeriod = (event_clock_t) (cpuFreq / + (float64_t) cfg.frequency * + (1 << 16) * m_fastForwardFactor); + // Setup fake cia + sid6526.clock ((uint_least16_t)(cpuFreq / VIC_FREQ_PAL + 0.5)); + if (m_tuneInfo.songSpeed == SIDTUNE_SPEED_CIA_1A || + m_tuneInfo.clockSpeed == SIDTUNE_CLOCK_NTSC) + { + sid6526.clock ((uint_least16_t)(cpuFreq / VIC_FREQ_NTSC + 0.5)); + } + // Configure, setup and install C64 environment/events + if (environment (cfg.environment) < 0) + goto Player_configure_restore; + // Start the real time clock event + rtc.clock (cpuFreq); + } + sidSamples (cfg.sidSamples); + + // All parameters check out, so configure player. + m_info.channels = 1; + if (cfg.playback == sid2_stereo) + m_info.channels++; + + m_sidAddress[0] = m_tuneInfo.sidChipBase1; + m_sidAddress[1] = m_tuneInfo.sidChipBase2; + + // Only force dual sids if second wasn't detected + if (!m_sidAddress[1] && cfg.forceDualSids) + m_sidAddress[1] = 0xd500; // Assumed + + m_leftVolume = cfg.leftVolume; + m_rightVolume = cfg.rightVolume; + + if (cfg.playback != sid2_mono) + { // Try Spliting channels across 2 sids + if (!m_sidAddress[1]) + { + m_sidAddress[1] = m_sidAddress[0]; + + // Mute Voices + sid[0]->voice (0, 0, true); + sid[0]->voice (2, 0, true); + sid[1]->voice (1, 0, true); + // 2 Voices scaled to unity from 4 (was !SID_VOL) + // m_leftVolume *= 2; + // m_rightVolume *= 2; + // 2 Voices scaled to unity from 3 (was SID_VOL) + // m_leftVolume *= 3; + // m_leftVolume /= 2; + // m_rightVolume *= 3; + // m_rightVolume /= 2; + } + + if (cfg.playback == sid2_left) + xsid.mute (true); + } + + // Setup the audio side, depending on the audio hardware + // and the information returned by sidtune + switch (cfg.precision) + { + case 8: + if (!m_sidAddress[1]) + { + if (cfg.playback == sid2_stereo) + output = &Player::stereoOut8MonoIn; + else + output = &Player::monoOut8MonoIn; + } + else + { + switch (cfg.playback) + { + case sid2_stereo: // Stereo Hardware + output = &Player::stereoOut8StereoIn; + break; + + case sid2_right: // Mono Hardware, + output = &Player::monoOut8StereoRIn; + break; + + case sid2_left: + output = &Player::monoOut8MonoIn; + break; + + case sid2_mono: + output = &Player::monoOut8StereoIn; + break; + } + } + break; + + case 16: + if (!m_sidAddress[1]) + { + if (cfg.playback == sid2_stereo) + output = &Player::stereoOut16MonoIn; + else + output = &Player::monoOut16MonoIn; + } + else + { + switch (cfg.playback) + { + case sid2_stereo: // Stereo Hardware + output = &Player::stereoOut16StereoIn; + break; + + case sid2_right: // Mono Hardware, + output = &Player::monoOut16StereoRIn; + break; + + case sid2_left: + output = &Player::monoOut16MonoIn; + break; + + case sid2_mono: + output = &Player::monoOut16StereoIn; + break; + } + } + } + + // Update Configuration + m_cfg = cfg; + + if (m_cfg.optimisation > SID2_MAX_OPTIMISATION) + m_cfg.optimisation = SID2_MAX_OPTIMISATION; +return 0; + +Player_configure_restore: + // Try restoring old configuration + if (&m_cfg != &cfg) + config (m_cfg); +Player_configure_error: + return -1; +} + +// Clock speed changes due to loading a new song +float64_t Player::clockSpeed (sid2_clock_t userClock, sid2_clock_t defaultClock, + bool forced) +{ + float64_t cpuFreq = CLOCK_FREQ_PAL; + + // Detect the Correct Song Speed + // Determine song speed when unknown + if (m_tuneInfo.clockSpeed == SIDTUNE_CLOCK_UNKNOWN) + { + switch (defaultClock) + { + case SID2_CLOCK_PAL: + m_tuneInfo.clockSpeed = SIDTUNE_CLOCK_PAL; + break; + case SID2_CLOCK_NTSC: + m_tuneInfo.clockSpeed = SIDTUNE_CLOCK_NTSC; + break; + case SID2_CLOCK_CORRECT: + // No default so base it on emulation clock + m_tuneInfo.clockSpeed = SIDTUNE_CLOCK_ANY; + } + } + + // Since song will run correct at any clock speed + // set tune speed to the current emulation + if (m_tuneInfo.clockSpeed == SIDTUNE_CLOCK_ANY) + { + if (userClock == SID2_CLOCK_CORRECT) + userClock = defaultClock; + + switch (userClock) + { + case SID2_CLOCK_NTSC: + m_tuneInfo.clockSpeed = SIDTUNE_CLOCK_NTSC; + break; + case SID2_CLOCK_PAL: + default: + m_tuneInfo.clockSpeed = SIDTUNE_CLOCK_PAL; + break; + } + } + + if (userClock == SID2_CLOCK_CORRECT) + { + switch (m_tuneInfo.clockSpeed) + { + case SIDTUNE_CLOCK_NTSC: + userClock = SID2_CLOCK_NTSC; + break; + case SIDTUNE_CLOCK_PAL: + userClock = SID2_CLOCK_PAL; + break; + } + } + + if (forced) + { + m_tuneInfo.clockSpeed = SIDTUNE_CLOCK_PAL; + if (userClock == SID2_CLOCK_NTSC) + m_tuneInfo.clockSpeed = SIDTUNE_CLOCK_NTSC; + } + + if (m_tuneInfo.clockSpeed == SIDTUNE_CLOCK_PAL) + vic.chip (MOS6569); + else // if (tuneInfo.clockSpeed == SIDTUNE_CLOCK_NTSC) + vic.chip (MOS6567R8); + + if (userClock == SID2_CLOCK_PAL) + { + cpuFreq = CLOCK_FREQ_PAL; + m_tuneInfo.speedString = TXT_PAL_VBI; + if (m_tuneInfo.songSpeed == SIDTUNE_SPEED_CIA_1A) + m_tuneInfo.speedString = TXT_PAL_CIA; + else if (m_tuneInfo.clockSpeed == SIDTUNE_CLOCK_NTSC) + m_tuneInfo.speedString = TXT_PAL_VBI_FIXED; + } + else // if (userClock == SID2_CLOCK_NTSC) + { + cpuFreq = CLOCK_FREQ_NTSC; + m_tuneInfo.speedString = TXT_NTSC_VBI; + if (m_tuneInfo.songSpeed == SIDTUNE_SPEED_CIA_1A) + m_tuneInfo.speedString = TXT_NTSC_CIA; + else if (m_tuneInfo.clockSpeed == SIDTUNE_CLOCK_PAL) + m_tuneInfo.speedString = TXT_NTSC_VBI_FIXED; + } + return cpuFreq; +} + +int Player::environment (sid2_env_t env) +{ + switch (m_tuneInfo.compatibility) + { + case SIDTUNE_COMPATIBILITY_R64: + env = sid2_envR; + break; + case SIDTUNE_COMPATIBILITY_PSID: + if (env == sid2_envR) + env = sid2_envBS; + } + + // Environment already set? + if (!(m_ram && (m_info.environment == env))) + { // Setup new player environment + m_info.environment = env; + if (m_ram) + { + if (m_ram == m_rom) + delete [] m_ram; + else + { + delete [] m_rom; + delete [] m_ram; + } + } + +#ifdef HAVE_EXCEPTIONS + m_ram = new(std::nothrow) uint8_t[0x10000]; +#else + m_ram = new uint8_t[0x10000]; +#endif + + // Setup the access functions to the environment + // and the properties the memory has. + if (m_info.environment == sid2_envPS) + { // Playsid has no roms and SID exists in ram space + m_rom = m_ram; + m_readMemByte = &Player::readMemByte_player; + m_writeMemByte = &Player::writeMemByte_playsid; + m_readMemDataByte = &Player::readMemByte_plain; + } + else + { +#ifdef HAVE_EXCEPTIONS + m_rom = new(std::nothrow) uint8_t[0x10000]; +#else + m_rom = new uint8_t[0x10000]; +#endif + + switch (m_info.environment) + { + case sid2_envTP: + m_readMemByte = &Player::readMemByte_player; + m_writeMemByte = &Player::writeMemByte_sidplay; + m_readMemDataByte = &Player::readMemByte_sidplaytp; + break; + + //case sid2_envTR: + case sid2_envBS: + m_readMemByte = &Player::readMemByte_player; + m_writeMemByte = &Player::writeMemByte_sidplay; + m_readMemDataByte = &Player::readMemByte_sidplaybs; + break; + + case sid2_envR: + default: // <-- Just to please compiler + m_readMemByte = &Player::readMemByte_player; + m_writeMemByte = &Player::writeMemByte_sidplay; + m_readMemDataByte = &Player::readMemByte_sidplaybs; + break; + } + } + } + + { // Have to reload the song into memory as + // everything has changed + int ret; + sid2_env_t old = m_info.environment; + m_info.environment = env; + ret = initialise (); + m_info.environment = old; + return ret; + } +} + +// Integrate SID emulation from the builder class into +// libsidplay2 +int Player::sidCreate (sidbuilder *builder, sid2_model_t userModel, + sid2_model_t defaultModel) +{ + sid[0] = xsid.emulation (); + /* @FIXME@ Removed as prevents SID + * Model being updated + **************************************** + // If we are already using the emulation + // then don't change + if (builder == sid[0]->builder ()) + { + sid[0] = &xsid; + return 0; + } + ****************************************/ + + // Make xsid forget it's emulation + xsid.emulation (&nullsid); + + { // Release old sids + for (int i = 0; i < SID2_MAX_SIDS; i++) + { + sidbuilder *b; + b = sid[i]->builder (); + if (b) + b->unlock (sid[i]); + } + } + + if (!builder) + { // No sid + for (int i = 0; i < SID2_MAX_SIDS; i++) + sid[i] = &nullsid; + } + else + { // Detect the Correct SID model + // Determine model when unknown + if (m_tuneInfo.sidModel == SIDTUNE_SIDMODEL_UNKNOWN) + { + switch (defaultModel) + { + case SID2_MOS6581: + m_tuneInfo.sidModel = SIDTUNE_SIDMODEL_6581; + break; + case SID2_MOS8580: + m_tuneInfo.sidModel = SIDTUNE_SIDMODEL_8580; + break; + case SID2_MODEL_CORRECT: + // No default so base it on emulation clock + m_tuneInfo.sidModel = SIDTUNE_SIDMODEL_ANY; + } + } + + // Since song will run correct on any sid model + // set it to the current emulation + if (m_tuneInfo.sidModel == SIDTUNE_SIDMODEL_ANY) + { + if (userModel == SID2_MODEL_CORRECT) + userModel = defaultModel; + + switch (userModel) + { + case SID2_MOS8580: + m_tuneInfo.sidModel = SIDTUNE_SIDMODEL_8580; + break; + case SID2_MOS6581: + default: + m_tuneInfo.sidModel = SIDTUNE_SIDMODEL_6581; + break; + } + } + + switch (userModel) + { + case SID2_MODEL_CORRECT: + switch (m_tuneInfo.sidModel) + { + case SIDTUNE_SIDMODEL_8580: + userModel = SID2_MOS8580; + break; + case SIDTUNE_SIDMODEL_6581: + userModel = SID2_MOS6581; + break; + } + break; + // Fixup tune information if model is forced + case SID2_MOS6581: + m_tuneInfo.sidModel = SIDTUNE_SIDMODEL_6581; + break; + case SID2_MOS8580: + m_tuneInfo.sidModel = SIDTUNE_SIDMODEL_8580; + break; + } + + for (int i = 0; i < SID2_MAX_SIDS; i++) + { // Get first SID emulation + sid[i] = builder->lock (this, userModel); + if (!sid[i]) + sid[i] = &nullsid; + if ((i == 0) && !*builder) + return -1; + } + } + xsid.emulation (sid[0]); + sid[0] = &xsid; + return 0; +} + +void Player::sidSamples (bool enable) +{ + int_least8_t gain = 0; + xsid.sidSamples (enable); + + // Now balance voices + if (!enable) + gain = -25; + + xsid.gain (-100 - gain); + sid[0] = xsid.emulation (); + for (int i = 0; i < SID2_MAX_SIDS; i++) + sid[i]->gain (gain); + sid[0] = &xsid; +} + +SIDPLAY2_NAMESPACE_STOP diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/event.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/event.cpp new file mode 100644 index 00000000..ced11c38 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/event.cpp @@ -0,0 +1,121 @@ +/*************************************************************************** + event.cpp - Event schdeduler (based on alarm + from Vice) + ------------------- + begin : Wed May 9 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: event.cpp,v $ + * Revision 1.7 2002/11/21 19:55:38 s_a_white + * We now jump to next event directly instead on clocking by a number of + * cycles. + * + * Revision 1.6 2002/07/17 19:20:03 s_a_white + * More efficient event handling code. + * + * Revision 1.5 2001/10/02 18:24:09 s_a_white + * Updated to support safe scheduler interface. + * + * Revision 1.4 2001/09/17 19:00:28 s_a_white + * Constructor moved out of line. + * + * Revision 1.3 2001/09/15 13:03:50 s_a_white + * timeWarp now zeros m_eventClk instead of m_pendingEventClk which + * fixes a inifinite loop problem when driving libsidplay1. + * + ***************************************************************************/ + +#include <string.h> +#include "event.h" + +#define EVENT_TIMEWARP_COUNT 0x0FFFFF + + +EventScheduler::EventScheduler (const char * const name) +:m_name(name), + m_pendingEventCount(0), + m_timeWarp(this) +{ + memset (&m_pendingEvents, 0, sizeof (Event)); + m_pendingEvents.m_next = &m_pendingEvents; + m_pendingEvents.m_prev = &m_pendingEvents; + reset (); +} + +// Usefull to prevent clock overflowing +void EventScheduler::timeWarp () +{ + Event *e = &m_pendingEvents; + uint count = m_pendingEventCount; + while (count--) + { // Reduce all event clocks and clip them + // so none go negative + event_clock_t clk; + e = e->m_next; + clk = e->m_clk; + e->m_clk = 0; + if (clk >= m_eventClk) + e->m_clk = clk - m_eventClk; + } + m_eventClk = 0; + // Re-schedule the next timeWarp + schedule (&m_timeWarp, EVENT_TIMEWARP_COUNT); +} + +void EventScheduler::reset (void) +{ // Remove all events + Event *e = &m_pendingEvents; + uint count = m_pendingEventCount; + while (count--) + { + e = e->m_next; + e->m_pending = false; + } + m_pendingEvents.m_next = &m_pendingEvents; + m_pendingEvents.m_prev = &m_pendingEvents; + m_pendingEventClk = m_eventClk = m_schedClk = 0; + m_pendingEventCount = 0; + timeWarp (); +} + +// Add event to ordered pending queue +void EventScheduler::schedule (Event *event, event_clock_t cycles) +{ + uint clk = m_eventClk + cycles; + if (event->m_pending) + cancelPending (*event); + event->m_pending = true; + event->m_clk = clk; + + { // Now put in the correct place so we don't need to keep + // searching the list later. + Event *e = m_pendingEvents.m_next; + uint count = m_pendingEventCount; + while (count-- && (e->m_clk <= clk)) + e = e->m_next; + event->m_next = e; + event->m_prev = e->m_prev; + e->m_prev->m_next = event; + e->m_prev = event; + m_pendingEventClk = m_pendingEvents.m_next->m_clk; + m_pendingEventCount++; + } +} + +// Cancel a pending event +void EventScheduler::cancel (Event *event) +{ + if (event->m_pending) + cancelPending (*event); +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/kernal.bin b/sid/sidplay-libs-2.1.0/libsidplay/src/kernal.bin new file mode 100644 index 00000000..301badb1 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/kernal.bin @@ -0,0 +1,1024 @@ + 0x85, 0x56, 0x20, 0x0f, 0xbc, 0xa5, 0x61, 0xc9, + 0x88, 0x90, 0x03, 0x20, 0xd4, 0xba, 0x20, 0xcc, + 0xbc, 0xa5, 0x07, 0x18, 0x69, 0x81, 0xf0, 0xf3, + 0x38, 0xe9, 0x01, 0x48, 0xa2, 0x05, 0xb5, 0x69, + 0xb4, 0x61, 0x95, 0x61, 0x94, 0x69, 0xca, 0x10, + 0xf5, 0xa5, 0x56, 0x85, 0x70, 0x20, 0x53, 0xb8, + 0x20, 0xb4, 0xbf, 0xa9, 0xc4, 0xa0, 0xbf, 0x20, + 0x59, 0xe0, 0xa9, 0x00, 0x85, 0x6f, 0x68, 0x20, + 0xb9, 0xba, 0x60, 0x85, 0x71, 0x84, 0x72, 0x20, + 0xca, 0xbb, 0xa9, 0x57, 0x20, 0x28, 0xba, 0x20, + 0x5d, 0xe0, 0xa9, 0x57, 0xa0, 0x00, 0x4c, 0x28, + 0xba, 0x85, 0x71, 0x84, 0x72, 0x20, 0xc7, 0xbb, + 0xb1, 0x71, 0x85, 0x67, 0xa4, 0x71, 0xc8, 0x98, + 0xd0, 0x02, 0xe6, 0x72, 0x85, 0x71, 0xa4, 0x72, + 0x20, 0x28, 0xba, 0xa5, 0x71, 0xa4, 0x72, 0x18, + 0x69, 0x05, 0x90, 0x01, 0xc8, 0x85, 0x71, 0x84, + 0x72, 0x20, 0x67, 0xb8, 0xa9, 0x5c, 0xa0, 0x00, + 0xc6, 0x67, 0xd0, 0xe4, 0x60, 0x98, 0x35, 0x44, + 0x7a, 0x00, 0x68, 0x28, 0xb1, 0x46, 0x00, 0x20, + 0x2b, 0xbc, 0x30, 0x37, 0xd0, 0x20, 0x20, 0xf3, + 0xff, 0x86, 0x22, 0x84, 0x23, 0xa0, 0x04, 0xb1, + 0x22, 0x85, 0x62, 0xc8, 0xb1, 0x22, 0x85, 0x64, + 0xa0, 0x08, 0xb1, 0x22, 0x85, 0x63, 0xc8, 0xb1, + 0x22, 0x85, 0x65, 0x4c, 0xe3, 0xe0, 0xa9, 0x8b, + 0xa0, 0x00, 0x20, 0xa2, 0xbb, 0xa9, 0x8d, 0xa0, + 0xe0, 0x20, 0x28, 0xba, 0xa9, 0x92, 0xa0, 0xe0, + 0x20, 0x67, 0xb8, 0xa6, 0x65, 0xa5, 0x62, 0x85, + 0x65, 0x86, 0x62, 0xa6, 0x63, 0xa5, 0x64, 0x85, + 0x63, 0x86, 0x64, 0xa9, 0x00, 0x85, 0x66, 0xa5, + 0x61, 0x85, 0x70, 0xa9, 0x80, 0x85, 0x61, 0x20, + 0xd7, 0xb8, 0xa2, 0x8b, 0xa0, 0x00, 0x4c, 0xd4, + 0xbb, 0xc9, 0xf0, 0xd0, 0x07, 0x84, 0x38, 0x86, + 0x37, 0x4c, 0x63, 0xa6, 0xaa, 0xd0, 0x02, 0xa2, + 0x1e, 0x4c, 0x37, 0xa4, 0x20, 0xd2, 0xff, 0xb0, + 0xe8, 0x60, 0x20, 0xcf, 0xff, 0xb0, 0xe2, 0x60, + 0x20, 0xad, 0xe4, 0xb0, 0xdc, 0x60, 0x20, 0xc6, + 0xff, 0xb0, 0xd6, 0x60, 0x20, 0xe4, 0xff, 0xb0, + 0xd0, 0x60, 0x20, 0x8a, 0xad, 0x20, 0xf7, 0xb7, + 0xa9, 0xe1, 0x48, 0xa9, 0x46, 0x48, 0xad, 0x0f, + 0x03, 0x48, 0xad, 0x0c, 0x03, 0xae, 0x0d, 0x03, + 0xac, 0x0e, 0x03, 0x28, 0x6c, 0x14, 0x00, 0x08, + 0x8d, 0x0c, 0x03, 0x8e, 0x0d, 0x03, 0x8c, 0x0e, + 0x03, 0x68, 0x8d, 0x0f, 0x03, 0x60, 0x20, 0xd4, + 0xe1, 0xa6, 0x2d, 0xa4, 0x2e, 0xa9, 0x2b, 0x20, + 0xd8, 0xff, 0xb0, 0x95, 0x60, 0xa9, 0x01, 0x2c, + 0xa9, 0x00, 0x85, 0x0a, 0x20, 0xd4, 0xe1, 0xa5, + 0x0a, 0xa6, 0x2b, 0xa4, 0x2c, 0x20, 0xd5, 0xff, + 0xb0, 0x57, 0xa5, 0x0a, 0xf0, 0x17, 0xa2, 0x1c, + 0x20, 0xb7, 0xff, 0x29, 0x10, 0xd0, 0x17, 0xa5, + 0x7a, 0xc9, 0x02, 0xf0, 0x07, 0xa9, 0x64, 0xa0, + 0xa3, 0x4c, 0x1e, 0xab, 0x60, 0x20, 0xb7, 0xff, + 0x29, 0xbf, 0xf0, 0x05, 0xa2, 0x1d, 0x4c, 0x37, + 0xa4, 0xa5, 0x7b, 0xc9, 0x02, 0xd0, 0x0e, 0x86, + 0x2d, 0x84, 0x2e, 0xa9, 0x76, 0xa0, 0xa3, 0x20, + 0x1e, 0xab, 0x4c, 0x2a, 0xa5, 0x20, 0x8e, 0xa6, + 0x20, 0x33, 0xa5, 0x4c, 0x77, 0xa6, 0x20, 0x19, + 0xe2, 0x20, 0xc0, 0xff, 0xb0, 0x0b, 0x60, 0x20, + 0x19, 0xe2, 0xa5, 0x49, 0x20, 0xc3, 0xff, 0x90, + 0xc3, 0x4c, 0xf9, 0xe0, 0xa9, 0x00, 0x20, 0xbd, + 0xff, 0xa2, 0x01, 0xa0, 0x00, 0x20, 0xba, 0xff, + 0x20, 0x06, 0xe2, 0x20, 0x57, 0xe2, 0x20, 0x06, + 0xe2, 0x20, 0x00, 0xe2, 0xa0, 0x00, 0x86, 0x49, + 0x20, 0xba, 0xff, 0x20, 0x06, 0xe2, 0x20, 0x00, + 0xe2, 0x8a, 0xa8, 0xa6, 0x49, 0x4c, 0xba, 0xff, + 0x20, 0x0e, 0xe2, 0x4c, 0x9e, 0xb7, 0x20, 0x79, + 0x00, 0xd0, 0x02, 0x68, 0x68, 0x60, 0x20, 0xfd, + 0xae, 0x20, 0x79, 0x00, 0xd0, 0xf7, 0x4c, 0x08, + 0xaf, 0xa9, 0x00, 0x20, 0xbd, 0xff, 0x20, 0x11, + 0xe2, 0x20, 0x9e, 0xb7, 0x86, 0x49, 0x8a, 0xa2, + 0x01, 0xa0, 0x00, 0x20, 0xba, 0xff, 0x20, 0x06, + 0xe2, 0x20, 0x00, 0xe2, 0x86, 0x4a, 0xa0, 0x00, + 0xa5, 0x49, 0xe0, 0x03, 0x90, 0x01, 0x88, 0x20, + 0xba, 0xff, 0x20, 0x06, 0xe2, 0x20, 0x00, 0xe2, + 0x8a, 0xa8, 0xa6, 0x4a, 0xa5, 0x49, 0x20, 0xba, + 0xff, 0x20, 0x06, 0xe2, 0x20, 0x0e, 0xe2, 0x20, + 0x9e, 0xad, 0x20, 0xa3, 0xb6, 0xa6, 0x22, 0xa4, + 0x23, 0x4c, 0xbd, 0xff, 0xa9, 0xe0, 0xa0, 0xe2, + 0x20, 0x67, 0xb8, 0x20, 0x0c, 0xbc, 0xa9, 0xe5, + 0xa0, 0xe2, 0xa6, 0x6e, 0x20, 0x07, 0xbb, 0x20, + 0x0c, 0xbc, 0x20, 0xcc, 0xbc, 0xa9, 0x00, 0x85, + 0x6f, 0x20, 0x53, 0xb8, 0xa9, 0xea, 0xa0, 0xe2, + 0x20, 0x50, 0xb8, 0xa5, 0x66, 0x48, 0x10, 0x0d, + 0x20, 0x49, 0xb8, 0xa5, 0x66, 0x30, 0x09, 0xa5, + 0x12, 0x49, 0xff, 0x85, 0x12, 0x20, 0xb4, 0xbf, + 0xa9, 0xea, 0xa0, 0xe2, 0x20, 0x67, 0xb8, 0x68, + 0x10, 0x03, 0x20, 0xb4, 0xbf, 0xa9, 0xef, 0xa0, + 0xe2, 0x4c, 0x43, 0xe0, 0x20, 0xca, 0xbb, 0xa9, + 0x00, 0x85, 0x12, 0x20, 0x6b, 0xe2, 0xa2, 0x4e, + 0xa0, 0x00, 0x20, 0xf6, 0xe0, 0xa9, 0x57, 0xa0, + 0x00, 0x20, 0xa2, 0xbb, 0xa9, 0x00, 0x85, 0x66, + 0xa5, 0x12, 0x20, 0xdc, 0xe2, 0xa9, 0x4e, 0xa0, + 0x00, 0x4c, 0x0f, 0xbb, 0x48, 0x4c, 0x9d, 0xe2, + 0x81, 0x49, 0x0f, 0xda, 0xa2, 0x83, 0x49, 0x0f, + 0xda, 0xa2, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x05, + 0x84, 0xe6, 0x1a, 0x2d, 0x1b, 0x86, 0x28, 0x07, + 0xfb, 0xf8, 0x87, 0x99, 0x68, 0x89, 0x01, 0x87, + 0x23, 0x35, 0xdf, 0xe1, 0x86, 0xa5, 0x5d, 0xe7, + 0x28, 0x83, 0x49, 0x0f, 0xda, 0xa2, 0xa5, 0x66, + 0x48, 0x10, 0x03, 0x20, 0xb4, 0xbf, 0xa5, 0x61, + 0x48, 0xc9, 0x81, 0x90, 0x07, 0xa9, 0xbc, 0xa0, + 0xb9, 0x20, 0x0f, 0xbb, 0xa9, 0x3e, 0xa0, 0xe3, + 0x20, 0x43, 0xe0, 0x68, 0xc9, 0x81, 0x90, 0x07, + 0xa9, 0xe0, 0xa0, 0xe2, 0x20, 0x50, 0xb8, 0x68, + 0x10, 0x03, 0x4c, 0xb4, 0xbf, 0x60, 0x0b, 0x76, + 0xb3, 0x83, 0xbd, 0xd3, 0x79, 0x1e, 0xf4, 0xa6, + 0xf5, 0x7b, 0x83, 0xfc, 0xb0, 0x10, 0x7c, 0x0c, + 0x1f, 0x67, 0xca, 0x7c, 0xde, 0x53, 0xcb, 0xc1, + 0x7d, 0x14, 0x64, 0x70, 0x4c, 0x7d, 0xb7, 0xea, + 0x51, 0x7a, 0x7d, 0x63, 0x30, 0x88, 0x7e, 0x7e, + 0x92, 0x44, 0x99, 0x3a, 0x7e, 0x4c, 0xcc, 0x91, + 0xc7, 0x7f, 0xaa, 0xaa, 0xaa, 0x13, 0x81, 0x00, + 0x00, 0x00, 0x00, 0x20, 0xcc, 0xff, 0xa9, 0x00, + 0x85, 0x13, 0x20, 0x7a, 0xa6, 0x58, 0xa2, 0x80, + 0x6c, 0x00, 0x03, 0x8a, 0x30, 0x03, 0x4c, 0x3a, + 0xa4, 0x4c, 0x74, 0xa4, 0x20, 0x53, 0xe4, 0x20, + 0xbf, 0xe3, 0x20, 0x22, 0xe4, 0xa2, 0xfb, 0x9a, + 0xd0, 0xe4, 0xe6, 0x7a, 0xd0, 0x02, 0xe6, 0x7b, + 0xad, 0x60, 0xea, 0xc9, 0x3a, 0xb0, 0x0a, 0xc9, + 0x20, 0xf0, 0xef, 0x38, 0xe9, 0x30, 0x38, 0xe9, + 0xd0, 0x60, 0x80, 0x4f, 0xc7, 0x52, 0x58, 0xa9, + 0x4c, 0x85, 0x54, 0x8d, 0x10, 0x03, 0xa9, 0x48, + 0xa0, 0xb2, 0x8d, 0x11, 0x03, 0x8c, 0x12, 0x03, + 0xa9, 0x91, 0xa0, 0xb3, 0x85, 0x05, 0x84, 0x06, + 0xa9, 0xaa, 0xa0, 0xb1, 0x85, 0x03, 0x84, 0x04, + 0xa2, 0x1c, 0xbd, 0xa2, 0xe3, 0x95, 0x73, 0xca, + 0x10, 0xf8, 0xa9, 0x03, 0x85, 0x53, 0xa9, 0x00, + 0x85, 0x68, 0x85, 0x13, 0x85, 0x18, 0xa2, 0x01, + 0x8e, 0xfd, 0x01, 0x8e, 0xfc, 0x01, 0xa2, 0x19, + 0x86, 0x16, 0x38, 0x20, 0x9c, 0xff, 0x86, 0x2b, + 0x84, 0x2c, 0x38, 0x20, 0x99, 0xff, 0x86, 0x37, + 0x84, 0x38, 0x86, 0x33, 0x84, 0x34, 0xa0, 0x00, + 0x98, 0x91, 0x2b, 0xe6, 0x2b, 0xd0, 0x02, 0xe6, + 0x2c, 0x60, 0xa5, 0x2b, 0xa4, 0x2c, 0x20, 0x08, + 0xa4, 0xa9, 0x73, 0xa0, 0xe4, 0x20, 0x1e, 0xab, + 0xa5, 0x37, 0x38, 0xe5, 0x2b, 0xaa, 0xa5, 0x38, + 0xe5, 0x2c, 0x20, 0xcd, 0xbd, 0xa9, 0x60, 0xa0, + 0xe4, 0x20, 0x1e, 0xab, 0x4c, 0x44, 0xa6, 0x8b, + 0xe3, 0x83, 0xa4, 0x7c, 0xa5, 0x1a, 0xa7, 0xe4, + 0xa7, 0x86, 0xae, 0xa2, 0x0b, 0xbd, 0x47, 0xe4, + 0x9d, 0x00, 0x03, 0xca, 0x10, 0xf7, 0x60, 0x00, + 0x20, 0x42, 0x41, 0x53, 0x49, 0x43, 0x20, 0x42, + 0x59, 0x54, 0x45, 0x53, 0x20, 0x46, 0x52, 0x45, + 0x45, 0x0d, 0x00, 0x93, 0x0d, 0x20, 0x20, 0x20, + 0x20, 0x2a, 0x2a, 0x2a, 0x2a, 0x20, 0x43, 0x4f, + 0x4d, 0x4d, 0x4f, 0x44, 0x4f, 0x52, 0x45, 0x20, + 0x36, 0x34, 0x20, 0x42, 0x41, 0x53, 0x49, 0x43, + 0x20, 0x56, 0x32, 0x20, 0x2a, 0x2a, 0x2a, 0x2a, + 0x0d, 0x0d, 0x20, 0x36, 0x34, 0x4b, 0x20, 0x52, + 0x41, 0x4d, 0x20, 0x53, 0x59, 0x53, 0x54, 0x45, + 0x4d, 0x20, 0x20, 0x00, 0x81, 0x48, 0x20, 0xc9, + 0xff, 0xaa, 0x68, 0x90, 0x01, 0x8a, 0x60, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0x85, 0xa9, 0xa9, 0x01, 0x85, + 0xab, 0x60, 0xad, 0x86, 0x02, 0x91, 0xf3, 0x60, + 0x69, 0x02, 0xa4, 0x91, 0xc8, 0xd0, 0x04, 0xc5, + 0xa1, 0xd0, 0xf7, 0x60, 0x19, 0x26, 0x44, 0x19, + 0x1a, 0x11, 0xe8, 0x0d, 0x70, 0x0c, 0x06, 0x06, + 0xd1, 0x02, 0x37, 0x01, 0xae, 0x00, 0x69, 0x00, + 0xa2, 0x00, 0xa0, 0xdc, 0x60, 0xa2, 0x28, 0xa0, + 0x19, 0x60, 0xb0, 0x07, 0x86, 0xd6, 0x84, 0xd3, + 0x20, 0x6c, 0xe5, 0xa6, 0xd6, 0xa4, 0xd3, 0x60, + 0x20, 0xa0, 0xe5, 0xa9, 0x00, 0x8d, 0x91, 0x02, + 0x85, 0xcf, 0xa9, 0x48, 0x8d, 0x8f, 0x02, 0xa9, + 0xeb, 0x8d, 0x90, 0x02, 0xa9, 0x0a, 0x8d, 0x89, + 0x02, 0x8d, 0x8c, 0x02, 0xa9, 0x0e, 0x8d, 0x86, + 0x02, 0xa9, 0x04, 0x8d, 0x8b, 0x02, 0xa9, 0x0c, + 0x85, 0xcd, 0x85, 0xcc, 0xad, 0x88, 0x02, 0x09, + 0x80, 0xa8, 0xa9, 0x00, 0xaa, 0x94, 0xd9, 0x18, + 0x69, 0x28, 0x90, 0x01, 0xc8, 0xe8, 0xe0, 0x1a, + 0xd0, 0xf3, 0xa9, 0xff, 0x95, 0xd9, 0xa2, 0x18, + 0x20, 0xff, 0xe9, 0xca, 0x10, 0xfa, 0xa0, 0x00, + 0x84, 0xd3, 0x84, 0xd6, 0xa6, 0xd6, 0xa5, 0xd3, + 0xb4, 0xd9, 0x30, 0x08, 0x18, 0x69, 0x28, 0x85, + 0xd3, 0xca, 0x10, 0xf4, 0x20, 0xf0, 0xe9, 0xa9, + 0x27, 0xe8, 0xb4, 0xd9, 0x30, 0x06, 0x18, 0x69, + 0x28, 0xe8, 0x10, 0xf6, 0x85, 0xd5, 0x4c, 0x24, + 0xea, 0xe4, 0xc9, 0xf0, 0x03, 0x4c, 0xed, 0xe6, + 0x60, 0xea, 0x20, 0xa0, 0xe5, 0x4c, 0x66, 0xe5, + 0xa9, 0x03, 0x85, 0x9a, 0xa9, 0x00, 0x85, 0x99, + 0xa2, 0x2f, 0xbd, 0xb8, 0xec, 0x9d, 0xff, 0xcf, + 0xca, 0xd0, 0xf7, 0x60, 0xac, 0x77, 0x02, 0xa2, + 0x00, 0xbd, 0x78, 0x02, 0x9d, 0x77, 0x02, 0xe8, + 0xe4, 0xc6, 0xd0, 0xf5, 0xc6, 0xc6, 0x98, 0x58, + 0x18, 0x60, 0x20, 0x16, 0xe7, 0xa5, 0xc6, 0x85, + 0xcc, 0x8d, 0x92, 0x02, 0xf0, 0xf7, 0x78, 0xa5, + 0xcf, 0xf0, 0x0c, 0xa5, 0xce, 0xae, 0x87, 0x02, + 0xa0, 0x00, 0x84, 0xcf, 0x20, 0x13, 0xea, 0x20, + 0xb4, 0xe5, 0xc9, 0x83, 0xd0, 0x10, 0xa2, 0x09, + 0x78, 0x86, 0xc6, 0xbd, 0xe6, 0xec, 0x9d, 0x76, + 0x02, 0xca, 0xd0, 0xf7, 0xf0, 0xcf, 0xc9, 0x0d, + 0xd0, 0xc8, 0xa4, 0xd5, 0x84, 0xd0, 0xb1, 0xd1, + 0xc9, 0x20, 0xd0, 0x03, 0x88, 0xd0, 0xf7, 0xc8, + 0x84, 0xc8, 0xa0, 0x00, 0x8c, 0x92, 0x02, 0x84, + 0xd3, 0x84, 0xd4, 0xa5, 0xc9, 0x30, 0x1b, 0xa6, + 0xd6, 0x20, 0x91, 0xe5, 0xe4, 0xc9, 0xd0, 0x12, + 0xa5, 0xca, 0x85, 0xd3, 0xc5, 0xc8, 0x90, 0x0a, + 0xb0, 0x2b, 0x98, 0x48, 0x8a, 0x48, 0xa5, 0xd0, + 0xf0, 0x93, 0xa4, 0xd3, 0xb1, 0xd1, 0x85, 0xd7, + 0x29, 0x3f, 0x06, 0xd7, 0x24, 0xd7, 0x10, 0x02, + 0x09, 0x80, 0x90, 0x04, 0xa6, 0xd4, 0xd0, 0x04, + 0x70, 0x02, 0x09, 0x40, 0xe6, 0xd3, 0x20, 0x84, + 0xe6, 0xc4, 0xc8, 0xd0, 0x17, 0xa9, 0x00, 0x85, + 0xd0, 0xa9, 0x0d, 0xa6, 0x99, 0xe0, 0x03, 0xf0, + 0x06, 0xa6, 0x9a, 0xe0, 0x03, 0xf0, 0x03, 0x20, + 0x16, 0xe7, 0xa9, 0x0d, 0x85, 0xd7, 0x68, 0xaa, + 0x68, 0xa8, 0xa5, 0xd7, 0xc9, 0xde, 0xd0, 0x02, + 0xa9, 0xff, 0x18, 0x60, 0xc9, 0x22, 0xd0, 0x08, + 0xa5, 0xd4, 0x49, 0x01, 0x85, 0xd4, 0xa9, 0x22, + 0x60, 0x09, 0x40, 0xa6, 0xc7, 0xf0, 0x02, 0x09, + 0x80, 0xa6, 0xd8, 0xf0, 0x02, 0xc6, 0xd8, 0xae, + 0x86, 0x02, 0x20, 0x13, 0xea, 0x20, 0xb6, 0xe6, + 0x68, 0xa8, 0xa5, 0xd8, 0xf0, 0x02, 0x46, 0xd4, + 0x68, 0xaa, 0x68, 0x18, 0x58, 0x60, 0x20, 0xb3, + 0xe8, 0xe6, 0xd3, 0xa5, 0xd5, 0xc5, 0xd3, 0xb0, + 0x3f, 0xc9, 0x4f, 0xf0, 0x32, 0xad, 0x92, 0x02, + 0xf0, 0x03, 0x4c, 0x67, 0xe9, 0xa6, 0xd6, 0xe0, + 0x19, 0x90, 0x07, 0x20, 0xea, 0xe8, 0xc6, 0xd6, + 0xa6, 0xd6, 0x16, 0xd9, 0x56, 0xd9, 0xe8, 0xb5, + 0xd9, 0x09, 0x80, 0x95, 0xd9, 0xca, 0xa5, 0xd5, + 0x18, 0x69, 0x28, 0x85, 0xd5, 0xb5, 0xd9, 0x30, + 0x03, 0xca, 0xd0, 0xf9, 0x4c, 0xf0, 0xe9, 0xc6, + 0xd6, 0x20, 0x7c, 0xe8, 0xa9, 0x00, 0x85, 0xd3, + 0x60, 0xa6, 0xd6, 0xd0, 0x06, 0x86, 0xd3, 0x68, + 0x68, 0xd0, 0x9d, 0xca, 0x86, 0xd6, 0x20, 0x6c, + 0xe5, 0xa4, 0xd5, 0x84, 0xd3, 0x60, 0x48, 0x85, + 0xd7, 0x8a, 0x48, 0x98, 0x48, 0xa9, 0x00, 0x85, + 0xd0, 0xa4, 0xd3, 0xa5, 0xd7, 0x10, 0x03, 0x4c, + 0xd4, 0xe7, 0xc9, 0x0d, 0xd0, 0x03, 0x4c, 0x91, + 0xe8, 0xc9, 0x20, 0x90, 0x10, 0xc9, 0x60, 0x90, + 0x04, 0x29, 0xdf, 0xd0, 0x02, 0x29, 0x3f, 0x20, + 0x84, 0xe6, 0x4c, 0x93, 0xe6, 0xa6, 0xd8, 0xf0, + 0x03, 0x4c, 0x97, 0xe6, 0xc9, 0x14, 0xd0, 0x2e, + 0x98, 0xd0, 0x06, 0x20, 0x01, 0xe7, 0x4c, 0x73, + 0xe7, 0x20, 0xa1, 0xe8, 0x88, 0x84, 0xd3, 0x20, + 0x24, 0xea, 0xc8, 0xb1, 0xd1, 0x88, 0x91, 0xd1, + 0xc8, 0xb1, 0xf3, 0x88, 0x91, 0xf3, 0xc8, 0xc4, + 0xd5, 0xd0, 0xef, 0xa9, 0x20, 0x91, 0xd1, 0xad, + 0x86, 0x02, 0x91, 0xf3, 0x10, 0x4d, 0xa6, 0xd4, + 0xf0, 0x03, 0x4c, 0x97, 0xe6, 0xc9, 0x12, 0xd0, + 0x02, 0x85, 0xc7, 0xc9, 0x13, 0xd0, 0x03, 0x20, + 0x66, 0xe5, 0xc9, 0x1d, 0xd0, 0x17, 0xc8, 0x20, + 0xb3, 0xe8, 0x84, 0xd3, 0x88, 0xc4, 0xd5, 0x90, + 0x09, 0xc6, 0xd6, 0x20, 0x7c, 0xe8, 0xa0, 0x00, + 0x84, 0xd3, 0x4c, 0xa8, 0xe6, 0xc9, 0x11, 0xd0, + 0x1d, 0x18, 0x98, 0x69, 0x28, 0xa8, 0xe6, 0xd6, + 0xc5, 0xd5, 0x90, 0xec, 0xf0, 0xea, 0xc6, 0xd6, + 0xe9, 0x28, 0x90, 0x04, 0x85, 0xd3, 0xd0, 0xf8, + 0x20, 0x7c, 0xe8, 0x4c, 0xa8, 0xe6, 0x20, 0xcb, + 0xe8, 0x4c, 0x44, 0xec, 0x29, 0x7f, 0xc9, 0x7f, + 0xd0, 0x02, 0xa9, 0x5e, 0xc9, 0x20, 0x90, 0x03, + 0x4c, 0x91, 0xe6, 0xc9, 0x0d, 0xd0, 0x03, 0x4c, + 0x91, 0xe8, 0xa6, 0xd4, 0xd0, 0x3f, 0xc9, 0x14, + 0xd0, 0x37, 0xa4, 0xd5, 0xb1, 0xd1, 0xc9, 0x20, + 0xd0, 0x04, 0xc4, 0xd3, 0xd0, 0x07, 0xc0, 0x4f, + 0xf0, 0x24, 0x20, 0x65, 0xe9, 0xa4, 0xd5, 0x20, + 0x24, 0xea, 0x88, 0xb1, 0xd1, 0xc8, 0x91, 0xd1, + 0x88, 0xb1, 0xf3, 0xc8, 0x91, 0xf3, 0x88, 0xc4, + 0xd3, 0xd0, 0xef, 0xa9, 0x20, 0x91, 0xd1, 0xad, + 0x86, 0x02, 0x91, 0xf3, 0xe6, 0xd8, 0x4c, 0xa8, + 0xe6, 0xa6, 0xd8, 0xf0, 0x05, 0x09, 0x40, 0x4c, + 0x97, 0xe6, 0xc9, 0x11, 0xd0, 0x16, 0xa6, 0xd6, + 0xf0, 0x37, 0xc6, 0xd6, 0xa5, 0xd3, 0x38, 0xe9, + 0x28, 0x90, 0x04, 0x85, 0xd3, 0x10, 0x2a, 0x20, + 0x6c, 0xe5, 0xd0, 0x25, 0xc9, 0x12, 0xd0, 0x04, + 0xa9, 0x00, 0x85, 0xc7, 0xc9, 0x1d, 0xd0, 0x12, + 0x98, 0xf0, 0x09, 0x20, 0xa1, 0xe8, 0x88, 0x84, + 0xd3, 0x4c, 0xa8, 0xe6, 0x20, 0x01, 0xe7, 0x4c, + 0xa8, 0xe6, 0xc9, 0x13, 0xd0, 0x06, 0x20, 0x44, + 0xe5, 0x4c, 0xa8, 0xe6, 0x09, 0x80, 0x20, 0xcb, + 0xe8, 0x4c, 0x4f, 0xec, 0x46, 0xc9, 0xa6, 0xd6, + 0xe8, 0xe0, 0x19, 0xd0, 0x03, 0x20, 0xea, 0xe8, + 0xb5, 0xd9, 0x10, 0xf4, 0x86, 0xd6, 0x4c, 0x6c, + 0xe5, 0xa2, 0x00, 0x86, 0xd8, 0x86, 0xc7, 0x86, + 0xd4, 0x86, 0xd3, 0x20, 0x7c, 0xe8, 0x4c, 0xa8, + 0xe6, 0xa2, 0x02, 0xa9, 0x00, 0xc5, 0xd3, 0xf0, + 0x07, 0x18, 0x69, 0x28, 0xca, 0xd0, 0xf6, 0x60, + 0xc6, 0xd6, 0x60, 0xa2, 0x02, 0xa9, 0x27, 0xc5, + 0xd3, 0xf0, 0x07, 0x18, 0x69, 0x28, 0xca, 0xd0, + 0xf6, 0x60, 0xa6, 0xd6, 0xe0, 0x19, 0xf0, 0x02, + 0xe6, 0xd6, 0x60, 0xa2, 0x0f, 0xdd, 0xda, 0xe8, + 0xf0, 0x04, 0xca, 0x10, 0xf8, 0x60, 0x8e, 0x86, + 0x02, 0x60, 0x90, 0x05, 0x1c, 0x9f, 0x9c, 0x1e, + 0x1f, 0x9e, 0x81, 0x95, 0x96, 0x97, 0x98, 0x99, + 0x9a, 0x9b, 0xa5, 0xac, 0x48, 0xa5, 0xad, 0x48, + 0xa5, 0xae, 0x48, 0xa5, 0xaf, 0x48, 0xa2, 0xff, + 0xc6, 0xd6, 0xc6, 0xc9, 0xce, 0xa5, 0x02, 0xe8, + 0x20, 0xf0, 0xe9, 0xe0, 0x18, 0xb0, 0x0c, 0xbd, + 0xf1, 0xec, 0x85, 0xac, 0xb5, 0xda, 0x20, 0xc8, + 0xe9, 0x30, 0xec, 0x20, 0xff, 0xe9, 0xa2, 0x00, + 0xb5, 0xd9, 0x29, 0x7f, 0xb4, 0xda, 0x10, 0x02, + 0x09, 0x80, 0x95, 0xd9, 0xe8, 0xe0, 0x18, 0xd0, + 0xef, 0xa5, 0xf1, 0x09, 0x80, 0x85, 0xf1, 0xa5, + 0xd9, 0x10, 0xc3, 0xe6, 0xd6, 0xee, 0xa5, 0x02, + 0xa9, 0x7f, 0x8d, 0x00, 0xdc, 0xad, 0x01, 0xdc, + 0xc9, 0xfb, 0x08, 0xa9, 0x7f, 0x8d, 0x00, 0xdc, + 0x28, 0xd0, 0x0b, 0xa0, 0x00, 0xea, 0xca, 0xd0, + 0xfc, 0x88, 0xd0, 0xf9, 0x84, 0xc6, 0xa6, 0xd6, + 0x68, 0x85, 0xaf, 0x68, 0x85, 0xae, 0x68, 0x85, + 0xad, 0x68, 0x85, 0xac, 0x60, 0xa6, 0xd6, 0xe8, + 0xb5, 0xd9, 0x10, 0xfb, 0x8e, 0xa5, 0x02, 0xe0, + 0x18, 0xf0, 0x0e, 0x90, 0x0c, 0x20, 0xea, 0xe8, + 0xae, 0xa5, 0x02, 0xca, 0xc6, 0xd6, 0x4c, 0xda, + 0xe6, 0xa5, 0xac, 0x48, 0xa5, 0xad, 0x48, 0xa5, + 0xae, 0x48, 0xa5, 0xaf, 0x48, 0xa2, 0x19, 0xca, + 0x20, 0xf0, 0xe9, 0xec, 0xa5, 0x02, 0x90, 0x0e, + 0xf0, 0x0c, 0xbd, 0xef, 0xec, 0x85, 0xac, 0xb5, + 0xd8, 0x20, 0xc8, 0xe9, 0x30, 0xe9, 0x20, 0xff, + 0xe9, 0xa2, 0x17, 0xec, 0xa5, 0x02, 0x90, 0x0f, + 0xb5, 0xda, 0x29, 0x7f, 0xb4, 0xd9, 0x10, 0x02, + 0x09, 0x80, 0x95, 0xda, 0xca, 0xd0, 0xec, 0xae, + 0xa5, 0x02, 0x20, 0xda, 0xe6, 0x4c, 0x58, 0xe9, + 0x29, 0x03, 0x0d, 0x88, 0x02, 0x85, 0xad, 0x20, + 0xe0, 0xe9, 0xa0, 0x27, 0xb1, 0xac, 0x91, 0xd1, + 0xb1, 0xae, 0x91, 0xf3, 0x88, 0x10, 0xf5, 0x60, + 0x20, 0x24, 0xea, 0xa5, 0xac, 0x85, 0xae, 0xa5, + 0xad, 0x29, 0x03, 0x09, 0xd8, 0x85, 0xaf, 0x60, + 0xbd, 0xf0, 0xec, 0x85, 0xd1, 0xb5, 0xd9, 0x29, + 0x03, 0x0d, 0x88, 0x02, 0x85, 0xd2, 0x60, 0xa0, + 0x27, 0x20, 0xf0, 0xe9, 0x20, 0x24, 0xea, 0x20, + 0xda, 0xe4, 0xa9, 0x20, 0x91, 0xd1, 0x88, 0x10, + 0xf6, 0x60, 0xea, 0xa8, 0xa9, 0x02, 0x85, 0xcd, + 0x20, 0x24, 0xea, 0x98, 0xa4, 0xd3, 0x91, 0xd1, + 0x8a, 0x91, 0xf3, 0x60, 0xa5, 0xd1, 0x85, 0xf3, + 0xa5, 0xd2, 0x29, 0x03, 0x09, 0xd8, 0x85, 0xf4, + 0x60, 0x20, 0xea, 0xff, 0xa5, 0xcc, 0xd0, 0x29, + 0xc6, 0xcd, 0xd0, 0x25, 0xa9, 0x14, 0x85, 0xcd, + 0xa4, 0xd3, 0x46, 0xcf, 0xae, 0x87, 0x02, 0xb1, + 0xd1, 0xb0, 0x11, 0xe6, 0xcf, 0x85, 0xce, 0x20, + 0x24, 0xea, 0xb1, 0xf3, 0x8d, 0x87, 0x02, 0xae, + 0x86, 0x02, 0xa5, 0xce, 0x49, 0x80, 0x20, 0x1c, + 0xea, 0xa5, 0x01, 0x29, 0x10, 0xf0, 0x0a, 0xa0, + 0x00, 0x84, 0xc0, 0xa5, 0x01, 0x09, 0x20, 0xd0, + 0x08, 0xa5, 0xc0, 0xd0, 0x06, 0xa5, 0x01, 0x29, + 0x1f, 0x85, 0x01, 0x20, 0x87, 0xea, 0xad, 0x0d, + 0xdc, 0x68, 0xa8, 0x68, 0xaa, 0x68, 0x40, 0xa9, + 0x00, 0x8d, 0x8d, 0x02, 0xa0, 0x40, 0x84, 0xcb, + 0x8d, 0x00, 0xdc, 0xae, 0x01, 0xdc, 0xe0, 0xff, + 0xf0, 0x61, 0xa8, 0xa9, 0x81, 0x85, 0xf5, 0xa9, + 0xeb, 0x85, 0xf6, 0xa9, 0xfe, 0x8d, 0x00, 0xdc, + 0xa2, 0x08, 0x48, 0xad, 0x01, 0xdc, 0xcd, 0x01, + 0xdc, 0xd0, 0xf8, 0x4a, 0xb0, 0x16, 0x48, 0xb1, + 0xf5, 0xc9, 0x05, 0xb0, 0x0c, 0xc9, 0x03, 0xf0, + 0x08, 0x0d, 0x8d, 0x02, 0x8d, 0x8d, 0x02, 0x10, + 0x02, 0x84, 0xcb, 0x68, 0xc8, 0xc0, 0x41, 0xb0, + 0x0b, 0xca, 0xd0, 0xdf, 0x38, 0x68, 0x2a, 0x8d, + 0x00, 0xdc, 0xd0, 0xcc, 0x68, 0x6c, 0x8f, 0x02, + 0xa4, 0xcb, 0xb1, 0xf5, 0xaa, 0xc4, 0xc5, 0xf0, + 0x07, 0xa0, 0x10, 0x8c, 0x8c, 0x02, 0xd0, 0x36, + 0x29, 0x7f, 0x2c, 0x8a, 0x02, 0x30, 0x16, 0x70, + 0x49, 0xc9, 0x7f, 0xf0, 0x29, 0xc9, 0x14, 0xf0, + 0x0c, 0xc9, 0x20, 0xf0, 0x08, 0xc9, 0x1d, 0xf0, + 0x04, 0xc9, 0x11, 0xd0, 0x35, 0xac, 0x8c, 0x02, + 0xf0, 0x05, 0xce, 0x8c, 0x02, 0xd0, 0x2b, 0xce, + 0x8b, 0x02, 0xd0, 0x26, 0xa0, 0x04, 0x8c, 0x8b, + 0x02, 0xa4, 0xc6, 0x88, 0x10, 0x1c, 0xa4, 0xcb, + 0x84, 0xc5, 0xac, 0x8d, 0x02, 0x8c, 0x8e, 0x02, + 0xe0, 0xff, 0xf0, 0x0e, 0x8a, 0xa6, 0xc6, 0xec, + 0x89, 0x02, 0xb0, 0x06, 0x9d, 0x77, 0x02, 0xe8, + 0x86, 0xc6, 0xa9, 0x7f, 0x8d, 0x00, 0xdc, 0x60, + 0xad, 0x8d, 0x02, 0xc9, 0x03, 0xd0, 0x15, 0xcd, + 0x8e, 0x02, 0xf0, 0xee, 0xad, 0x91, 0x02, 0x30, + 0x1d, 0xad, 0x18, 0xd0, 0x49, 0x02, 0x8d, 0x18, + 0xd0, 0x4c, 0x76, 0xeb, 0x0a, 0xc9, 0x08, 0x90, + 0x02, 0xa9, 0x06, 0xaa, 0xbd, 0x79, 0xeb, 0x85, + 0xf5, 0xbd, 0x7a, 0xeb, 0x85, 0xf6, 0x4c, 0xe0, + 0xea, 0x81, 0xeb, 0xc2, 0xeb, 0x03, 0xec, 0x78, + 0xec, 0x14, 0x0d, 0x1d, 0x88, 0x85, 0x86, 0x87, + 0x11, 0x33, 0x57, 0x41, 0x34, 0x5a, 0x53, 0x45, + 0x01, 0x35, 0x52, 0x44, 0x36, 0x43, 0x46, 0x54, + 0x58, 0x37, 0x59, 0x47, 0x38, 0x42, 0x48, 0x55, + 0x56, 0x39, 0x49, 0x4a, 0x30, 0x4d, 0x4b, 0x4f, + 0x4e, 0x2b, 0x50, 0x4c, 0x2d, 0x2e, 0x3a, 0x40, + 0x2c, 0x5c, 0x2a, 0x3b, 0x13, 0x01, 0x3d, 0x5e, + 0x2f, 0x31, 0x5f, 0x04, 0x32, 0x20, 0x02, 0x51, + 0x03, 0xff, 0x94, 0x8d, 0x9d, 0x8c, 0x89, 0x8a, + 0x8b, 0x91, 0x23, 0xd7, 0xc1, 0x24, 0xda, 0xd3, + 0xc5, 0x01, 0x25, 0xd2, 0xc4, 0x26, 0xc3, 0xc6, + 0xd4, 0xd8, 0x27, 0xd9, 0xc7, 0x28, 0xc2, 0xc8, + 0xd5, 0xd6, 0x29, 0xc9, 0xca, 0x30, 0xcd, 0xcb, + 0xcf, 0xce, 0xdb, 0xd0, 0xcc, 0xdd, 0x3e, 0x5b, + 0xba, 0x3c, 0xa9, 0xc0, 0x5d, 0x93, 0x01, 0x3d, + 0xde, 0x3f, 0x21, 0x5f, 0x04, 0x22, 0xa0, 0x02, + 0xd1, 0x83, 0xff, 0x94, 0x8d, 0x9d, 0x8c, 0x89, + 0x8a, 0x8b, 0x91, 0x96, 0xb3, 0xb0, 0x97, 0xad, + 0xae, 0xb1, 0x01, 0x98, 0xb2, 0xac, 0x99, 0xbc, + 0xbb, 0xa3, 0xbd, 0x9a, 0xb7, 0xa5, 0x9b, 0xbf, + 0xb4, 0xb8, 0xbe, 0x29, 0xa2, 0xb5, 0x30, 0xa7, + 0xa1, 0xb9, 0xaa, 0xa6, 0xaf, 0xb6, 0xdc, 0x3e, + 0x5b, 0xa4, 0x3c, 0xa8, 0xdf, 0x5d, 0x93, 0x01, + 0x3d, 0xde, 0x3f, 0x81, 0x5f, 0x04, 0x95, 0xa0, + 0x02, 0xab, 0x83, 0xff, 0xc9, 0x0e, 0xd0, 0x07, + 0xad, 0x18, 0xd0, 0x09, 0x02, 0xd0, 0x09, 0xc9, + 0x8e, 0xd0, 0x0b, 0xad, 0x18, 0xd0, 0x29, 0xfd, + 0x8d, 0x18, 0xd0, 0x4c, 0xa8, 0xe6, 0xc9, 0x08, + 0xd0, 0x07, 0xa9, 0x80, 0x0d, 0x91, 0x02, 0x30, + 0x09, 0xc9, 0x09, 0xd0, 0xee, 0xa9, 0x7f, 0x2d, + 0x91, 0x02, 0x8d, 0x91, 0x02, 0x4c, 0xa8, 0xe6, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x1c, 0x17, 0x01, 0x9f, 0x1a, 0x13, 0x05, 0xff, + 0x9c, 0x12, 0x04, 0x1e, 0x03, 0x06, 0x14, 0x18, + 0x1f, 0x19, 0x07, 0x9e, 0x02, 0x08, 0x15, 0x16, + 0x12, 0x09, 0x0a, 0x92, 0x0d, 0x0b, 0x0f, 0x0e, + 0xff, 0x10, 0x0c, 0xff, 0xff, 0x1b, 0x00, 0xff, + 0x1c, 0xff, 0x1d, 0xff, 0xff, 0x1f, 0x1e, 0xff, + 0x90, 0x06, 0xff, 0x05, 0xff, 0xff, 0x11, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x9b, 0x37, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x14, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x06, 0x01, 0x02, 0x03, 0x04, 0x00, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x4c, + 0x4f, 0x41, 0x44, 0x0d, 0x52, 0x55, 0x4e, 0x0d, + 0x00, 0x28, 0x50, 0x78, 0xa0, 0xc8, 0xf0, 0x18, + 0x40, 0x68, 0x90, 0xb8, 0xe0, 0x08, 0x30, 0x58, + 0x80, 0xa8, 0xd0, 0xf8, 0x20, 0x48, 0x70, 0x98, + 0xc0, 0x09, 0x40, 0x2c, 0x09, 0x20, 0x20, 0xa4, + 0xf0, 0x48, 0x24, 0x94, 0x10, 0x0a, 0x38, 0x66, + 0xa3, 0x20, 0x40, 0xed, 0x46, 0x94, 0x46, 0xa3, + 0x68, 0x85, 0x95, 0x78, 0x20, 0x97, 0xee, 0xc9, + 0x3f, 0xd0, 0x03, 0x20, 0x85, 0xee, 0xad, 0x00, + 0xdd, 0x09, 0x08, 0x8d, 0x00, 0xdd, 0x78, 0x20, + 0x8e, 0xee, 0x20, 0x97, 0xee, 0x20, 0xb3, 0xee, + 0x78, 0x20, 0x97, 0xee, 0x20, 0xa9, 0xee, 0xb0, + 0x64, 0x20, 0x85, 0xee, 0x24, 0xa3, 0x10, 0x0a, + 0x20, 0xa9, 0xee, 0x90, 0xfb, 0x20, 0xa9, 0xee, + 0xb0, 0xfb, 0x20, 0xa9, 0xee, 0x90, 0xfb, 0x20, + 0x8e, 0xee, 0xa9, 0x08, 0x85, 0xa5, 0xad, 0x00, + 0xdd, 0xcd, 0x00, 0xdd, 0xd0, 0xf8, 0x0a, 0x90, + 0x3f, 0x66, 0x95, 0xb0, 0x05, 0x20, 0xa0, 0xee, + 0xd0, 0x03, 0x20, 0x97, 0xee, 0x20, 0x85, 0xee, + 0xea, 0xea, 0xea, 0xea, 0xad, 0x00, 0xdd, 0x29, + 0xdf, 0x09, 0x10, 0x8d, 0x00, 0xdd, 0xc6, 0xa5, + 0xd0, 0xd4, 0xa9, 0x04, 0x8d, 0x07, 0xdc, 0xa9, + 0x19, 0x8d, 0x0f, 0xdc, 0xad, 0x0d, 0xdc, 0xad, + 0x0d, 0xdc, 0x29, 0x02, 0xd0, 0x0a, 0x20, 0xa9, + 0xee, 0xb0, 0xf4, 0x58, 0x60, 0xa9, 0x80, 0x2c, + 0xa9, 0x03, 0x20, 0x1c, 0xfe, 0x58, 0x18, 0x90, + 0x4a, 0x85, 0x95, 0x20, 0x36, 0xed, 0xad, 0x00, + 0xdd, 0x29, 0xf7, 0x8d, 0x00, 0xdd, 0x60, 0x85, + 0x95, 0x20, 0x36, 0xed, 0x78, 0x20, 0xa0, 0xee, + 0x20, 0xbe, 0xed, 0x20, 0x85, 0xee, 0x20, 0xa9, + 0xee, 0x30, 0xfb, 0x58, 0x60, 0x24, 0x94, 0x30, + 0x05, 0x38, 0x66, 0x94, 0xd0, 0x05, 0x48, 0x20, + 0x40, 0xed, 0x68, 0x85, 0x95, 0x18, 0x60, 0x78, + 0x20, 0x8e, 0xee, 0xad, 0x00, 0xdd, 0x09, 0x08, + 0x8d, 0x00, 0xdd, 0xa9, 0x5f, 0x2c, 0xa9, 0x3f, + 0x20, 0x11, 0xed, 0x20, 0xbe, 0xed, 0x8a, 0xa2, + 0x0a, 0xca, 0xd0, 0xfd, 0xaa, 0x20, 0x85, 0xee, + 0x4c, 0x97, 0xee, 0x78, 0xa9, 0x00, 0x85, 0xa5, + 0x20, 0x85, 0xee, 0x20, 0xa9, 0xee, 0x10, 0xfb, + 0xa9, 0x01, 0x8d, 0x07, 0xdc, 0xa9, 0x19, 0x8d, + 0x0f, 0xdc, 0x20, 0x97, 0xee, 0xad, 0x0d, 0xdc, + 0xad, 0x0d, 0xdc, 0x29, 0x02, 0xd0, 0x07, 0x20, + 0xa9, 0xee, 0x30, 0xf4, 0x10, 0x18, 0xa5, 0xa5, + 0xf0, 0x05, 0xa9, 0x02, 0x4c, 0xb2, 0xed, 0x20, + 0xa0, 0xee, 0x20, 0x85, 0xee, 0xa9, 0x40, 0x20, + 0x1c, 0xfe, 0xe6, 0xa5, 0xd0, 0xca, 0xa9, 0x08, + 0x85, 0xa5, 0xad, 0x00, 0xdd, 0xcd, 0x00, 0xdd, + 0xd0, 0xf8, 0x0a, 0x10, 0xf5, 0x66, 0xa4, 0xad, + 0x00, 0xdd, 0xcd, 0x00, 0xdd, 0xd0, 0xf8, 0x0a, + 0x30, 0xf5, 0xc6, 0xa5, 0xd0, 0xe4, 0x20, 0xa0, + 0xee, 0x24, 0x90, 0x50, 0x03, 0x20, 0x06, 0xee, + 0xa5, 0xa4, 0x58, 0x18, 0x60, 0xad, 0x00, 0xdd, + 0x29, 0xef, 0x8d, 0x00, 0xdd, 0x60, 0xad, 0x00, + 0xdd, 0x09, 0x10, 0x8d, 0x00, 0xdd, 0x60, 0xad, + 0x00, 0xdd, 0x29, 0xdf, 0x8d, 0x00, 0xdd, 0x60, + 0xad, 0x00, 0xdd, 0x09, 0x20, 0x8d, 0x00, 0xdd, + 0x60, 0xad, 0x00, 0xdd, 0xcd, 0x00, 0xdd, 0xd0, + 0xf8, 0x0a, 0x60, 0x8a, 0xa2, 0xb8, 0xca, 0xd0, + 0xfd, 0xaa, 0x60, 0xa5, 0xb4, 0xf0, 0x47, 0x30, + 0x3f, 0x46, 0xb6, 0xa2, 0x00, 0x90, 0x01, 0xca, + 0x8a, 0x45, 0xbd, 0x85, 0xbd, 0xc6, 0xb4, 0xf0, + 0x06, 0x8a, 0x29, 0x04, 0x85, 0xb5, 0x60, 0xa9, + 0x20, 0x2c, 0x94, 0x02, 0xf0, 0x14, 0x30, 0x1c, + 0x70, 0x14, 0xa5, 0xbd, 0xd0, 0x01, 0xca, 0xc6, + 0xb4, 0xad, 0x93, 0x02, 0x10, 0xe3, 0xc6, 0xb4, + 0xd0, 0xdf, 0xe6, 0xb4, 0xd0, 0xf0, 0xa5, 0xbd, + 0xf0, 0xed, 0xd0, 0xea, 0x70, 0xe9, 0x50, 0xe6, + 0xe6, 0xb4, 0xa2, 0xff, 0xd0, 0xcb, 0xad, 0x94, + 0x02, 0x4a, 0x90, 0x07, 0x2c, 0x01, 0xdd, 0x10, + 0x1d, 0x50, 0x1e, 0xa9, 0x00, 0x85, 0xbd, 0x85, + 0xb5, 0xae, 0x98, 0x02, 0x86, 0xb4, 0xac, 0x9d, + 0x02, 0xcc, 0x9e, 0x02, 0xf0, 0x13, 0xb1, 0xf9, + 0x85, 0xb6, 0xee, 0x9d, 0x02, 0x60, 0xa9, 0x40, + 0x2c, 0xa9, 0x10, 0x0d, 0x97, 0x02, 0x8d, 0x97, + 0x02, 0xa9, 0x01, 0x8d, 0x0d, 0xdd, 0x4d, 0xa1, + 0x02, 0x09, 0x80, 0x8d, 0xa1, 0x02, 0x8d, 0x0d, + 0xdd, 0x60, 0xa2, 0x09, 0xa9, 0x20, 0x2c, 0x93, + 0x02, 0xf0, 0x01, 0xca, 0x50, 0x02, 0xca, 0xca, + 0x60, 0xa6, 0xa9, 0xd0, 0x33, 0xc6, 0xa8, 0xf0, + 0x36, 0x30, 0x0d, 0xa5, 0xa7, 0x45, 0xab, 0x85, + 0xab, 0x46, 0xa7, 0x66, 0xaa, 0x60, 0xc6, 0xa8, + 0xa5, 0xa7, 0xf0, 0x67, 0xad, 0x93, 0x02, 0x0a, + 0xa9, 0x01, 0x65, 0xa8, 0xd0, 0xef, 0xa9, 0x90, + 0x8d, 0x0d, 0xdd, 0x0d, 0xa1, 0x02, 0x8d, 0xa1, + 0x02, 0x85, 0xa9, 0xa9, 0x02, 0x4c, 0x3b, 0xef, + 0xa5, 0xa7, 0xd0, 0xea, 0x4c, 0xd3, 0xe4, 0xac, + 0x9b, 0x02, 0xc8, 0xcc, 0x9c, 0x02, 0xf0, 0x2a, + 0x8c, 0x9b, 0x02, 0x88, 0xa5, 0xaa, 0xae, 0x98, + 0x02, 0xe0, 0x09, 0xf0, 0x04, 0x4a, 0xe8, 0xd0, + 0xf8, 0x91, 0xf7, 0xa9, 0x20, 0x2c, 0x94, 0x02, + 0xf0, 0xb4, 0x30, 0xb1, 0xa5, 0xa7, 0x45, 0xab, + 0xf0, 0x03, 0x70, 0xa9, 0x2c, 0x50, 0xa6, 0xa9, + 0x01, 0x2c, 0xa9, 0x04, 0x2c, 0xa9, 0x80, 0x2c, + 0xa9, 0x02, 0x0d, 0x97, 0x02, 0x8d, 0x97, 0x02, + 0x4c, 0x7e, 0xef, 0xa5, 0xaa, 0xd0, 0xf1, 0xf0, + 0xec, 0x85, 0x9a, 0xad, 0x94, 0x02, 0x4a, 0x90, + 0x29, 0xa9, 0x02, 0x2c, 0x01, 0xdd, 0x10, 0x1d, + 0xd0, 0x20, 0xad, 0xa1, 0x02, 0x29, 0x02, 0xd0, + 0xf9, 0x2c, 0x01, 0xdd, 0x70, 0xfb, 0xad, 0x01, + 0xdd, 0x09, 0x02, 0x8d, 0x01, 0xdd, 0x2c, 0x01, + 0xdd, 0x70, 0x07, 0x30, 0xf9, 0xa9, 0x40, 0x8d, + 0x97, 0x02, 0x18, 0x60, 0x20, 0x28, 0xf0, 0xac, + 0x9e, 0x02, 0xc8, 0xcc, 0x9d, 0x02, 0xf0, 0xf4, + 0x8c, 0x9e, 0x02, 0x88, 0xa5, 0x9e, 0x91, 0xf9, + 0xad, 0xa1, 0x02, 0x4a, 0xb0, 0x1e, 0xa9, 0x10, + 0x8d, 0x0e, 0xdd, 0xad, 0x99, 0x02, 0x8d, 0x04, + 0xdd, 0xad, 0x9a, 0x02, 0x8d, 0x05, 0xdd, 0xa9, + 0x81, 0x20, 0x3b, 0xef, 0x20, 0x06, 0xef, 0xa9, + 0x11, 0x8d, 0x0e, 0xdd, 0x60, 0x85, 0x99, 0xad, + 0x94, 0x02, 0x4a, 0x90, 0x28, 0x29, 0x08, 0xf0, + 0x24, 0xa9, 0x02, 0x2c, 0x01, 0xdd, 0x10, 0xad, + 0xf0, 0x22, 0xad, 0xa1, 0x02, 0x4a, 0xb0, 0xfa, + 0xad, 0x01, 0xdd, 0x29, 0xfd, 0x8d, 0x01, 0xdd, + 0xad, 0x01, 0xdd, 0x29, 0x04, 0xf0, 0xf9, 0xa9, + 0x90, 0x18, 0x4c, 0x3b, 0xef, 0xad, 0xa1, 0x02, + 0x29, 0x12, 0xf0, 0xf3, 0x18, 0x60, 0xad, 0x97, + 0x02, 0xac, 0x9c, 0x02, 0xcc, 0x9b, 0x02, 0xf0, + 0x0b, 0x29, 0xf7, 0x8d, 0x97, 0x02, 0xb1, 0xf7, + 0xee, 0x9c, 0x02, 0x60, 0x09, 0x08, 0x8d, 0x97, + 0x02, 0xa9, 0x00, 0x60, 0x48, 0xad, 0xa1, 0x02, + 0xf0, 0x11, 0xad, 0xa1, 0x02, 0x29, 0x03, 0xd0, + 0xf9, 0xa9, 0x10, 0x8d, 0x0d, 0xdd, 0xa9, 0x00, + 0x8d, 0xa1, 0x02, 0x68, 0x60, 0x0d, 0x49, 0x2f, + 0x4f, 0x20, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x20, + 0xa3, 0x0d, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, + 0x49, 0x4e, 0x47, 0xa0, 0x46, 0x4f, 0x52, 0xa0, + 0x0d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x50, + 0x4c, 0x41, 0x59, 0x20, 0x4f, 0x4e, 0x20, 0x54, + 0x41, 0x50, 0xc5, 0x50, 0x52, 0x45, 0x53, 0x53, + 0x20, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x20, + 0x26, 0x20, 0x50, 0x4c, 0x41, 0x59, 0x20, 0x4f, + 0x4e, 0x20, 0x54, 0x41, 0x50, 0xc5, 0x0d, 0x4c, + 0x4f, 0x41, 0x44, 0x49, 0x4e, 0xc7, 0x0d, 0x53, + 0x41, 0x56, 0x49, 0x4e, 0x47, 0xa0, 0x0d, 0x56, + 0x45, 0x52, 0x49, 0x46, 0x59, 0x49, 0x4e, 0xc7, + 0x0d, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0xa0, 0x0d, + 0x4f, 0x4b, 0x8d, 0x24, 0x9d, 0x10, 0x0d, 0xb9, + 0xbd, 0xf0, 0x08, 0x29, 0x7f, 0x20, 0xd2, 0xff, + 0xc8, 0x28, 0x10, 0xf3, 0x18, 0x60, 0xa5, 0x99, + 0xd0, 0x08, 0xa5, 0xc6, 0xf0, 0x0f, 0x78, 0x4c, + 0xb4, 0xe5, 0xc9, 0x02, 0xd0, 0x18, 0x84, 0x97, + 0x20, 0x86, 0xf0, 0xa4, 0x97, 0x18, 0x60, 0xa5, + 0x99, 0xd0, 0x0b, 0xa5, 0xd3, 0x85, 0xca, 0xa5, + 0xd6, 0x85, 0xc9, 0x4c, 0x32, 0xe6, 0xc9, 0x03, + 0xd0, 0x09, 0x85, 0xd0, 0xa5, 0xd5, 0x85, 0xc8, + 0x4c, 0x32, 0xe6, 0xb0, 0x38, 0xc9, 0x02, 0xf0, + 0x3f, 0x86, 0x97, 0x20, 0x99, 0xf1, 0xb0, 0x16, + 0x48, 0x20, 0x99, 0xf1, 0xb0, 0x0d, 0xd0, 0x05, + 0xa9, 0x40, 0x20, 0x1c, 0xfe, 0xc6, 0xa6, 0xa6, + 0x97, 0x68, 0x60, 0xaa, 0x68, 0x8a, 0xa6, 0x97, + 0x60, 0x20, 0x0d, 0xf8, 0xd0, 0x0b, 0x20, 0x41, + 0xf8, 0xb0, 0x11, 0xa9, 0x00, 0x85, 0xa6, 0xf0, + 0xf0, 0xb1, 0xb2, 0x18, 0x60, 0xa5, 0x90, 0xf0, + 0x04, 0xa9, 0x0d, 0x18, 0x60, 0x4c, 0x13, 0xee, + 0x20, 0x4e, 0xf1, 0xb0, 0xf7, 0xc9, 0x00, 0xd0, + 0xf2, 0xad, 0x97, 0x02, 0x29, 0x60, 0xd0, 0xe9, + 0xf0, 0xee, 0x48, 0xa5, 0x9a, 0xc9, 0x03, 0xd0, + 0x04, 0x68, 0x4c, 0x16, 0xe7, 0x90, 0x04, 0x68, + 0x4c, 0xdd, 0xed, 0x4a, 0x68, 0x85, 0x9e, 0x8a, + 0x48, 0x98, 0x48, 0x90, 0x23, 0x20, 0x0d, 0xf8, + 0xd0, 0x0e, 0x20, 0x64, 0xf8, 0xb0, 0x0e, 0xa9, + 0x02, 0xa0, 0x00, 0x91, 0xb2, 0xc8, 0x84, 0xa6, + 0xa5, 0x9e, 0x91, 0xb2, 0x18, 0x68, 0xa8, 0x68, + 0xaa, 0xa5, 0x9e, 0x90, 0x02, 0xa9, 0x00, 0x60, + 0x20, 0x17, 0xf0, 0x4c, 0xfc, 0xf1, 0x20, 0x0f, + 0xf3, 0xf0, 0x03, 0x4c, 0x01, 0xf7, 0x20, 0x1f, + 0xf3, 0xa5, 0xba, 0xf0, 0x16, 0xc9, 0x03, 0xf0, + 0x12, 0xb0, 0x14, 0xc9, 0x02, 0xd0, 0x03, 0x4c, + 0x4d, 0xf0, 0xa6, 0xb9, 0xe0, 0x60, 0xf0, 0x03, + 0x4c, 0x0a, 0xf7, 0x85, 0x99, 0x18, 0x60, 0xaa, + 0x20, 0x09, 0xed, 0xa5, 0xb9, 0x10, 0x06, 0x20, + 0xcc, 0xed, 0x4c, 0x48, 0xf2, 0x20, 0xc7, 0xed, + 0x8a, 0x24, 0x90, 0x10, 0xe6, 0x4c, 0x07, 0xf7, + 0x20, 0x0f, 0xf3, 0xf0, 0x03, 0x4c, 0x01, 0xf7, + 0x20, 0x1f, 0xf3, 0xa5, 0xba, 0xd0, 0x03, 0x4c, + 0x0d, 0xf7, 0xc9, 0x03, 0xf0, 0x0f, 0xb0, 0x11, + 0xc9, 0x02, 0xd0, 0x03, 0x4c, 0xe1, 0xef, 0xa6, + 0xb9, 0xe0, 0x60, 0xf0, 0xea, 0x85, 0x9a, 0x18, + 0x60, 0xaa, 0x20, 0x0c, 0xed, 0xa5, 0xb9, 0x10, + 0x05, 0x20, 0xbe, 0xed, 0xd0, 0x03, 0x20, 0xb9, + 0xed, 0x8a, 0x24, 0x90, 0x10, 0xe7, 0x4c, 0x07, + 0xf7, 0x20, 0x14, 0xf3, 0xf0, 0x02, 0x18, 0x60, + 0x20, 0x1f, 0xf3, 0x8a, 0x48, 0xa5, 0xba, 0xf0, + 0x50, 0xc9, 0x03, 0xf0, 0x4c, 0xb0, 0x47, 0xc9, + 0x02, 0xd0, 0x1d, 0x68, 0x20, 0xf2, 0xf2, 0x20, + 0x83, 0xf4, 0x20, 0x27, 0xfe, 0xa5, 0xf8, 0xf0, + 0x01, 0xc8, 0xa5, 0xfa, 0xf0, 0x01, 0xc8, 0xa9, + 0x00, 0x85, 0xf8, 0x85, 0xfa, 0x4c, 0x7d, 0xf4, + 0xa5, 0xb9, 0x29, 0x0f, 0xf0, 0x23, 0x20, 0xd0, + 0xf7, 0xa9, 0x00, 0x38, 0x20, 0xdd, 0xf1, 0x20, + 0x64, 0xf8, 0x90, 0x04, 0x68, 0xa9, 0x00, 0x60, + 0xa5, 0xb9, 0xc9, 0x62, 0xd0, 0x0b, 0xa9, 0x05, + 0x20, 0x6a, 0xf7, 0x4c, 0xf1, 0xf2, 0x20, 0x42, + 0xf6, 0x68, 0xaa, 0xc6, 0x98, 0xe4, 0x98, 0xf0, + 0x14, 0xa4, 0x98, 0xb9, 0x59, 0x02, 0x9d, 0x59, + 0x02, 0xb9, 0x63, 0x02, 0x9d, 0x63, 0x02, 0xb9, + 0x6d, 0x02, 0x9d, 0x6d, 0x02, 0x18, 0x60, 0xa9, + 0x00, 0x85, 0x90, 0x8a, 0xa6, 0x98, 0xca, 0x30, + 0x15, 0xdd, 0x59, 0x02, 0xd0, 0xf8, 0x60, 0xbd, + 0x59, 0x02, 0x85, 0xb8, 0xbd, 0x63, 0x02, 0x85, + 0xba, 0xbd, 0x6d, 0x02, 0x85, 0xb9, 0x60, 0xa9, + 0x00, 0x85, 0x98, 0xa2, 0x03, 0xe4, 0x9a, 0xb0, + 0x03, 0x20, 0xfe, 0xed, 0xe4, 0x99, 0xb0, 0x03, + 0x20, 0xef, 0xed, 0x86, 0x9a, 0xa9, 0x00, 0x85, + 0x99, 0x60, 0xa6, 0xb8, 0xd0, 0x03, 0x4c, 0x0a, + 0xf7, 0x20, 0x0f, 0xf3, 0xd0, 0x03, 0x4c, 0xfe, + 0xf6, 0xa6, 0x98, 0xe0, 0x0a, 0x90, 0x03, 0x4c, + 0xfb, 0xf6, 0xe6, 0x98, 0xa5, 0xb8, 0x9d, 0x59, + 0x02, 0xa5, 0xb9, 0x09, 0x60, 0x85, 0xb9, 0x9d, + 0x6d, 0x02, 0xa5, 0xba, 0x9d, 0x63, 0x02, 0xf0, + 0x5a, 0xc9, 0x03, 0xf0, 0x56, 0x90, 0x05, 0x20, + 0xd5, 0xf3, 0x90, 0x4f, 0xc9, 0x02, 0xd0, 0x03, + 0x4c, 0x09, 0xf4, 0x20, 0xd0, 0xf7, 0xb0, 0x03, + 0x4c, 0x13, 0xf7, 0xa5, 0xb9, 0x29, 0x0f, 0xd0, + 0x1f, 0x20, 0x17, 0xf8, 0xb0, 0x36, 0x20, 0xaf, + 0xf5, 0xa5, 0xb7, 0xf0, 0x0a, 0x20, 0xea, 0xf7, + 0x90, 0x18, 0xf0, 0x28, 0x4c, 0x04, 0xf7, 0x20, + 0x2c, 0xf7, 0xf0, 0x20, 0x90, 0x0c, 0xb0, 0xf4, + 0x20, 0x38, 0xf8, 0xb0, 0x17, 0xa9, 0x04, 0x20, + 0x6a, 0xf7, 0xa9, 0xbf, 0xa4, 0xb9, 0xc0, 0x60, + 0xf0, 0x07, 0xa0, 0x00, 0xa9, 0x02, 0x91, 0xb2, + 0x98, 0x85, 0xa6, 0x18, 0x60, 0xa5, 0xb9, 0x30, + 0xfa, 0xa4, 0xb7, 0xf0, 0xf6, 0xa9, 0x00, 0x85, + 0x90, 0xa5, 0xba, 0x20, 0x0c, 0xed, 0xa5, 0xb9, + 0x09, 0xf0, 0x20, 0xb9, 0xed, 0xa5, 0x90, 0x10, + 0x05, 0x68, 0x68, 0x4c, 0x07, 0xf7, 0xa5, 0xb7, + 0xf0, 0x0c, 0xa0, 0x00, 0xb1, 0xbb, 0x20, 0xdd, + 0xed, 0xc8, 0xc4, 0xb7, 0xd0, 0xf6, 0x4c, 0x54, + 0xf6, 0x20, 0x83, 0xf4, 0x8c, 0x97, 0x02, 0xc4, + 0xb7, 0xf0, 0x0a, 0xb1, 0xbb, 0x99, 0x93, 0x02, + 0xc8, 0xc0, 0x04, 0xd0, 0xf2, 0x20, 0x4a, 0xef, + 0x8e, 0x98, 0x02, 0xad, 0x93, 0x02, 0x29, 0x0f, + 0xf0, 0x1c, 0x0a, 0xaa, 0xad, 0xa6, 0x02, 0xd0, + 0x09, 0xbc, 0xc1, 0xfe, 0xbd, 0xc0, 0xfe, 0x4c, + 0x40, 0xf4, 0xbc, 0xeb, 0xe4, 0xbd, 0xea, 0xe4, + 0x8c, 0x96, 0x02, 0x8d, 0x95, 0x02, 0xad, 0x95, + 0x02, 0x0a, 0x20, 0x2e, 0xff, 0xad, 0x94, 0x02, + 0x4a, 0x90, 0x09, 0xad, 0x01, 0xdd, 0x0a, 0xb0, + 0x03, 0x20, 0x0d, 0xf0, 0xad, 0x9b, 0x02, 0x8d, + 0x9c, 0x02, 0xad, 0x9e, 0x02, 0x8d, 0x9d, 0x02, + 0x20, 0x27, 0xfe, 0xa5, 0xf8, 0xd0, 0x05, 0x88, + 0x84, 0xf8, 0x86, 0xf7, 0xa5, 0xfa, 0xd0, 0x05, + 0x88, 0x84, 0xfa, 0x86, 0xf9, 0x38, 0xa9, 0xf0, + 0x4c, 0x2d, 0xfe, 0xa9, 0x7f, 0x8d, 0x0d, 0xdd, + 0xa9, 0x06, 0x8d, 0x03, 0xdd, 0x8d, 0x01, 0xdd, + 0xa9, 0x04, 0x0d, 0x00, 0xdd, 0x8d, 0x00, 0xdd, + 0xa0, 0x00, 0x8c, 0xa1, 0x02, 0x60, 0x86, 0xc3, + 0x84, 0xc4, 0x6c, 0x30, 0x03, 0x85, 0x93, 0xa9, + 0x00, 0x85, 0x90, 0xa5, 0xba, 0xd0, 0x03, 0x4c, + 0x13, 0xf7, 0xc9, 0x03, 0xf0, 0xf9, 0x90, 0x7b, + 0xa4, 0xb7, 0xd0, 0x03, 0x4c, 0x10, 0xf7, 0xa6, + 0xb9, 0x20, 0xaf, 0xf5, 0xa9, 0x60, 0x85, 0xb9, + 0x20, 0xd5, 0xf3, 0xa5, 0xba, 0x20, 0x09, 0xed, + 0xa5, 0xb9, 0x20, 0xc7, 0xed, 0x20, 0x13, 0xee, + 0x85, 0xae, 0xa5, 0x90, 0x4a, 0x4a, 0xb0, 0x50, + 0x20, 0x13, 0xee, 0x85, 0xaf, 0x8a, 0xd0, 0x08, + 0xa5, 0xc3, 0x85, 0xae, 0xa5, 0xc4, 0x85, 0xaf, + 0x20, 0xd2, 0xf5, 0xa9, 0xfd, 0x25, 0x90, 0x85, + 0x90, 0x20, 0xe1, 0xff, 0xd0, 0x03, 0x4c, 0x33, + 0xf6, 0x20, 0x13, 0xee, 0xaa, 0xa5, 0x90, 0x4a, + 0x4a, 0xb0, 0xe8, 0x8a, 0xa4, 0x93, 0xf0, 0x0c, + 0xa0, 0x00, 0xd1, 0xae, 0xf0, 0x08, 0xa9, 0x10, + 0x20, 0x1c, 0xfe, 0x2c, 0x91, 0xae, 0xe6, 0xae, + 0xd0, 0x02, 0xe6, 0xaf, 0x24, 0x90, 0x50, 0xcb, + 0x20, 0xef, 0xed, 0x20, 0x42, 0xf6, 0x90, 0x79, + 0x4c, 0x04, 0xf7, 0x4a, 0xb0, 0x03, 0x4c, 0x13, + 0xf7, 0x20, 0xd0, 0xf7, 0xb0, 0x03, 0x4c, 0x13, + 0xf7, 0x20, 0x17, 0xf8, 0xb0, 0x68, 0x20, 0xaf, + 0xf5, 0xa5, 0xb7, 0xf0, 0x09, 0x20, 0xea, 0xf7, + 0x90, 0x0b, 0xf0, 0x5a, 0xb0, 0xda, 0x20, 0x2c, + 0xf7, 0xf0, 0x53, 0xb0, 0xd3, 0xa5, 0x90, 0x29, + 0x10, 0x38, 0xd0, 0x4a, 0xe0, 0x01, 0xf0, 0x11, + 0xe0, 0x03, 0xd0, 0xdd, 0xa0, 0x01, 0xb1, 0xb2, + 0x85, 0xc3, 0xc8, 0xb1, 0xb2, 0x85, 0xc4, 0xb0, + 0x04, 0xa5, 0xb9, 0xd0, 0xef, 0xa0, 0x03, 0xb1, + 0xb2, 0xa0, 0x01, 0xf1, 0xb2, 0xaa, 0xa0, 0x04, + 0xb1, 0xb2, 0xa0, 0x02, 0xf1, 0xb2, 0xa8, 0x18, + 0x8a, 0x65, 0xc3, 0x85, 0xae, 0x98, 0x65, 0xc4, + 0x85, 0xaf, 0xa5, 0xc3, 0x85, 0xc1, 0xa5, 0xc4, + 0x85, 0xc2, 0x20, 0xd2, 0xf5, 0x20, 0x4a, 0xf8, + 0x24, 0x18, 0xa6, 0xae, 0xa4, 0xaf, 0x60, 0xa5, + 0x9d, 0x10, 0x1e, 0xa0, 0x0c, 0x20, 0x2f, 0xf1, + 0xa5, 0xb7, 0xf0, 0x15, 0xa0, 0x17, 0x20, 0x2f, + 0xf1, 0xa4, 0xb7, 0xf0, 0x0c, 0xa0, 0x00, 0xb1, + 0xbb, 0x20, 0xd2, 0xff, 0xc8, 0xc4, 0xb7, 0xd0, + 0xf6, 0x60, 0xa0, 0x49, 0xa5, 0x93, 0xf0, 0x02, + 0xa0, 0x59, 0x4c, 0x2b, 0xf1, 0x86, 0xae, 0x84, + 0xaf, 0xaa, 0xb5, 0x00, 0x85, 0xc1, 0xb5, 0x01, + 0x85, 0xc2, 0x6c, 0x32, 0x03, 0xa5, 0xba, 0xd0, + 0x03, 0x4c, 0x13, 0xf7, 0xc9, 0x03, 0xf0, 0xf9, + 0x90, 0x5f, 0xa9, 0x61, 0x85, 0xb9, 0xa4, 0xb7, + 0xd0, 0x03, 0x4c, 0x10, 0xf7, 0x20, 0xd5, 0xf3, + 0x20, 0x8f, 0xf6, 0xa5, 0xba, 0x20, 0x0c, 0xed, + 0xa5, 0xb9, 0x20, 0xb9, 0xed, 0xa0, 0x00, 0x20, + 0x8e, 0xfb, 0xa5, 0xac, 0x20, 0xdd, 0xed, 0xa5, + 0xad, 0x20, 0xdd, 0xed, 0x20, 0xd1, 0xfc, 0xb0, + 0x16, 0xb1, 0xac, 0x20, 0xdd, 0xed, 0x20, 0xe1, + 0xff, 0xd0, 0x07, 0x20, 0x42, 0xf6, 0xa9, 0x00, + 0x38, 0x60, 0x20, 0xdb, 0xfc, 0xd0, 0xe5, 0x20, + 0xfe, 0xed, 0x24, 0xb9, 0x30, 0x11, 0xa5, 0xba, + 0x20, 0x0c, 0xed, 0xa5, 0xb9, 0x29, 0xef, 0x09, + 0xe0, 0x20, 0xb9, 0xed, 0x20, 0xfe, 0xed, 0x18, + 0x60, 0x4a, 0xb0, 0x03, 0x4c, 0x13, 0xf7, 0x20, + 0xd0, 0xf7, 0x90, 0x8d, 0x20, 0x38, 0xf8, 0xb0, + 0x25, 0x20, 0x8f, 0xf6, 0xa2, 0x03, 0xa5, 0xb9, + 0x29, 0x01, 0xd0, 0x02, 0xa2, 0x01, 0x8a, 0x20, + 0x6a, 0xf7, 0xb0, 0x12, 0x20, 0x67, 0xf8, 0xb0, + 0x0d, 0xa5, 0xb9, 0x29, 0x02, 0xf0, 0x06, 0xa9, + 0x05, 0x20, 0x6a, 0xf7, 0x24, 0x18, 0x60, 0xa5, + 0x9d, 0x10, 0xfb, 0xa0, 0x51, 0x20, 0x2f, 0xf1, + 0x4c, 0xc1, 0xf5, 0xa2, 0x00, 0xe6, 0xa2, 0xd0, + 0x06, 0xe6, 0xa1, 0xd0, 0x02, 0xe6, 0xa0, 0x38, + 0xa5, 0xa2, 0xe9, 0x01, 0xa5, 0xa1, 0xe9, 0x1a, + 0xa5, 0xa0, 0xe9, 0x4f, 0x90, 0x06, 0x86, 0xa0, + 0x86, 0xa1, 0x86, 0xa2, 0xad, 0x01, 0xdc, 0xcd, + 0x01, 0xdc, 0xd0, 0xf8, 0xaa, 0x30, 0x13, 0xa2, + 0xbd, 0x8e, 0x00, 0xdc, 0xae, 0x01, 0xdc, 0xec, + 0x01, 0xdc, 0xd0, 0xf8, 0x8d, 0x00, 0xdc, 0xe8, + 0xd0, 0x02, 0x85, 0x91, 0x60, 0x78, 0xa5, 0xa2, + 0xa6, 0xa1, 0xa4, 0xa0, 0x78, 0x85, 0xa2, 0x86, + 0xa1, 0x84, 0xa0, 0x58, 0x60, 0xa5, 0x91, 0xc9, + 0x7f, 0xd0, 0x07, 0x08, 0x20, 0xcc, 0xff, 0x85, + 0xc6, 0x28, 0x60, 0xa9, 0x01, 0x2c, 0xa9, 0x02, + 0x2c, 0xa9, 0x03, 0x2c, 0xa9, 0x04, 0x2c, 0xa9, + 0x05, 0x2c, 0xa9, 0x06, 0x2c, 0xa9, 0x07, 0x2c, + 0xa9, 0x08, 0x2c, 0xa9, 0x09, 0x48, 0x20, 0xcc, + 0xff, 0xa0, 0x00, 0x24, 0x9d, 0x50, 0x0a, 0x20, + 0x2f, 0xf1, 0x68, 0x48, 0x09, 0x30, 0x20, 0xd2, + 0xff, 0x68, 0x38, 0x60, 0xa5, 0x93, 0x48, 0x20, + 0x41, 0xf8, 0x68, 0x85, 0x93, 0xb0, 0x32, 0xa0, + 0x00, 0xb1, 0xb2, 0xc9, 0x05, 0xf0, 0x2a, 0xc9, + 0x01, 0xf0, 0x08, 0xc9, 0x03, 0xf0, 0x04, 0xc9, + 0x04, 0xd0, 0xe1, 0xaa, 0x24, 0x9d, 0x10, 0x17, + 0xa0, 0x63, 0x20, 0x2f, 0xf1, 0xa0, 0x05, 0xb1, + 0xb2, 0x20, 0xd2, 0xff, 0xc8, 0xc0, 0x15, 0xd0, + 0xf6, 0xa5, 0xa1, 0x20, 0xe0, 0xe4, 0xea, 0x18, + 0x88, 0x60, 0x85, 0x9e, 0x20, 0xd0, 0xf7, 0x90, + 0x5e, 0xa5, 0xc2, 0x48, 0xa5, 0xc1, 0x48, 0xa5, + 0xaf, 0x48, 0xa5, 0xae, 0x48, 0xa0, 0xbf, 0xa9, + 0x20, 0x91, 0xb2, 0x88, 0xd0, 0xfb, 0xa5, 0x9e, + 0x91, 0xb2, 0xc8, 0xa5, 0xc1, 0x91, 0xb2, 0xc8, + 0xa5, 0xc2, 0x91, 0xb2, 0xc8, 0xa5, 0xae, 0x91, + 0xb2, 0xc8, 0xa5, 0xaf, 0x91, 0xb2, 0xc8, 0x84, + 0x9f, 0xa0, 0x00, 0x84, 0x9e, 0xa4, 0x9e, 0xc4, + 0xb7, 0xf0, 0x0c, 0xb1, 0xbb, 0xa4, 0x9f, 0x91, + 0xb2, 0xe6, 0x9e, 0xe6, 0x9f, 0xd0, 0xee, 0x20, + 0xd7, 0xf7, 0xa9, 0x69, 0x85, 0xab, 0x20, 0x6b, + 0xf8, 0xa8, 0x68, 0x85, 0xae, 0x68, 0x85, 0xaf, + 0x68, 0x85, 0xc1, 0x68, 0x85, 0xc2, 0x98, 0x60, + 0xa6, 0xb2, 0xa4, 0xb3, 0xc0, 0x02, 0x60, 0x20, + 0xd0, 0xf7, 0x8a, 0x85, 0xc1, 0x18, 0x69, 0xc0, + 0x85, 0xae, 0x98, 0x85, 0xc2, 0x69, 0x00, 0x85, + 0xaf, 0x60, 0x20, 0x2c, 0xf7, 0xb0, 0x1d, 0xa0, + 0x05, 0x84, 0x9f, 0xa0, 0x00, 0x84, 0x9e, 0xc4, + 0xb7, 0xf0, 0x10, 0xb1, 0xbb, 0xa4, 0x9f, 0xd1, + 0xb2, 0xd0, 0xe7, 0xe6, 0x9e, 0xe6, 0x9f, 0xa4, + 0x9e, 0xd0, 0xec, 0x18, 0x60, 0x20, 0xd0, 0xf7, + 0xe6, 0xa6, 0xa4, 0xa6, 0xc0, 0xc0, 0x60, 0x20, + 0x2e, 0xf8, 0xf0, 0x1a, 0xa0, 0x1b, 0x20, 0x2f, + 0xf1, 0x20, 0xd0, 0xf8, 0x20, 0x2e, 0xf8, 0xd0, + 0xf8, 0xa0, 0x6a, 0x4c, 0x2f, 0xf1, 0xa9, 0x10, + 0x24, 0x01, 0xd0, 0x02, 0x24, 0x01, 0x18, 0x60, + 0x20, 0x2e, 0xf8, 0xf0, 0xf9, 0xa0, 0x2e, 0xd0, + 0xdd, 0xa9, 0x00, 0x85, 0x90, 0x85, 0x93, 0x20, + 0xd7, 0xf7, 0x20, 0x17, 0xf8, 0xb0, 0x1f, 0x78, + 0xa9, 0x00, 0x85, 0xaa, 0x85, 0xb4, 0x85, 0xb0, + 0x85, 0x9e, 0x85, 0x9f, 0x85, 0x9c, 0xa9, 0x90, + 0xa2, 0x0e, 0xd0, 0x11, 0x20, 0xd7, 0xf7, 0xa9, + 0x14, 0x85, 0xab, 0x20, 0x38, 0xf8, 0xb0, 0x6c, + 0x78, 0xa9, 0x82, 0xa2, 0x08, 0xa0, 0x7f, 0x8c, + 0x0d, 0xdc, 0x8d, 0x0d, 0xdc, 0xad, 0x0e, 0xdc, + 0x09, 0x19, 0x8d, 0x0f, 0xdc, 0x29, 0x91, 0x8d, + 0xa2, 0x02, 0x20, 0xa4, 0xf0, 0xad, 0x11, 0xd0, + 0x29, 0xef, 0x8d, 0x11, 0xd0, 0xad, 0x14, 0x03, + 0x8d, 0x9f, 0x02, 0xad, 0x15, 0x03, 0x8d, 0xa0, + 0x02, 0x20, 0xbd, 0xfc, 0xa9, 0x02, 0x85, 0xbe, + 0x20, 0x97, 0xfb, 0xa5, 0x01, 0x29, 0x1f, 0x85, + 0x01, 0x85, 0xc0, 0xa2, 0xff, 0xa0, 0xff, 0x88, + 0xd0, 0xfd, 0xca, 0xd0, 0xf8, 0x58, 0xad, 0xa0, + 0x02, 0xcd, 0x15, 0x03, 0x18, 0xf0, 0x15, 0x20, + 0xd0, 0xf8, 0x20, 0xbc, 0xf6, 0x4c, 0xbe, 0xf8, + 0x20, 0xe1, 0xff, 0x18, 0xd0, 0x0b, 0x20, 0x93, + 0xfc, 0x38, 0x68, 0x68, 0xa9, 0x00, 0x8d, 0xa0, + 0x02, 0x60, 0x86, 0xb1, 0xa5, 0xb0, 0x0a, 0x0a, + 0x18, 0x65, 0xb0, 0x18, 0x65, 0xb1, 0x85, 0xb1, + 0xa9, 0x00, 0x24, 0xb0, 0x30, 0x01, 0x2a, 0x06, + 0xb1, 0x2a, 0x06, 0xb1, 0x2a, 0xaa, 0xad, 0x06, + 0xdc, 0xc9, 0x16, 0x90, 0xf9, 0x65, 0xb1, 0x8d, + 0x04, 0xdc, 0x8a, 0x6d, 0x07, 0xdc, 0x8d, 0x05, + 0xdc, 0xad, 0xa2, 0x02, 0x8d, 0x0e, 0xdc, 0x8d, + 0xa4, 0x02, 0xad, 0x0d, 0xdc, 0x29, 0x10, 0xf0, + 0x09, 0xa9, 0xf9, 0x48, 0xa9, 0x2a, 0x48, 0x4c, + 0x43, 0xff, 0x58, 0x60, 0xae, 0x07, 0xdc, 0xa0, + 0xff, 0x98, 0xed, 0x06, 0xdc, 0xec, 0x07, 0xdc, + 0xd0, 0xf2, 0x86, 0xb1, 0xaa, 0x8c, 0x06, 0xdc, + 0x8c, 0x07, 0xdc, 0xa9, 0x19, 0x8d, 0x0f, 0xdc, + 0xad, 0x0d, 0xdc, 0x8d, 0xa3, 0x02, 0x98, 0xe5, + 0xb1, 0x86, 0xb1, 0x4a, 0x66, 0xb1, 0x4a, 0x66, + 0xb1, 0xa5, 0xb0, 0x18, 0x69, 0x3c, 0xc5, 0xb1, + 0xb0, 0x4a, 0xa6, 0x9c, 0xf0, 0x03, 0x4c, 0x60, + 0xfa, 0xa6, 0xa3, 0x30, 0x1b, 0xa2, 0x00, 0x69, + 0x30, 0x65, 0xb0, 0xc5, 0xb1, 0xb0, 0x1c, 0xe8, + 0x69, 0x26, 0x65, 0xb0, 0xc5, 0xb1, 0xb0, 0x17, + 0x69, 0x2c, 0x65, 0xb0, 0xc5, 0xb1, 0x90, 0x03, + 0x4c, 0x10, 0xfa, 0xa5, 0xb4, 0xf0, 0x1d, 0x85, + 0xa8, 0xd0, 0x19, 0xe6, 0xa9, 0xb0, 0x02, 0xc6, + 0xa9, 0x38, 0xe9, 0x13, 0xe5, 0xb1, 0x65, 0x92, + 0x85, 0x92, 0xa5, 0xa4, 0x49, 0x01, 0x85, 0xa4, + 0xf0, 0x2b, 0x86, 0xd7, 0xa5, 0xb4, 0xf0, 0x22, + 0xad, 0xa3, 0x02, 0x29, 0x01, 0xd0, 0x05, 0xad, + 0xa4, 0x02, 0xd0, 0x16, 0xa9, 0x00, 0x85, 0xa4, + 0x8d, 0xa4, 0x02, 0xa5, 0xa3, 0x10, 0x30, 0x30, + 0xbf, 0xa2, 0xa6, 0x20, 0xe2, 0xf8, 0xa5, 0x9b, + 0xd0, 0xb9, 0x4c, 0xbc, 0xfe, 0xa5, 0x92, 0xf0, + 0x07, 0x30, 0x03, 0xc6, 0xb0, 0x2c, 0xe6, 0xb0, + 0xa9, 0x00, 0x85, 0x92, 0xe4, 0xd7, 0xd0, 0x0f, + 0x8a, 0xd0, 0xa0, 0xa5, 0xa9, 0x30, 0xbd, 0xc9, + 0x10, 0x90, 0xb9, 0x85, 0x96, 0xb0, 0xb5, 0x8a, + 0x45, 0x9b, 0x85, 0x9b, 0xa5, 0xb4, 0xf0, 0xd2, + 0xc6, 0xa3, 0x30, 0xc5, 0x46, 0xd7, 0x66, 0xbf, + 0xa2, 0xda, 0x20, 0xe2, 0xf8, 0x4c, 0xbc, 0xfe, + 0xa5, 0x96, 0xf0, 0x04, 0xa5, 0xb4, 0xf0, 0x07, + 0xa5, 0xa3, 0x30, 0x03, 0x4c, 0x97, 0xf9, 0x46, + 0xb1, 0xa9, 0x93, 0x38, 0xe5, 0xb1, 0x65, 0xb0, + 0x0a, 0xaa, 0x20, 0xe2, 0xf8, 0xe6, 0x9c, 0xa5, + 0xb4, 0xd0, 0x11, 0xa5, 0x96, 0xf0, 0x26, 0x85, + 0xa8, 0xa9, 0x00, 0x85, 0x96, 0xa9, 0x81, 0x8d, + 0x0d, 0xdc, 0x85, 0xb4, 0xa5, 0x96, 0x85, 0xb5, + 0xf0, 0x09, 0xa9, 0x00, 0x85, 0xb4, 0xa9, 0x01, + 0x8d, 0x0d, 0xdc, 0xa5, 0xbf, 0x85, 0xbd, 0xa5, + 0xa8, 0x05, 0xa9, 0x85, 0xb6, 0x4c, 0xbc, 0xfe, + 0x20, 0x97, 0xfb, 0x85, 0x9c, 0xa2, 0xda, 0x20, + 0xe2, 0xf8, 0xa5, 0xbe, 0xf0, 0x02, 0x85, 0xa7, + 0xa9, 0x0f, 0x24, 0xaa, 0x10, 0x17, 0xa5, 0xb5, + 0xd0, 0x0c, 0xa6, 0xbe, 0xca, 0xd0, 0x0b, 0xa9, + 0x08, 0x20, 0x1c, 0xfe, 0xd0, 0x04, 0xa9, 0x00, + 0x85, 0xaa, 0x4c, 0xbc, 0xfe, 0x70, 0x31, 0xd0, + 0x18, 0xa5, 0xb5, 0xd0, 0xf5, 0xa5, 0xb6, 0xd0, + 0xf1, 0xa5, 0xa7, 0x4a, 0xa5, 0xbd, 0x30, 0x03, + 0x90, 0x18, 0x18, 0xb0, 0x15, 0x29, 0x0f, 0x85, + 0xaa, 0xc6, 0xaa, 0xd0, 0xdd, 0xa9, 0x40, 0x85, + 0xaa, 0x20, 0x8e, 0xfb, 0xa9, 0x00, 0x85, 0xab, + 0xf0, 0xd0, 0xa9, 0x80, 0x85, 0xaa, 0xd0, 0xca, + 0xa5, 0xb5, 0xf0, 0x0a, 0xa9, 0x04, 0x20, 0x1c, + 0xfe, 0xa9, 0x00, 0x4c, 0x4a, 0xfb, 0x20, 0xd1, + 0xfc, 0x90, 0x03, 0x4c, 0x48, 0xfb, 0xa6, 0xa7, + 0xca, 0xf0, 0x2d, 0xa5, 0x93, 0xf0, 0x0c, 0xa0, + 0x00, 0xa5, 0xbd, 0xd1, 0xac, 0xf0, 0x04, 0xa9, + 0x01, 0x85, 0xb6, 0xa5, 0xb6, 0xf0, 0x4b, 0xa2, + 0x3d, 0xe4, 0x9e, 0x90, 0x3e, 0xa6, 0x9e, 0xa5, + 0xad, 0x9d, 0x01, 0x01, 0xa5, 0xac, 0x9d, 0x00, + 0x01, 0xe8, 0xe8, 0x86, 0x9e, 0x4c, 0x3a, 0xfb, + 0xa6, 0x9f, 0xe4, 0x9e, 0xf0, 0x35, 0xa5, 0xac, + 0xdd, 0x00, 0x01, 0xd0, 0x2e, 0xa5, 0xad, 0xdd, + 0x01, 0x01, 0xd0, 0x27, 0xe6, 0x9f, 0xe6, 0x9f, + 0xa5, 0x93, 0xf0, 0x0b, 0xa5, 0xbd, 0xa0, 0x00, + 0xd1, 0xac, 0xf0, 0x17, 0xc8, 0x84, 0xb6, 0xa5, + 0xb6, 0xf0, 0x07, 0xa9, 0x10, 0x20, 0x1c, 0xfe, + 0xd0, 0x09, 0xa5, 0x93, 0xd0, 0x05, 0xa8, 0xa5, + 0xbd, 0x91, 0xac, 0x20, 0xdb, 0xfc, 0xd0, 0x43, + 0xa9, 0x80, 0x85, 0xaa, 0x78, 0xa2, 0x01, 0x8e, + 0x0d, 0xdc, 0xae, 0x0d, 0xdc, 0xa6, 0xbe, 0xca, + 0x30, 0x02, 0x86, 0xbe, 0xc6, 0xa7, 0xf0, 0x08, + 0xa5, 0x9e, 0xd0, 0x27, 0x85, 0xbe, 0xf0, 0x23, + 0x20, 0x93, 0xfc, 0x20, 0x8e, 0xfb, 0xa0, 0x00, + 0x84, 0xab, 0xb1, 0xac, 0x45, 0xab, 0x85, 0xab, + 0x20, 0xdb, 0xfc, 0x20, 0xd1, 0xfc, 0x90, 0xf2, + 0xa5, 0xab, 0x45, 0xbd, 0xf0, 0x05, 0xa9, 0x20, + 0x20, 0x1c, 0xfe, 0x4c, 0xbc, 0xfe, 0xa5, 0xc2, + 0x85, 0xad, 0xa5, 0xc1, 0x85, 0xac, 0x60, 0xa9, + 0x08, 0x85, 0xa3, 0xa9, 0x00, 0x85, 0xa4, 0x85, + 0xa8, 0x85, 0x9b, 0x85, 0xa9, 0x60, 0xa5, 0xbd, + 0x4a, 0xa9, 0x60, 0x90, 0x02, 0xa9, 0xb0, 0xa2, + 0x00, 0x8d, 0x06, 0xdc, 0x8e, 0x07, 0xdc, 0xad, + 0x0d, 0xdc, 0xa9, 0x19, 0x8d, 0x0f, 0xdc, 0xa5, + 0x01, 0x49, 0x08, 0x85, 0x01, 0x29, 0x08, 0x60, + 0x38, 0x66, 0xb6, 0x30, 0x3c, 0xa5, 0xa8, 0xd0, + 0x12, 0xa9, 0x10, 0xa2, 0x01, 0x20, 0xb1, 0xfb, + 0xd0, 0x2f, 0xe6, 0xa8, 0xa5, 0xb6, 0x10, 0x29, + 0x4c, 0x57, 0xfc, 0xa5, 0xa9, 0xd0, 0x09, 0x20, + 0xad, 0xfb, 0xd0, 0x1d, 0xe6, 0xa9, 0xd0, 0x19, + 0x20, 0xa6, 0xfb, 0xd0, 0x14, 0xa5, 0xa4, 0x49, + 0x01, 0x85, 0xa4, 0xf0, 0x0f, 0xa5, 0xbd, 0x49, + 0x01, 0x85, 0xbd, 0x29, 0x01, 0x45, 0x9b, 0x85, + 0x9b, 0x4c, 0xbc, 0xfe, 0x46, 0xbd, 0xc6, 0xa3, + 0xa5, 0xa3, 0xf0, 0x3a, 0x10, 0xf3, 0x20, 0x97, + 0xfb, 0x58, 0xa5, 0xa5, 0xf0, 0x12, 0xa2, 0x00, + 0x86, 0xd7, 0xc6, 0xa5, 0xa6, 0xbe, 0xe0, 0x02, + 0xd0, 0x02, 0x09, 0x80, 0x85, 0xbd, 0xd0, 0xd9, + 0x20, 0xd1, 0xfc, 0x90, 0x0a, 0xd0, 0x91, 0xe6, + 0xad, 0xa5, 0xd7, 0x85, 0xbd, 0xb0, 0xca, 0xa0, + 0x00, 0xb1, 0xac, 0x85, 0xbd, 0x45, 0xd7, 0x85, + 0xd7, 0x20, 0xdb, 0xfc, 0xd0, 0xbb, 0xa5, 0x9b, + 0x49, 0x01, 0x85, 0xbd, 0x4c, 0xbc, 0xfe, 0xc6, + 0xbe, 0xd0, 0x03, 0x20, 0xca, 0xfc, 0xa9, 0x50, + 0x85, 0xa7, 0xa2, 0x08, 0x78, 0x20, 0xbd, 0xfc, + 0xd0, 0xea, 0xa9, 0x78, 0x20, 0xaf, 0xfb, 0xd0, + 0xe3, 0xc6, 0xa7, 0xd0, 0xdf, 0x20, 0x97, 0xfb, + 0xc6, 0xab, 0x10, 0xd8, 0xa2, 0x0a, 0x20, 0xbd, + 0xfc, 0x58, 0xe6, 0xab, 0xa5, 0xbe, 0xf0, 0x30, + 0x20, 0x8e, 0xfb, 0xa2, 0x09, 0x86, 0xa5, 0x86, + 0xb6, 0xd0, 0x83, 0x08, 0x78, 0xad, 0x11, 0xd0, + 0x09, 0x10, 0x8d, 0x11, 0xd0, 0x20, 0xca, 0xfc, + 0xa9, 0x7f, 0x8d, 0x0d, 0xdc, 0x20, 0xdd, 0xfd, + 0xad, 0xa0, 0x02, 0xf0, 0x09, 0x8d, 0x15, 0x03, + 0xad, 0x9f, 0x02, 0x8d, 0x14, 0x03, 0x28, 0x60, + 0x20, 0x93, 0xfc, 0xf0, 0x97, 0xbd, 0x93, 0xfd, + 0x8d, 0x14, 0x03, 0xbd, 0x94, 0xfd, 0x8d, 0x15, + 0x03, 0x60, 0xa5, 0x01, 0x09, 0x20, 0x85, 0x01, + 0x60, 0x38, 0xa5, 0xac, 0xe5, 0xae, 0xa5, 0xad, + 0xe5, 0xaf, 0x60, 0xe6, 0xac, 0xd0, 0x02, 0xe6, + 0xad, 0x60, 0xa2, 0xff, 0x78, 0x9a, 0xd8, 0x20, + 0x02, 0xfd, 0xd0, 0x03, 0x6c, 0x00, 0x80, 0x8e, + 0x16, 0xd0, 0x20, 0xa3, 0xfd, 0x20, 0x50, 0xfd, + 0x20, 0x15, 0xfd, 0x20, 0x5b, 0xff, 0x58, 0x6c, + 0x00, 0xa0, 0xa2, 0x05, 0xbd, 0x0f, 0xfd, 0xdd, + 0x03, 0x80, 0xd0, 0x03, 0xca, 0xd0, 0xf5, 0x60, + 0xc3, 0xc2, 0xcd, 0x38, 0x30, 0xa2, 0x30, 0xa0, + 0xfd, 0x18, 0x86, 0xc3, 0x84, 0xc4, 0xa0, 0x1f, + 0xb9, 0x14, 0x03, 0xb0, 0x02, 0xb1, 0xc3, 0x91, + 0xc3, 0x99, 0x14, 0x03, 0x88, 0x10, 0xf1, 0x60, + 0x31, 0xea, 0x66, 0xfe, 0x47, 0xfe, 0x4a, 0xf3, + 0x91, 0xf2, 0x0e, 0xf2, 0x50, 0xf2, 0x33, 0xf3, + 0x57, 0xf1, 0xca, 0xf1, 0xed, 0xf6, 0x3e, 0xf1, + 0x2f, 0xf3, 0x66, 0xfe, 0xa5, 0xf4, 0xed, 0xf5, + 0xa9, 0x00, 0xa8, 0x99, 0x02, 0x00, 0x99, 0x00, + 0x02, 0x99, 0x00, 0x03, 0xc8, 0xd0, 0xf4, 0xa2, + 0x3c, 0xa0, 0x03, 0x86, 0xb2, 0x84, 0xb3, 0xa8, + 0xa9, 0x03, 0x85, 0xc2, 0xe6, 0xc2, 0xb1, 0xc1, + 0xaa, 0xa9, 0x55, 0x91, 0xc1, 0xd1, 0xc1, 0xd0, + 0x0f, 0x2a, 0x91, 0xc1, 0xd1, 0xc1, 0xd0, 0x08, + 0x8a, 0x91, 0xc1, 0xc8, 0xd0, 0xe8, 0xf0, 0xe4, + 0x98, 0xaa, 0xa4, 0xc2, 0x18, 0x20, 0x2d, 0xfe, + 0xa9, 0x08, 0x8d, 0x82, 0x02, 0xa9, 0x04, 0x8d, + 0x88, 0x02, 0x60, 0x6a, 0xfc, 0xcd, 0xfb, 0x31, + 0xea, 0x2c, 0xf9, 0xa9, 0x7f, 0x8d, 0x0d, 0xdc, + 0x8d, 0x0d, 0xdd, 0x8d, 0x00, 0xdc, 0xa9, 0x08, + 0x8d, 0x0e, 0xdc, 0x8d, 0x0e, 0xdd, 0x8d, 0x0f, + 0xdc, 0x8d, 0x0f, 0xdd, 0xa2, 0x00, 0x8e, 0x03, + 0xdc, 0x8e, 0x03, 0xdd, 0x8e, 0x18, 0xd4, 0xca, + 0x8e, 0x02, 0xdc, 0xa9, 0x07, 0x8d, 0x00, 0xdd, + 0xa9, 0x3f, 0x8d, 0x02, 0xdd, 0xa9, 0xe7, 0x85, + 0x01, 0xa9, 0x2f, 0x85, 0x00, 0xad, 0xa6, 0x02, + 0xf0, 0x0a, 0xa9, 0x25, 0x8d, 0x04, 0xdc, 0xa9, + 0x40, 0x4c, 0xf3, 0xfd, 0xa9, 0x95, 0x8d, 0x04, + 0xdc, 0xa9, 0x42, 0x8d, 0x05, 0xdc, 0x4c, 0x6e, + 0xff, 0x85, 0xb7, 0x86, 0xbb, 0x84, 0xbc, 0x60, + 0x85, 0xb8, 0x86, 0xba, 0x84, 0xb9, 0x60, 0xa5, + 0xba, 0xc9, 0x02, 0xd0, 0x0d, 0xad, 0x97, 0x02, + 0x48, 0xa9, 0x00, 0x8d, 0x97, 0x02, 0x68, 0x60, + 0x85, 0x9d, 0xa5, 0x90, 0x05, 0x90, 0x85, 0x90, + 0x60, 0x8d, 0x85, 0x02, 0x60, 0x90, 0x06, 0xae, + 0x83, 0x02, 0xac, 0x84, 0x02, 0x8e, 0x83, 0x02, + 0x8c, 0x84, 0x02, 0x60, 0x90, 0x06, 0xae, 0x81, + 0x02, 0xac, 0x82, 0x02, 0x8e, 0x81, 0x02, 0x8c, + 0x82, 0x02, 0x60, 0x78, 0x6c, 0x18, 0x03, 0x48, + 0x8a, 0x48, 0x98, 0x48, 0xa9, 0x7f, 0x8d, 0x0d, + 0xdd, 0xac, 0x0d, 0xdd, 0x30, 0x1c, 0x20, 0x02, + 0xfd, 0xd0, 0x03, 0x6c, 0x02, 0x80, 0x20, 0xbc, + 0xf6, 0x20, 0xe1, 0xff, 0xd0, 0x0c, 0x20, 0x15, + 0xfd, 0x20, 0xa3, 0xfd, 0x20, 0x18, 0xe5, 0x6c, + 0x02, 0xa0, 0x98, 0x2d, 0xa1, 0x02, 0xaa, 0x29, + 0x01, 0xf0, 0x28, 0xad, 0x00, 0xdd, 0x29, 0xfb, + 0x05, 0xb5, 0x8d, 0x00, 0xdd, 0xad, 0xa1, 0x02, + 0x8d, 0x0d, 0xdd, 0x8a, 0x29, 0x12, 0xf0, 0x0d, + 0x29, 0x02, 0xf0, 0x06, 0x20, 0xd6, 0xfe, 0x4c, + 0x9d, 0xfe, 0x20, 0x07, 0xff, 0x20, 0xbb, 0xee, + 0x4c, 0xb6, 0xfe, 0x8a, 0x29, 0x02, 0xf0, 0x06, + 0x20, 0xd6, 0xfe, 0x4c, 0xb6, 0xfe, 0x8a, 0x29, + 0x10, 0xf0, 0x03, 0x20, 0x07, 0xff, 0xad, 0xa1, + 0x02, 0x8d, 0x0d, 0xdd, 0x68, 0xa8, 0x68, 0xaa, + 0x68, 0x40, 0xc1, 0x27, 0x3e, 0x1a, 0xc5, 0x11, + 0x74, 0x0e, 0xed, 0x0c, 0x45, 0x06, 0xf0, 0x02, + 0x46, 0x01, 0xb8, 0x00, 0x71, 0x00, 0xad, 0x01, + 0xdd, 0x29, 0x01, 0x85, 0xa7, 0xad, 0x06, 0xdd, + 0xe9, 0x1c, 0x6d, 0x99, 0x02, 0x8d, 0x06, 0xdd, + 0xad, 0x07, 0xdd, 0x6d, 0x9a, 0x02, 0x8d, 0x07, + 0xdd, 0xa9, 0x11, 0x8d, 0x0f, 0xdd, 0xad, 0xa1, + 0x02, 0x8d, 0x0d, 0xdd, 0xa9, 0xff, 0x8d, 0x06, + 0xdd, 0x8d, 0x07, 0xdd, 0x4c, 0x59, 0xef, 0xad, + 0x95, 0x02, 0x8d, 0x06, 0xdd, 0xad, 0x96, 0x02, + 0x8d, 0x07, 0xdd, 0xa9, 0x11, 0x8d, 0x0f, 0xdd, + 0xa9, 0x12, 0x4d, 0xa1, 0x02, 0x8d, 0xa1, 0x02, + 0xa9, 0xff, 0x8d, 0x06, 0xdd, 0x8d, 0x07, 0xdd, + 0xae, 0x98, 0x02, 0x86, 0xa8, 0x60, 0xaa, 0xad, + 0x96, 0x02, 0x2a, 0xa8, 0x8a, 0x69, 0xc8, 0x8d, + 0x99, 0x02, 0x98, 0x69, 0x00, 0x8d, 0x9a, 0x02, + 0x60, 0xea, 0xea, 0x08, 0x68, 0x29, 0xef, 0x48, + 0x48, 0x8a, 0x48, 0x98, 0x48, 0xba, 0xbd, 0x04, + 0x01, 0x29, 0x10, 0xf0, 0x03, 0x6c, 0x16, 0x03, + 0x6c, 0x14, 0x03, 0x20, 0x18, 0xe5, 0xad, 0x12, + 0xd0, 0xd0, 0xfb, 0xad, 0x19, 0xd0, 0x29, 0x01, + 0x8d, 0xa6, 0x02, 0x4c, 0xdd, 0xfd, 0xa9, 0x81, + 0x8d, 0x0d, 0xdc, 0xad, 0x0e, 0xdc, 0x29, 0x80, + 0x09, 0x11, 0x8d, 0x0e, 0xdc, 0x4c, 0x8e, 0xee, + 0x03, 0x4c, 0x5b, 0xff, 0x4c, 0xa3, 0xfd, 0x4c, + 0x50, 0xfd, 0x4c, 0x15, 0xfd, 0x4c, 0x1a, 0xfd, + 0x4c, 0x18, 0xfe, 0x4c, 0xb9, 0xed, 0x4c, 0xc7, + 0xed, 0x4c, 0x25, 0xfe, 0x4c, 0x34, 0xfe, 0x4c, + 0x87, 0xea, 0x4c, 0x21, 0xfe, 0x4c, 0x13, 0xee, + 0x4c, 0xdd, 0xed, 0x4c, 0xef, 0xed, 0x4c, 0xfe, + 0xed, 0x4c, 0x0c, 0xed, 0x4c, 0x09, 0xed, 0x4c, + 0x07, 0xfe, 0x4c, 0x00, 0xfe, 0x4c, 0xf9, 0xfd, + 0x6c, 0x1a, 0x03, 0x6c, 0x1c, 0x03, 0x6c, 0x1e, + 0x03, 0x6c, 0x20, 0x03, 0x6c, 0x22, 0x03, 0x6c, + 0x24, 0x03, 0x6c, 0x26, 0x03, 0x4c, 0x9e, 0xf4, + 0x4c, 0xdd, 0xf5, 0x4c, 0xe4, 0xf6, 0x4c, 0xdd, + 0xf6, 0x6c, 0x28, 0x03, 0x6c, 0x2a, 0x03, 0x6c, + 0x2c, 0x03, 0x4c, 0x9b, 0xf6, 0x4c, 0x05, 0xe5, + 0x4c, 0x0a, 0xe5, 0x4c, 0x00, 0xe5, 0x52, 0x52, + 0x42, 0x59, 0x43, 0xfe, 0xe2, 0xfc, 0x48, 0xff, diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mixer.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/mixer.cpp new file mode 100644 index 00000000..c7703dc1 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mixer.cpp @@ -0,0 +1,180 @@ +/*************************************************************************** + mixer.cpp - Sids Mixer Routines + ------------------- + begin : Sun Jul 9 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: mixer.cpp,v $ + * Revision 1.10 2002/01/29 21:50:33 s_a_white + * Auto switching to a better emulation mode. m_tuneInfo reloaded after a + * config. Initial code added to support more than two sids. + * + * Revision 1.9 2001/12/13 08:28:08 s_a_white + * Added namespace support to fix problems with xsidplay. + * + * Revision 1.8 2001/11/16 19:25:33 s_a_white + * Removed m_context as where getting mixed with parent class. + * + * Revision 1.7 2001/10/02 18:29:32 s_a_white + * Corrected fixed point maths overflow caused by fastforwarding. + * + * Revision 1.6 2001/09/17 19:02:38 s_a_white + * Now uses fixed point maths for sample output and rtc. + * + * Revision 1.5 2001/07/25 17:02:37 s_a_white + * Support for new configuration interface. + * + * Revision 1.4 2001/07/14 12:47:39 s_a_white + * Mixer routines simplified. Added new and more efficient method of + * determining when an output samples is required. + * + * Revision 1.3 2001/03/01 23:46:37 s_a_white + * Support for sample mode to be selected at runtime. + * + * Revision 1.2 2000/12/12 22:50:15 s_a_white + * Bug Fix #122033. + * + ***************************************************************************/ + +#include "player.h" +#include "sidendian.h" + +const int_least32_t VOLUME_MAX = 255; + +SIDPLAY2_NAMESPACE_START + +void Player::mixerReset (void) +{ // Fixed point 16.16 + m_sampleClock = m_samplePeriod & 0x0FFFF; + // Schedule next sample event + (context ()).schedule (&mixerEvent, + m_samplePeriod >> 24); +} + +void Player::mixer (void) +{ // Fixed point 16.16 + event_clock_t cycles; + char *buf = m_sampleBuffer + m_sampleIndex; + m_sampleClock += m_samplePeriod; + cycles = m_sampleClock >> 16; + m_sampleClock &= 0x0FFFF; + m_sampleIndex += (this->*output) (buf); + + // Schedule next sample event + (context ()).schedule (&mixerEvent, cycles); + + // Filled buffer + if (m_sampleIndex >= m_sampleCount) + m_running = false; +} + + +//------------------------------------------------------------------------- +// Generic sound output generation routines +//------------------------------------------------------------------------- +inline +int_least32_t Player::monoOutGenericLeftIn (uint_least8_t bits) +{ + return sid[0]->output (bits) * m_leftVolume / VOLUME_MAX; +} + +inline +int_least32_t Player::monoOutGenericStereoIn (uint_least8_t bits) +{ + // Convert to mono + return ((sid[0]->output (bits) * m_leftVolume) + + (sid[1]->output (bits) * m_rightVolume)) / (VOLUME_MAX * 2); +} + +inline +int_least32_t Player::monoOutGenericRightIn (uint_least8_t bits) +{ + return sid[1]->output (bits) * m_rightVolume / VOLUME_MAX; +} + + +//------------------------------------------------------------------------- +// 8 bit sound output generation routines +//------------------------------------------------------------------------- +uint_least32_t Player::monoOut8MonoIn (char *buffer) +{ + *buffer = (char) monoOutGenericLeftIn (8) ^ '\x80'; + return sizeof (char); +} + +uint_least32_t Player::monoOut8StereoIn (char *buffer) +{ + *buffer = (char) monoOutGenericStereoIn (8) ^ '\x80'; + return sizeof (char); +} + +uint_least32_t Player::monoOut8StereoRIn (char *buffer) +{ + *buffer = (char) monoOutGenericRightIn (8) ^ '\x80'; + return sizeof (char); +} + +uint_least32_t Player::stereoOut8MonoIn (char *buffer) +{ + char sample = (char) monoOutGenericLeftIn (8) ^ '\x80'; + buffer[0] = sample; + buffer[1] = sample; + return (2 * sizeof (char)); +} + +uint_least32_t Player::stereoOut8StereoIn (char *buffer) +{ + buffer[0] = (char) monoOutGenericLeftIn (8) ^ '\x80'; + buffer[1] = (char) monoOutGenericRightIn (8) ^ '\x80'; + return (2 * sizeof (char)); +} + +//------------------------------------------------------------------------- +// 16 bit sound output generation routines +//------------------------------------------------------------------------- +uint_least32_t Player::monoOut16MonoIn (char *buffer) +{ + endian_16 (buffer, (uint_least16_t) monoOutGenericLeftIn (16)); + return sizeof (uint_least16_t); +} + +uint_least32_t Player::monoOut16StereoIn (char *buffer) +{ + endian_16 (buffer, (uint_least16_t) monoOutGenericStereoIn (16)); + return sizeof (uint_least16_t); +} + +uint_least32_t Player::monoOut16StereoRIn (char *buffer) +{ + endian_16 (buffer, (uint_least16_t) monoOutGenericRightIn (16)); + return sizeof (uint_least16_t); +} + +uint_least32_t Player::stereoOut16MonoIn (char *buffer) +{ + uint_least16_t sample = (uint_least16_t) monoOutGenericLeftIn (16); + endian_16 (buffer, sample); + endian_16 (buffer + sizeof(uint_least16_t), sample); + return (2 * sizeof (uint_least16_t)); +} + +uint_least32_t Player::stereoOut16StereoIn (char *buffer) +{ + endian_16 (buffer, (uint_least16_t) monoOutGenericLeftIn (16)); + endian_16 (buffer + sizeof(uint_least16_t), + (uint_least16_t) monoOutGenericRightIn (16)); + return (2 * sizeof (uint_least16_t)); +} + +SIDPLAY2_NAMESPACE_STOP diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/Makefile.am new file mode 100644 index 00000000..27acc569 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/Makefile.am @@ -0,0 +1,9 @@ + +EXTRA_DIST = cycle_based + +noinst_LTLIBRARIES = libmos6510.la + +libmos6510_la_SOURCES = mos6510.cpp mos6510.h conf6510.h opcodes.h + +# Remove bad default includes +DEFAULT_INCLUDES= diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/Makefile.in new file mode 100644 index 00000000..9af93a74 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/Makefile.in @@ -0,0 +1,426 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +EXTRA_DIST = cycle_based + +noinst_LTLIBRARIES = libmos6510.la + +libmos6510_la_SOURCES = mos6510.cpp mos6510.h conf6510.h opcodes.h + +# Remove bad default includes +DEFAULT_INCLUDES = +subdir = src/mos6510 +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libmos6510_la_LDFLAGS = +libmos6510_la_LIBADD = +am_libmos6510_la_OBJECTS = mos6510.lo +libmos6510_la_OBJECTS = $(am_libmos6510_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/unix/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/mos6510.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libmos6510_la_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libmos6510_la_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/mos6510/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmos6510.la: $(libmos6510_la_OBJECTS) $(libmos6510_la_DEPENDENCIES) + $(CXXLINK) $(libmos6510_la_LDFLAGS) $(libmos6510_la_OBJECTS) $(libmos6510_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mos6510.Plo@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/conf6510.h b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/conf6510.h new file mode 100644 index 00000000..6a1ea0bd --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/conf6510.h @@ -0,0 +1,45 @@ +/*************************************************************************** + config.h - description + ------------------- + begin : Thu May 11 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: conf6510.h,v $ + * Revision 1.3 2001/03/19 23:41:51 s_a_white + * Better support for global debug. + * + * Revision 1.2 2000/12/11 19:03:16 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#ifndef _conf6510_h_ +#define _conf6510_h_ + +#include "sidconfig.h" + +#define MOS6510_CYCLE_BASED +#define MOS6510_ACCURATE_CYCLES +#define MOS6510_SIDPLAY +//#define MOS6510_STATE_6510 +//#define MOS6510_DEBUG 1 + +// Support global debug option +#ifdef DEBUG +# ifndef MOS6510_DEBUG +# define MOS6510_DEBUG DEBUG +# endif +#endif + +#endif // _conf6510_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/mos6510c.h b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/mos6510c.h new file mode 100644 index 00000000..9a046d2e --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/mos6510c.h @@ -0,0 +1,311 @@ +/*************************************************************************** + mos6510c.h - Cycle Accurate 6510 Emulation + ------------------- + begin : Thu May 11 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: mos6510c.h,v $ + * Revision 1.15 2002/11/28 20:35:06 s_a_white + * Reduced number of thrown exceptions when dma occurs. + * + * Revision 1.14 2002/11/25 20:10:55 s_a_white + * A bus access failure should stop the CPU dead like the cycle never started. + * This is currently simulated using throw (execption handling) for now. + * + * Revision 1.13 2002/11/21 19:52:48 s_a_white + * CPU upgraded to be like other components. Theres nolonger a clock call, + * instead events are registered to occur at a specific time. + * + * Revision 1.12 2002/11/19 22:57:33 s_a_white + * Initial support for external DMA to steal cycles away from the CPU. + * + * Revision 1.11 2002/11/01 17:35:27 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.10 2001/08/05 15:46:02 s_a_white + * No longer need to check on which cycle an instruction ends or when to print + * debug information. + * + * Revision 1.9 2001/07/14 16:48:03 s_a_white + * cycleCount and related must roject.Syn + * + * Revision 1.8 2001/07/14 13:15:30 s_a_white + * Accumulator is now unsigned, which improves code readability. Emulation + * tested with testsuite 2.15. Various instructions required modification. + * + * Revision 1.7 2001/03/28 21:17:34 s_a_white + * Added support for proper RMW instructions. + * + * Revision 1.6 2001/03/24 18:09:17 s_a_white + * On entry to interrupt routine the first instruction in the handler is now always + * executed before pending interrupts are re-checked. + * + * Revision 1.5 2001/03/19 23:48:21 s_a_white + * Interrupts made virtual to allow for redefintion for Sidplay1 compatible + * interrupts. + * + * Revision 1.4 2001/03/09 22:28:03 s_a_white + * Speed optimisation update. + * + * Revision 1.3 2001/02/13 21:03:33 s_a_white + * Changed inlines to non-inlines due to function bodies not being in header. + * + * Revision 1.2 2000/12/11 19:04:32 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#ifndef _mos6510c_h_ +#define _mos6510c_h_ + +#include "sidtypes.h" +#include "sidendian.h" + + +class MOS6510: public C64Environment, public Event +{ +private: + // External signals + bool aec; /* Address Controller, blocks all */ + bool rdy; /* Bus Access, blocks reads */ + bool m_blocked; + +protected: + bool dodump; + EventContext &eventContext; + + // Declare processor operations + struct ProcessorOperations + { + void (MOS6510::**cycle)(void); + uint cycles; + uint_least8_t opcode; + }; + + void (MOS6510::*fetchCycle[1]) (void); + struct ProcessorOperations instrTable[0x100]; + struct ProcessorOperations interruptTable[3]; + struct ProcessorOperations *instrCurrent; + + uint_least16_t instrStartPC; + uint_least8_t instrOpcode; + void (MOS6510::**procCycle) (void); + int_least8_t lastAddrCycle; + int_least8_t cycleCount; + + // Pointers to the current instruction cycle + uint_least16_t Cycle_EffectiveAddress; + uint8_t Cycle_Data; + uint_least16_t Cycle_Pointer; + + uint8_t Register_Accumulator; + uint8_t Register_X; + uint8_t Register_Y; + uint_least32_t Register_ProgramCounter; + uint8_t Register_Status; + uint_least8_t Register_c_Flag; + uint_least8_t Register_n_Flag; + uint_least8_t Register_v_Flag; + uint_least8_t Register_z_Flag; + uint_least16_t Register_StackPointer; + uint_least16_t Instr_Operand; + + // Interrupts + struct + { + uint_least8_t pending; + uint_least8_t irqs; + event_clock_t nmiClock; + event_clock_t irqClock; + event_clock_t delay; + bool irqRequest; + bool irqLatch; + } interrupts; + + uint8_t Debug_Data; + uint_least16_t Debug_EffectiveAddress; + uint_least8_t Debug_Opcode; + uint_least16_t Debug_Operand; + uint_least16_t Debug_ProgramCounter; + +protected: + void clock (void); + void event (void); + void Initialise (void); + // Declare Interrupt Routines + inline void RSTRequest (void); + inline void RST1Request (void); + inline void NMIRequest (void); + inline void NMI1Request (void); + inline void IRQRequest (void); + inline void IRQ1Request (void); + inline void IRQ2Request (void); + bool interruptPending (void); + + // Declare Instruction Routines + virtual void FetchOpcode (void); + void NextInstr (void); + inline void FetchDataByte (void); + inline void FetchLowAddr (void); + inline void FetchLowAddrX (void); + inline void FetchLowAddrY (void); + inline void FetchHighAddr (void); + inline void FetchHighAddrX (void); + inline void FetchHighAddrX2 (void); + inline void FetchHighAddrY (void); + inline void FetchHighAddrY2 (void); + inline void FetchLowEffAddr (void); + inline void FetchHighEffAddr (void); + inline void FetchHighEffAddrY (void); + inline void FetchHighEffAddrY2 (void); + inline void FetchLowPointer (void); + inline void FetchLowPointerX (void); + inline void FetchHighPointer (void); + inline void FetchEffAddrDataByte (void); + inline void PutEffAddrDataByte (void); + inline void FetchPutEffAddrDataByte (void); + inline void PushLowPC (void); + inline void PushHighPC (void); + inline void PushSR (bool b_flag); + inline void PushSR (void); + inline void PopLowPC (void); + inline void PopHighPC (void); + inline void PopSR (void); + inline void WasteCycle (void); + inline void DebugCycle (void); + + // Delcare Instruction Operation Routines + inline void adc_instr (void); + inline void alr_instr (void); + inline void anc_instr (void); + inline void and_instr (void); + inline void ane_instr (void); + inline void arr_instr (void); + inline void asl_instr (void); + inline void asla_instr (void); + inline void aso_instr (void); + inline void axa_instr (void); + inline void axs_instr (void); + inline void bcc_instr (void); + inline void bcs_instr (void); + inline void beq_instr (void); + inline void bit_instr (void); + inline void bmi_instr (void); + inline void bne_instr (void); + inline void branch_instr (bool condition); + inline void bpl_instr (void); + inline void brk_instr (void); + inline void bvc_instr (void); + inline void bvs_instr (void); + inline void clc_instr (void); + inline void cld_instr (void); + inline void cli_instr (void); + inline void clv_instr (void); + inline void cmp_instr (void); + inline void cpx_instr (void); + inline void cpy_instr (void); + inline void dcm_instr (void); + inline void dec_instr (void); + inline void dex_instr (void); + inline void dey_instr (void); + inline void eor_instr (void); + inline void inc_instr (void); + inline void ins_instr (void); + inline void inx_instr (void); + inline void iny_instr (void); + inline void jmp_instr (void); + inline void jsr_instr (void); + inline void las_instr (void); + inline void lax_instr (void); + inline void lda_instr (void); + inline void ldx_instr (void); + inline void ldy_instr (void); + inline void lse_instr (void); + inline void lsr_instr (void); + inline void lsra_instr (void); + inline void oal_instr (void); + inline void ora_instr (void); + inline void pha_instr (void); + inline void pla_instr (void); + inline void rla_instr (void); + inline void rol_instr (void); + inline void rola_instr (void); + inline void ror_instr (void); + inline void rora_instr (void); + inline void rra_instr (void); + inline void rti_instr (void); + inline void rts_instr (void); + inline void sbx_instr (void); + inline void say_instr (void); + inline void sbc_instr (void); + inline void sec_instr (void); + inline void sed_instr (void); + inline void sei_instr (void); + inline void shs_instr (void); + inline void sta_instr (void); + inline void stx_instr (void); + inline void sty_instr (void); + inline void tas_instr (void); + inline void tax_instr (void); + inline void tay_instr (void); + inline void tsx_instr (void); + inline void txa_instr (void); + inline void txs_instr (void); + inline void tya_instr (void); + inline void xas_instr (void); + void illegal_instr (void); + + // Declare Arithmatic Operations + inline void Perform_ADC (void); + inline void Perform_SBC (void); + +public: + MOS6510 (EventContext *context); + virtual ~MOS6510 (); + virtual void reset (void); + virtual void credits (char *str); + virtual void DumpState (void); + void debug (bool enable) {dodump = enable;} + void aecSignal (bool state); + void rdySignal (bool state); + + // Non-standard functions + virtual void triggerRST (void); + virtual void triggerNMI (void); + virtual void triggerIRQ (void); + void clearIRQ (void); +}; + + +//-------------------------------------------------------------------------// +// Emulate One Complete Cycle // +inline void MOS6510::clock (void) +{ + int_least8_t i = cycleCount++; + try { + (this->*procCycle[i]) (); + } catch (int_least8_t delta) { + cycleCount += delta; + m_blocked = true; + eventContext.cancel (this); + } +} + +inline void MOS6510::event (void) +{ + eventContext.schedule (this, 1); + clock (); +} + +#endif // _mos6510c_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/mos6510c.i b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/mos6510c.i new file mode 100644 index 00000000..78d57ba6 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/mos6510c.i @@ -0,0 +1,2562 @@ +/*************************************************************************** + mos6510.i - Cycle Accurate 6510 emulation + ------------------- + begin : Thu May 11 06:22:40 BST 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: mos6510c.i,v $ + * Revision 1.30 2002/12/16 08:42:58 s_a_white + * Fixed use of nothrow to be namespaced with std::. + * + * Revision 1.29 2002/11/28 20:35:06 s_a_white + * Reduced number of thrown exceptions when dma occurs. + * + * Revision 1.28 2002/11/25 20:10:55 s_a_white + * A bus access failure should stop the CPU dead like the cycle never started. + * This is currently simulated using throw (execption handling) for now. + * + * Revision 1.27 2002/11/21 19:52:48 s_a_white + * CPU upgraded to be like other components. Theres nolonger a clock call, + * instead events are registered to occur at a specific time. + * + * Revision 1.26 2002/11/19 22:57:33 s_a_white + * Initial support for external DMA to steal cycles away from the CPU. + * + * Revision 1.25 2002/11/01 19:22:36 s_a_white + * Removed debug printf. + * + * Revision 1.24 2002/11/01 17:35:27 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.23 2002/03/12 18:48:03 s_a_white + * Tidied illegal instruction debug print out. + * + * Revision 1.22 2001/12/11 19:24:15 s_a_white + * More GCC3 Fixes. + * + * Revision 1.21 2001/11/16 19:21:03 s_a_white + * Sign fixes. + * + * Revision 1.20 2001/10/28 21:31:26 s_a_white + * Removed kernel debuging code. + * + * Revision 1.19 2001/09/03 22:21:52 s_a_white + * When initialising the status register and therefore unmasking the irqs, + * check the irq line to see if any are pending. + * + * Revision 1.18 2001/08/10 20:05:50 s_a_white + * Fixed RMW instructions which broke due to the optimisation. + * + * Revision 1.17 2001/08/05 15:46:02 s_a_white + * No longer need to check on which cycle an instruction ends or when to print + * debug information. + * + * Revision 1.16 2001/07/14 13:15:30 s_a_white + * Accumulator is now unsigned, which improves code readability. Emulation + * tested with testsuite 2.15. Various instructions required modification. + * + * Revision 1.15 2001/04/20 22:23:11 s_a_white + * Handling of page boundary crossing now correct for branch instructions. + * + * Revision 1.14 2001/03/28 22:59:59 s_a_white + * Converted some bad envReadMemByte's to + * envReadMemDataByte + * + * Revision 1.13 2001/03/28 21:17:34 s_a_white + * Added support for proper RMW instructions. + * + * Revision 1.12 2001/03/24 18:09:17 s_a_white + * On entry to interrupt routine the first instruction in the handler is now always + * executed before pending interrupts are re-checked. + * + * Revision 1.11 2001/03/22 22:40:43 s_a_white + * Added new header for definition of nothrow. + * + * Revision 1.10 2001/03/21 22:27:18 s_a_white + * Change to IRQ error message. + * + * Revision 1.9 2001/03/19 23:46:35 s_a_white + * NMI no longer sets I flag. RTI and store instructions are no longer + * overlapped. + * + * Revision 1.8 2001/03/09 22:28:51 s_a_white + * Speed optimisation update and fix for interrupt flag in PushSR call. + * + * Revision 1.7 2001/02/22 08:28:57 s_a_white + * Interrupt masking fixed. + * + * Revision 1.6 2001/02/13 23:01:44 s_a_white + * envReadMemDataByte now used for some memory accesses. + * + * Revision 1.5 2000/12/24 00:45:38 s_a_white + * HAVE_EXCEPTIONS update + * + * Revision 1.4 2000/12/14 23:55:07 s_a_white + * PushSR optimisation and PopSR code cleanup. + * + ***************************************************************************/ +/* +const char _sidtune_CHRtab[256] = // CHR$ conversion table (0x01 = no output) +{ + 0x0, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xd, 0x1, 0x1, + 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x20,0x21, 0x1,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, + 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, + 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, + 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x24,0x5d,0x20,0x20, + // alternative: CHR$(92=0x5c) => ISO Latin-1(0xa3) + 0x2d,0x23,0x7c,0x2d,0x2d,0x2d,0x2d,0x7c,0x7c,0x5c,0x5c,0x2f,0x5c,0x5c,0x2f,0x2f, + 0x5c,0x23,0x5f,0x23,0x7c,0x2f,0x58,0x4f,0x23,0x7c,0x23,0x2b,0x7c,0x7c,0x26,0x5c, + // 0x80-0xFF + 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x20,0x7c,0x23,0x2d,0x2d,0x7c,0x23,0x7c,0x23,0x2f,0x7c,0x7c,0x2f,0x5c,0x5c,0x2d, + 0x2f,0x2d,0x2d,0x7c,0x7c,0x7c,0x7c,0x2d,0x2d,0x2d,0x2f,0x5c,0x5c,0x2f,0x2f,0x23, + 0x2d,0x23,0x7c,0x2d,0x2d,0x2d,0x2d,0x7c,0x7c,0x5c,0x5c,0x2f,0x5c,0x5c,0x2f,0x2f, + 0x5c,0x23,0x5f,0x23,0x7c,0x2f,0x58,0x4f,0x23,0x7c,0x23,0x2b,0x7c,0x7c,0x26,0x5c, + 0x20,0x7c,0x23,0x2d,0x2d,0x7c,0x23,0x7c,0x23,0x2f,0x7c,0x7c,0x2f,0x5c,0x5c,0x2d, + 0x2f,0x2d,0x2d,0x7c,0x7c,0x7c,0x7c,0x2d,0x2d,0x2d,0x2f,0x5c,0x5c,0x2f,0x2f,0x23 +}; +*/ + +#include "config.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif + +// Microsoft Visual C++ Version Number to work around compiler bug +// Currently both Visual C++ Versions 5, 6 are broken. +#define _MSC_VER_BAD_NEW 1200 /* Defines VC6 and below */ +//char filetmp[0x100]; +//int filepos = 0; + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Status Register Routines // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Use macros to access flags. Allows compatiblity with other versions +// of this emulation +// Set N and Z flags according to byte +#define setFlagsNZ(x) (Register_z_Flag = (Register_n_Flag = (uint_least8_t) (x))) +#define setFlagN(x) (Register_n_Flag = (uint_least8_t) (x)) +#define setFlagV(x) (Register_v_Flag = (uint_least8_t) (x)) +#define setFlagD(x) (Register_Status = (Register_Status & ~(1 << SR_DECIMAL)) \ + | (((x) != 0) << SR_DECIMAL)) +#define setFlagI(x) (Register_Status = (Register_Status & ~(1 << SR_INTERRUPT)) \ + | (((x) != 0) << SR_INTERRUPT)) +#define setFlagZ(x) (Register_z_Flag = (uint_least8_t) (x)) +#define setFlagC(x) (Register_c_Flag = (uint_least8_t) (x)) + + +#define getFlagN() ((Register_n_Flag & (1 << SR_NEGATIVE)) != 0) +#define getFlagV() (Register_v_Flag != 0) +#define getFlagD() ((Register_Status & (1 << SR_DECIMAL)) != 0) +#define getFlagI() ((Register_Status & (1 << SR_INTERRUPT)) != 0) +#define getFlagZ() (Register_z_Flag == 0) +#define getFlagC() (Register_c_Flag != 0) + +#define stealCycle() \ + interrupts.delay++; \ + throw((int_least8_t) -1); + + +// Handle bus access signals +void MOS6510::aecSignal (bool state) +{ // If the cpu blocked waiting for the bus + // the schedule a retry. + aec = state; + if (state && m_blocked) + { + m_blocked = false; + eventContext.schedule (this, 1); + } +} + +void MOS6510::rdySignal (bool state) +{ // If the cpu blocked waiting for the bus + // the schedule a retry. + rdy = state; + if (state && m_blocked) + { + m_blocked = false; + eventContext.schedule (this, 1); + } +} + +// Push P on stack, decrement S +void MOS6510::PushSR (bool b_flag) +{ + if (aec) + { + uint_least16_t addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + /* Rev 1.04 - Corrected flag mask */ + Register_Status &= ((1 << SR_NOTUSED) | (1 << SR_INTERRUPT) | + (1 << SR_DECIMAL) | (1 << SR_BREAK)); + Register_Status |= (getFlagN () << SR_NEGATIVE); + Register_Status |= (getFlagV () << SR_OVERFLOW); + Register_Status |= (getFlagZ () << SR_ZERO); + Register_Status |= (getFlagC () << SR_CARRY); + envWriteMemByte (addr, Register_Status & ~((!b_flag) << SR_BREAK)); + Register_StackPointer--; + } + else + { // Address bus not ready + stealCycle(); + } +} + +void MOS6510::PushSR (void) +{ + PushSR (true); +} + +// increment S, Pop P off stack +void MOS6510::PopSR (void) +{ + if (rdy && aec) + { + bool newFlagI, oldFlagI; + oldFlagI = getFlagI (); + + // Get status register off stack + Register_StackPointer++; + { + uint_least16_t addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + Register_Status = envReadMemByte (addr); + } + Register_Status |= ((1 << SR_NOTUSED) | (1 << SR_BREAK)); + setFlagN (Register_Status); + setFlagV (Register_Status & (1 << SR_OVERFLOW)); + setFlagZ (!(Register_Status & (1 << SR_ZERO))); + setFlagC (Register_Status & (1 << SR_CARRY)); + + // I flag change is delayed by 1 instruction + newFlagI = getFlagI (); + interrupts.irqLatch = oldFlagI ^ newFlagI; + // Check to see if interrupts got re-enabled + if (!newFlagI && interrupts.irqs) + interrupts.irqRequest = true; + } + else + { // Address bus not ready + stealCycle(); + } +} + + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Interrupt Routines // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +#define iIRQSMAX 3 +enum +{ + oNONE = -1, + oRST, + oNMI, + oIRQ +}; + +enum +{ + iNONE = 0, + iRST = 1 << oRST, + iNMI = 1 << oNMI, + iIRQ = 1 << oIRQ +}; + +void MOS6510::triggerRST (void) +{ + interrupts.pending |= iRST; +} + +void MOS6510::triggerNMI (void) +{ + interrupts.pending |= iNMI; + interrupts.nmiClock = eventContext.getTime (); +} + +// Level triggered interrupt +void MOS6510::triggerIRQ (void) +{ // IRQ Suppressed + if (!getFlagI ()) + interrupts.irqRequest = true; + if (!interrupts.irqs++) + interrupts.irqClock = eventContext.getTime (); + + if (interrupts.irqs > iIRQSMAX) + { + printf ("\nMOS6510 ERROR: An external component is not clearing down it's IRQs.\n\n"); + exit (-1); + } +} + +void MOS6510::clearIRQ (void) +{ + if (interrupts.irqs > 0) + { + if (!(--interrupts.irqs)) + { // Clear off the interrupts + interrupts.irqRequest = false; + } + } +} + +bool MOS6510::interruptPending (void) +{ + int_least8_t offset, pending; + static const int_least8_t offTable[] = {oNONE, oRST, oNMI, oRST, + oIRQ, oRST, oNMI, oRST}; + // Update IRQ pending + if (!interrupts.irqLatch) + { + interrupts.pending &= ~iIRQ; + if (interrupts.irqRequest) + interrupts.pending |= iIRQ; + } + + pending = interrupts.pending; +MOS6510_interruptPending_check: + // Service the highest priority interrupt + offset = offTable[pending]; + switch (offset) + { + case oNONE: + return false; + + case oNMI: + { + // Try to determine if we should be processing the NMI yet + event_clock_t cycles = eventContext.getTime (interrupts.nmiClock); + if (cycles >= interrupts.delay) + { + interrupts.pending &= ~iNMI; + break; + } + + // NMI delayed so check for other interrupts + pending &= ~iNMI; + goto MOS6510_interruptPending_check; + } + + case oIRQ: + { + // Try to determine if we should be processing the IRQ yet + event_clock_t cycles = eventContext.getTime (interrupts.irqClock); + if (cycles >= interrupts.delay) + break; + + // NMI delayed so check for other interrupts + pending &= ~iIRQ; + goto MOS6510_interruptPending_check; + } + + case oRST: + break; + } + +#ifdef MOS6510_DEBUG + if (dodump) + { + printf ("****************************************************\n"); + switch (offset) + { + case oIRQ: + printf (" IRQ Routine\n"); + break; + case oNMI: + printf (" NMI Routine\n"); + break; + case oRST: + printf (" RST Routine\n"); + break; + } + printf ("****************************************************\n"); + } +#endif + + // Start the interrupt + instrCurrent = &interruptTable[offset]; + procCycle = instrCurrent->cycle; + cycleCount = 0; + return true; +} + +void MOS6510::RSTRequest (void) +{ + envReset (); +} + +void MOS6510::NMIRequest (void) +{ + if (rdy && aec) + endian_16lo8 (Cycle_EffectiveAddress, envReadMemDataByte (0xFFFA)); + else + { // Address bus not ready + stealCycle(); + } +} + +void MOS6510::NMI1Request (void) +{ + if (rdy && aec) + { + endian_16hi8 (Cycle_EffectiveAddress, envReadMemDataByte (0xFFFB)); + endian_32lo16 (Register_ProgramCounter, Cycle_EffectiveAddress); + } + else + { // Address bus not ready + stealCycle(); + } +} + +void MOS6510::IRQRequest (void) +{ + PushSR (false); + setFlagI (true); + interrupts.irqRequest = false; +} + +void MOS6510::IRQ1Request (void) +{ + if (rdy && aec) + endian_16lo8 (Cycle_EffectiveAddress, envReadMemDataByte (0xFFFE)); + else + { // Address bus not ready + stealCycle(); + } +} + +void MOS6510::IRQ2Request (void) +{ + if (rdy && aec) + { + endian_16hi8 (Cycle_EffectiveAddress, envReadMemDataByte (0xFFFF)); + endian_32lo16 (Register_ProgramCounter, Cycle_EffectiveAddress); + } + else + { // Address bus not ready + stealCycle(); + } +} + +void MOS6510::NextInstr (void) +{ + if (!interruptPending ()) + FetchOpcode (); +} + + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Common Instruction Addressing Routines // +// Addressing operations as described in 64doc by John West and // +// Marko Makela // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// + +// Fetch opcode, increment PC +// Addressing Modes: All +void MOS6510::FetchOpcode (void) +{ + if (rdy && aec) + { // On new instruction all interrupt delays are reset + interrupts.delay = MOS6510_INTERRUPT_DELAY; + interrupts.irqLatch = false; + + instrStartPC = endian_32lo16 (Register_ProgramCounter++); + instrOpcode = envReadMemByte (instrStartPC); + // Convert opcode to pointer in instruction table + instrCurrent = &instrTable[instrOpcode]; + Instr_Operand = 0; + procCycle = instrCurrent->cycle; + cycleCount = 0; + clock (); + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Fetch value, increment PC +/* Addressing Modes: Immediate + Relative +*/ +void MOS6510::FetchDataByte (void) +{ // Get data byte from memory + Cycle_Data = envReadMemByte (endian_32lo16 (Register_ProgramCounter)); + Register_ProgramCounter++; + + // Nextline used for Debug + Instr_Operand = (uint_least16_t) Cycle_Data; +} + +// Fetch low address byte, increment PC +/* Addressing Modes: Stack Manipulation + Absolute + Zero Page + Zerp Page Indexed + Absolute Indexed + Absolute Indirect +*/ +void MOS6510::FetchLowAddr (void) +{ + if (rdy && aec) + { + Cycle_EffectiveAddress = envReadMemByte (endian_32lo16 (Register_ProgramCounter)); + Register_ProgramCounter++; + + // Nextline used for Debug + Instr_Operand = Cycle_EffectiveAddress; + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Read from address, add index register X to it +// Addressing Modes: Zero Page Indexed +void MOS6510::FetchLowAddrX (void) +{ + FetchLowAddr (); + Cycle_EffectiveAddress = (Cycle_EffectiveAddress + Register_X) & 0xFF; +} + +// Read from address, add index register Y to it +// Addressing Modes: Zero Page Indexed +void MOS6510::FetchLowAddrY (void) +{ + FetchLowAddr (); + Cycle_EffectiveAddress = (Cycle_EffectiveAddress + Register_Y) & 0xFF; +} + +// Fetch high address byte, increment PC (Absoulte Addressing) +// Low byte must have been obtained first! +// Addressing Modes: Absolute +void MOS6510::FetchHighAddr (void) +{ + if (rdy && aec) + { // Get the high byte of an address from memory + endian_16hi8 (Cycle_EffectiveAddress, envReadMemByte (endian_32lo16 (Register_ProgramCounter))); + Register_ProgramCounter++; + + // Nextline used for Debug + endian_16hi8 (Instr_Operand, endian_16hi8 (Cycle_EffectiveAddress)); + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Fetch high byte of address, add index register X to low address byte, +// increment PC +// Addressing Modes: Absolute Indexed +void MOS6510::FetchHighAddrX (void) +{ + uint8_t page; + // Rev 1.05 (saw) - Call base Function + FetchHighAddr (); + page = endian_16hi8 (Cycle_EffectiveAddress); + Cycle_EffectiveAddress += Register_X; + +#ifdef MOS6510_ACCURATE_CYCLES + // Handle page boundary crossing + if (endian_16hi8 (Cycle_EffectiveAddress) == page) + cycleCount++; +#endif +} + +// Same as above except dosen't worry about page crossing +void MOS6510::FetchHighAddrX2 (void) +{ + FetchHighAddr (); + Cycle_EffectiveAddress += Register_X; +} + +// Fetch high byte of address, add index register Y to low address byte, +// increment PC +// Addressing Modes: Absolute Indexed +void MOS6510::FetchHighAddrY (void) +{ + uint8_t page; + // Rev 1.05 (saw) - Call base Function + FetchHighAddr (); + page = endian_16hi8 (Cycle_EffectiveAddress); + Cycle_EffectiveAddress += Register_Y; + +#ifdef MOS6510_ACCURATE_CYCLES + // Handle page boundary crossing + if (endian_16hi8 (Cycle_EffectiveAddress) == page) + cycleCount++; +#endif +} + +// Same as above except dosen't worry about page crossing +void MOS6510::FetchHighAddrY2 (void) +{ + FetchHighAddr (); + Cycle_EffectiveAddress += Register_Y; +} + +// Fetch pointer address low, increment PC +/* Addressing Modes: Absolute Indirect + Indirect indexed (post Y) +*/ +void MOS6510::FetchLowPointer (void) +{ + if (rdy && aec) + { + Cycle_Pointer = envReadMemByte (endian_32lo16 (Register_ProgramCounter)); + Register_ProgramCounter++; + // Nextline used for Debug + Instr_Operand = Cycle_Pointer; + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Read pointer from the address and add X to it +// Addressing Modes: Indexed Indirect (pre X) +void MOS6510::FetchLowPointerX (void) +{ + if (rdy && aec) + { + endian_16hi8 (Cycle_Pointer, envReadMemDataByte (Cycle_Pointer)); + // Page boundary crossing is not handled + Cycle_Pointer = (Cycle_Pointer + Register_X) & 0xFF; + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Fetch pointer address high, increment PC +// Addressing Modes: Absolute Indirect +void MOS6510::FetchHighPointer (void) +{ + if (rdy && aec) + { + endian_16hi8 (Cycle_Pointer, envReadMemByte (endian_32lo16 (Register_ProgramCounter))); + Register_ProgramCounter++; + + // Nextline used for Debug + endian_16hi8 (Instr_Operand, endian_16hi8 (Cycle_Pointer)); + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Fetch effective address low +/* Addressing Modes: Indirect + Indexed Indirect (pre X) + Indirect indexed (post Y) +*/ +void MOS6510::FetchLowEffAddr (void) +{ + if (rdy && aec) + Cycle_EffectiveAddress = envReadMemDataByte (Cycle_Pointer); + else + { // Address bus not ready + stealCycle(); + } +} + +// Fetch effective address high +/* Addressing Modes: Indirect + Indexed Indirect (pre X) +*/ +void MOS6510::FetchHighEffAddr (void) +{ + if (rdy && aec) + { // Rev 1.03 (Mike) - Extra +1 removed + endian_16lo8 (Cycle_Pointer, (Cycle_Pointer + 1) & 0xff); + endian_16hi8 (Cycle_EffectiveAddress, envReadMemDataByte (Cycle_Pointer)); + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Fetch effective address high, add Y to low byte of effective address +// Addressing Modes: Indirect indexed (post Y) +void MOS6510::FetchHighEffAddrY (void) +{ + uint8_t page; + // Rev 1.05 (saw) - Call base Function + FetchHighEffAddr (); + page = endian_16hi8 (Cycle_EffectiveAddress); + Cycle_EffectiveAddress += Register_Y; + +#ifdef MOS6510_ACCURATE_CYCLES + // Handle page boundary crossing + if (endian_16hi8 (Cycle_EffectiveAddress) == page) + cycleCount++; +#endif +} + +// Same as above except dosen't worry about page crossing +void MOS6510::FetchHighEffAddrY2 (void) +{ + FetchHighEffAddr (); + Cycle_EffectiveAddress += Register_Y; +} + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Common Data Accessing Routines // +// Data Accessing operations as described in 64doc by John West and // +// Marko Makela // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// + +void MOS6510::FetchEffAddrDataByte (void) +{ + if (rdy && aec) + Cycle_Data = envReadMemDataByte (Cycle_EffectiveAddress); + else + { // Address bus not ready + stealCycle(); + } +} + +void MOS6510::PutEffAddrDataByte (void) +{ + if (aec) + envWriteMemByte (Cycle_EffectiveAddress, Cycle_Data); + else + { // Address bus not ready + stealCycle(); + } +} + +// Used for Read Modify Write (RMW) instructions +void MOS6510::FetchPutEffAddrDataByte (void) +{ + FetchEffAddrDataByte (); + PutEffAddrDataByte (); +} + +// Push Program Counter Low Byte on stack, decrement S +void MOS6510::PushLowPC (void) +{ + if (aec) + { + uint_least16_t addr; + addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + envWriteMemByte (addr, endian_32lo8 (Register_ProgramCounter)); + Register_StackPointer--; + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Push Program Counter High Byte on stack, decrement S +void MOS6510::PushHighPC (void) +{ + if (aec) + { + uint_least16_t addr; + addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + envWriteMemByte (addr, endian_32hi8 (Register_ProgramCounter)); + Register_StackPointer--; + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Increment stack and pull program counter low byte from stack, +void MOS6510::PopLowPC (void) +{ + if (rdy && aec) + { + uint_least16_t addr; + Register_StackPointer++; + addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + endian_16lo8 (Cycle_EffectiveAddress, envReadMemDataByte (addr)); + } + else + { // Address bus not ready + stealCycle(); + } +} + +// Increment stack and pull program counter high byte from stack, +void MOS6510::PopHighPC (void) +{ + if (rdy && aec) + { + uint_least16_t addr; + Register_StackPointer++; + addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + endian_16hi8 (Cycle_EffectiveAddress, envReadMemDataByte (addr)); + } + else + { // Address bus not ready + stealCycle(); + } +} + +void MOS6510::WasteCycle (void) +{ +} + +void MOS6510::DebugCycle (void) +{ + if (dodump) + DumpState (); + clock (); +} + + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Common Instruction Opcodes // +// See and 6510 Assembly Book for more information on these instructions // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// + +void MOS6510::brk_instr (void) +{ + PushSR (); + setFlagI (true); + interrupts.irqRequest = false; + + // Check for an NMI, and switch over if pending + if (interrupts.pending & iNMI) + { + event_clock_t cycles = eventContext.getTime (interrupts.nmiClock); + if (cycles >= interrupts.delay) + { + interrupts.pending &= ~iNMI; + instrCurrent = &interruptTable[oNMI]; + procCycle = &instrCurrent->cycle[cycleCount]; + } + } +} + +void MOS6510::cld_instr (void) +{ + setFlagD (false); +} + +void MOS6510::cli_instr (void) +{ + bool oldFlagI = getFlagI (); + setFlagI (false); + // I flag change is delayed by 1 instruction + interrupts.irqLatch = oldFlagI ^ getFlagI (); + // Check to see if interrupts got re-enabled + if (interrupts.irqs) + interrupts.irqRequest = true; +} + +void MOS6510::jmp_instr (void) +{ + endian_32lo16 (Register_ProgramCounter, Cycle_EffectiveAddress); +} + +void MOS6510::jsr_instr (void) +{ // JSR uses absolute addressing in this emulation, + // hence the -1. The real SID does not use this addressing + // mode. + Register_ProgramCounter--; + PushHighPC (); +} + +void MOS6510::pha_instr (void) +{ + if (aec) + { + uint_least16_t addr; + addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + envWriteMemByte (addr, Register_Accumulator); + Register_StackPointer--; + } + else + { // Address bus not ready + cycleCount--; + return; + } +} + +/* RTI does not delay the IRQ I flag change as it is set 3 cycles before + * the end of the opcode, and thus the 6510 has enough time to call the + * interrupt routine as soon as the opcode ends, if necessary. */ +void MOS6510::rti_instr (void) +{ +#ifdef MOS6510_DEBUG + if (dodump) + printf ("****************************************************\n\n"); +#endif + + endian_32lo16 (Register_ProgramCounter, Cycle_EffectiveAddress); + interrupts.irqLatch = false; +} + +void MOS6510::rts_instr (void) +{ +/* + // Hack - Output character to screen + if (Register_ProgramCounter == 0xffd3) + { + char ch = _sidtune_CHRtab[Register_Accumulator]; + switch (ch) + { + case 0: + break; + case 1: + printf (" "); + fprintf (stderr, " "); + case 0xd: + printf ("\n"); + fprintf (stderr, "\n"); + filepos = 0; + break; + default: + filetmp[filepos++] = ch; + printf ("%c", ch); + fprintf (stderr, "%c", ch); + } + } + + if (Register_ProgramCounter == 0xe170) + { + filetmp[filepos] = '\0'; + envLoadFile (filetmp); + } +*/ + endian_32lo16 (Register_ProgramCounter, Cycle_EffectiveAddress); + Register_ProgramCounter++; +} + +void MOS6510::sed_instr (void) +{ + setFlagD (true); +} + +void MOS6510::sei_instr (void) +{ + bool oldFlagI = getFlagI (); + setFlagI (true); + // I flag change is delayed by 1 instruction + interrupts.irqLatch = oldFlagI ^ getFlagI (); + interrupts.irqRequest = false; +} + +void MOS6510::sta_instr (void) +{ + Cycle_Data = Register_Accumulator; + PutEffAddrDataByte (); +} + +void MOS6510::stx_instr (void) +{ + Cycle_Data = Register_X; + PutEffAddrDataByte (); +} + +void MOS6510::sty_instr (void) +{ + Cycle_Data = Register_Y; + PutEffAddrDataByte (); +} + + + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Common Instruction Undocumented Opcodes // +// See documented 6502-nmo.opc by Adam Vardy for more details // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// + +// Undocumented - This opcode stores the result of A AND X AND the high +// byte of the target address of the operand +1 in memory. +void MOS6510::axa_instr (void) +{ + Cycle_Data = Register_X & Register_Accumulator & (endian_16hi8 (Cycle_EffectiveAddress) + 1); + PutEffAddrDataByte (); +} + +// Undocumented - AXS ANDs the contents of the A and X registers (without changing the +// contents of either register) and stores the result in memory. +// AXS does not affect any flags in the processor status register. +void MOS6510::axs_instr (void) +{ + Cycle_Data = Register_Accumulator & Register_X; +} + +/* Not required - Operation performed By another method +// Undocumented - HLT crashes the microprocessor. When this opcode is executed, program +// execution ceases. No hardware interrupts will execute either. The author +// has characterized this instruction as a halt instruction since this is the +// most straightforward explanation for this opcode's behaviour. Only a reset +// will restart execution. This opcode leaves no trace of any operation +// performed! No registers affected. +void MOS6510::hlt_instr (void) +{ +} +*/ + +/* Not required - Operation performed By another method +void MOS6510::nop_instr (void) +{ +} +*/ + +/* Not required - Operation performed By another method +void MOS6510::php_instr (void) +{ +} +*/ + +// Undocumented - This opcode ANDs the contents of the Y register with <ab+1> and stores the +// result in memory. +void MOS6510::say_instr (void) +{ + Cycle_Data = Register_Y & (endian_16hi8 (Cycle_EffectiveAddress) + 1); +} + +/* Not required - Operation performed By another method +// Undocumented - skip next byte. +void MOS6510::skb_instr (void) +{ + Register_ProgramCounter++; +} +*/ + +/* Not required - Operation performed By another method +// Undocumented - skip next word. +void MOS6510::skw_instr (void) +{ + Register_ProgramCounter += 2; +} +*/ + +// Undocumented - This opcode ANDs the contents of the X register with <ab+1> and stores the +// result in memory. +void MOS6510::xas_instr (void) +{ + Cycle_Data = Register_X & (endian_16hi8 (Cycle_EffectiveAddress) + 1); +} + + +#ifdef X86 +#include "MOS6510\CYCLE_~1\X86.CPP" +//#include "MOS6510\CYCLE_BASED\X86.CPP" +#else + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Generic Binary Coded Decimal Correction // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// + +void MOS6510::Perform_ADC (void) +{ + uint C = getFlagC (); + uint A = Register_Accumulator; + uint s = Cycle_Data; + uint regAC2 = A + s + C; + + if (getFlagD ()) + { // BCD mode + uint lo = (A & 0x0f) + (s & 0x0f) + C; + uint hi = (A & 0xf0) + (s & 0xf0); + if (lo > 0x09) lo += 0x06; + if (lo > 0x0f) hi += 0x10; + + setFlagZ (regAC2); + setFlagN (hi); + setFlagV (((hi ^ A) & 0x80) && !((A ^ s) & 0x80)); + if (hi > 0x90) hi += 0x60; + + setFlagC (hi > 0xff); + Register_Accumulator = (hi | (lo & 0x0f)); + } + else + { // Binary mode + setFlagC (regAC2 > 0xff); + setFlagV (((regAC2 ^ A) & 0x80) && !((A ^ s) & 0x80)); + setFlagsNZ (Register_Accumulator = regAC2 & 0xff); + } +} + +void MOS6510::Perform_SBC (void) +{ + uint C = !getFlagC (); + uint A = Register_Accumulator; + uint s = Cycle_Data; + uint regAC2 = A - s - C; + + setFlagC (regAC2 < 0x100); + setFlagV (((regAC2 ^ A) & 0x80) && ((A ^ s) & 0x80)); + setFlagsNZ (regAC2); + + if (getFlagD ()) + { // BCD mode + uint lo = (A & 0x0f) - (s & 0x0f) - C; + uint hi = (A & 0xf0) - (s & 0xf0); + if (lo & 0x10) + { + lo -= 0x06; + hi -= 0x10; + } + if (hi & 0x100) hi -= 0x60; + Register_Accumulator = (hi | (lo & 0x0f)); + } + else + { // Binary mode + Register_Accumulator = regAC2 & 0xff; + } +} + + + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Generic Instruction Addressing Routines // +//-------------------------------------------------------------------------/ + + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Generic Instruction Opcodes // +// See and 6510 Assembly Book for more information on these instructions // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// + +void MOS6510::adc_instr (void) +{ + Perform_ADC (); +} + +void MOS6510::and_instr (void) +{ + setFlagsNZ (Register_Accumulator &= Cycle_Data); +} + +void MOS6510::ane_instr (void) +{ + setFlagsNZ (Register_Accumulator = (Register_Accumulator | 0xee) & Register_X & Cycle_Data); +} + +void MOS6510::asl_instr (void) +{ + setFlagC (Cycle_Data & 0x80); + setFlagsNZ (Cycle_Data <<= 1); +} + +void MOS6510::asla_instr (void) +{ + setFlagC (Register_Accumulator & 0x80); + setFlagsNZ (Register_Accumulator <<= 1); +} + +void MOS6510::branch_instr (bool condition) +{ + if (condition) +#ifdef MOS6510_ACCURATE_CYCLES + { + uint8_t page; + page = endian_32hi8 (Register_ProgramCounter); + Register_ProgramCounter += (int8_t) Cycle_Data; + + // Handle page boundary crossing + if (endian_32hi8 (Register_ProgramCounter) == page) + { + cycleCount++; + interrupts.delay++; + } + } + else + { + cycleCount += 2; + } +#else + Register_ProgramCounter += (int8_t) Cycle_Data; +#endif +} + +void MOS6510::bcc_instr (void) +{ + branch_instr (!getFlagC ()); +} + +void MOS6510::bcs_instr (void) +{ + branch_instr (getFlagC ()); +} + +void MOS6510::beq_instr (void) +{ + branch_instr (getFlagZ ()); +} + +void MOS6510::bit_instr (void) +{ + setFlagZ (Register_Accumulator & Cycle_Data); + setFlagN (Cycle_Data); + setFlagV (Cycle_Data & 0x40); +} + +void MOS6510::bmi_instr (void) +{ + branch_instr (getFlagN ()); +} + +void MOS6510::bne_instr (void) +{ + branch_instr (!getFlagZ ()); +} + +void MOS6510::bpl_instr(void) +{ + branch_instr (!getFlagN ()); +} + +void MOS6510::bvc_instr (void) +{ + branch_instr (!getFlagV ()); +} + +void MOS6510::bvs_instr (void) +{ + branch_instr (getFlagV ()); +} + +void MOS6510::clc_instr (void) +{ + setFlagC (false); +} + +void MOS6510::clv_instr (void) +{ + setFlagV (false); +} + +void MOS6510::cmp_instr (void) +{ + uint_least16_t tmp = (uint_least16_t) Register_Accumulator - Cycle_Data; + setFlagsNZ (tmp); + setFlagC (tmp < 0x100); +} + +void MOS6510::cpx_instr (void) +{ + uint_least16_t tmp = (uint_least16_t) Register_X - Cycle_Data; + setFlagsNZ (tmp); + setFlagC (tmp < 0x100); +} + +void MOS6510::cpy_instr (void) +{ + uint_least16_t tmp = (uint_least16_t) Register_Y - Cycle_Data; + setFlagsNZ (tmp); + setFlagC (tmp < 0x100); +} + +void MOS6510::dec_instr (void) +{ + setFlagsNZ (--Cycle_Data); +} + +void MOS6510::dex_instr (void) +{ + setFlagsNZ (--Register_X); +} + +void MOS6510::dey_instr (void) +{ + setFlagsNZ (--Register_Y); +} + +void MOS6510::eor_instr (void) +{ + setFlagsNZ (Register_Accumulator^= Cycle_Data); +} + +void MOS6510::inc_instr (void) +{ + setFlagsNZ (++Cycle_Data); +} + +void MOS6510::inx_instr (void) +{ + setFlagsNZ (++Register_X); +} + +void MOS6510::iny_instr (void) +{ + setFlagsNZ (++Register_Y); +} + +void MOS6510::lda_instr (void) +{ + setFlagsNZ (Register_Accumulator = Cycle_Data); +} + +void MOS6510::ldx_instr (void) +{ + setFlagsNZ (Register_X = Cycle_Data); +} + +void MOS6510::ldy_instr (void) +{ + setFlagsNZ (Register_Y = Cycle_Data); +} + +void MOS6510::lsr_instr (void) +{ + setFlagC (Cycle_Data & 0x01); + setFlagsNZ (Cycle_Data >>= 1); +} + +void MOS6510::lsra_instr (void) +{ + setFlagC (Register_Accumulator & 0x01); + setFlagsNZ (Register_Accumulator >>= 1); +} + +void MOS6510::ora_instr (void) +{ + setFlagsNZ (Register_Accumulator |= Cycle_Data); +} + +void MOS6510::pla_instr (void) +{ + if (rdy && aec) + { + uint_least16_t addr; + Register_StackPointer++; + addr = Register_StackPointer; + endian_16hi8 (addr, SP_PAGE); + setFlagsNZ (Register_Accumulator = envReadMemByte (addr)); + } + else + { // Address bus not ready + cycleCount--; + return; + } +} + +void MOS6510::rol_instr (void) +{ + uint8_t tmp = Cycle_Data & 0x80; + Cycle_Data <<= 1; + if (getFlagC ()) Cycle_Data |= 0x01; + setFlagsNZ (Cycle_Data); + setFlagC (tmp); +} + +void MOS6510::rola_instr (void) +{ + uint8_t tmp = Register_Accumulator & 0x80; + Register_Accumulator <<= 1; + if (getFlagC ()) Register_Accumulator |= 0x01; + setFlagsNZ (Register_Accumulator); + setFlagC (tmp); +} + +void MOS6510::ror_instr (void) +{ + uint8_t tmp = Cycle_Data & 0x01; + Cycle_Data >>= 1; + if (getFlagC ()) Cycle_Data |= 0x80; + setFlagsNZ (Cycle_Data); + setFlagC (tmp); +} + +void MOS6510::rora_instr (void) +{ + uint8_t tmp = Register_Accumulator & 0x01; + Register_Accumulator >>= 1; + if (getFlagC ()) Register_Accumulator |= 0x80; + setFlagsNZ (Register_Accumulator); + setFlagC (tmp); +} + +void MOS6510::sbx_instr (void) +{ + uint tmp = (Register_X & Register_Accumulator) - Cycle_Data; + setFlagsNZ (Register_X = tmp & 0xff); + setFlagC (tmp < 0x100); +} + +void MOS6510::sbc_instr (void) +{ + Perform_SBC (); +} + +void MOS6510::sec_instr (void) +{ + setFlagC (true); +} + +void MOS6510::shs_instr (void) +{ + endian_16lo8 (Register_StackPointer, (Register_Accumulator & Register_X)); + Cycle_Data = (endian_16hi8 (Cycle_EffectiveAddress) + 1) & Register_StackPointer; +} + +void MOS6510::tax_instr (void) +{ + setFlagsNZ (Register_X = Register_Accumulator); +} + +void MOS6510::tay_instr (void) +{ + setFlagsNZ (Register_Y = Register_Accumulator); +} + +void MOS6510::tsx_instr (void) +{ // Rev 1.03 (saw) - Got these tsx and txs reversed + setFlagsNZ (Register_X = endian_16lo8 (Register_StackPointer)); +} + +void MOS6510::txa_instr (void) +{ + setFlagsNZ (Register_Accumulator = Register_X); +} + +void MOS6510::txs_instr (void) +{ // Rev 1.03 (saw) - Got these tsx and txs reversed + endian_16lo8 (Register_StackPointer, Register_X); +} + +void MOS6510::tya_instr (void) +{ + setFlagsNZ (Register_Accumulator = Register_Y); +} + +void MOS6510::illegal_instr (void) +{ + printf ("\n\nILLEGAL INSTRUCTION, resetting emulation. **************\n"); + DumpState (); + printf ("********************************************************\n"); + // Perform Environment Reset + envReset (); +} + + +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// +// Generic Instruction Undocuemented Opcodes // +// See documented 6502-nmo.opc by Adam Vardy for more details // +//-------------------------------------------------------------------------// +//-------------------------------------------------------------------------// + +// Undocumented - This opcode ANDs the contents of the A register with an immediate value and +// then LSRs the result. +void MOS6510::alr_instr (void) +{ + Register_Accumulator &= Cycle_Data; + setFlagC (Register_Accumulator & 0x01); + setFlagsNZ (Register_Accumulator >>= 1); +} + +// Undcouemented - ANC ANDs the contents of the A register with an immediate value and then +// moves bit 7 of A into the Carry flag. This opcode works basically +// identically to AND #immed. except that the Carry flag is set to the same +// state that the Negative flag is set to. +void MOS6510::anc_instr (void) +{ + setFlagsNZ (Register_Accumulator &= Cycle_Data); + setFlagC (getFlagN ()); +} + +// Undocumented - This opcode ANDs the contents of the A register with an immediate value and +// then RORs the result (Implementation based on that of Frodo C64 Emulator) +void MOS6510::arr_instr (void) +{ + uint8_t data = Cycle_Data & Register_Accumulator; + Register_Accumulator = data >> 1; + if (getFlagC ()) Register_Accumulator |= 0x80; + + if (getFlagD ()) + { + setFlagN (0); + if (getFlagC ()) setFlagN (1 << SR_NEGATIVE); + setFlagZ (Register_Accumulator); + setFlagV ((data ^ Register_Accumulator) & 0x40); + + if ((data & 0x0f) + (data & 0x01) > 5) + Register_Accumulator = Register_Accumulator & 0xf0 | (Register_Accumulator + 6) & 0x0f; + setFlagC (((data + (data & 0x10)) & 0x1f0) > 0x50); + if (getFlagC ()) + Register_Accumulator += 0x60; + } + else + { + setFlagsNZ (Register_Accumulator); + setFlagC (Register_Accumulator & 0x40); + setFlagV ((Register_Accumulator & 0x40) ^ ((Register_Accumulator & 0x20) << 1)); + } +} + +// Undocumented - This opcode ASLs the contents of a memory location and then ORs the result +// with the accumulator. +void MOS6510::aso_instr (void) +{ + setFlagC (Cycle_Data & 0x80); + Cycle_Data <<= 1; + setFlagsNZ (Register_Accumulator |= Cycle_Data); +} + +// Undocumented - This opcode DECs the contents of a memory location and then CMPs the result +// with the A register. +void MOS6510::dcm_instr (void) +{ + uint_least16_t tmp; + Cycle_Data--; + tmp = (uint_least16_t) Register_Accumulator - Cycle_Data; + setFlagsNZ (tmp); + setFlagC (tmp < 0x100); +} + +// Undocumented - This opcode INCs the contents of a memory location and then SBCs the result +// from the A register. +void MOS6510::ins_instr (void) +{ + Cycle_Data++; + Perform_SBC (); +} + +// Undocumented - This opcode ANDs the contents of a memory location with the contents of the +// stack pointer register and stores the result in the accumulator, the X +// register, and the stack pointer. Affected flags: N Z. +void MOS6510::las_instr (void) +{ + setFlagsNZ (Cycle_Data &= endian_16lo8 (Register_StackPointer)); + Register_Accumulator = Cycle_Data; + Register_X = Cycle_Data; + Register_StackPointer = Cycle_Data; +} + +// Undocumented - This opcode loads both the accumulator and the X register with the contents +// of a memory location. +void MOS6510::lax_instr (void) +{ + setFlagsNZ (Register_Accumulator = Register_X = Cycle_Data); +} + +// Undocumented - LSE LSRs the contents of a memory location and then EORs the result with +// the accumulator. +void MOS6510::lse_instr (void) +{ + setFlagC (Cycle_Data & 0x01); + Cycle_Data >>= 1; + setFlagsNZ (Register_Accumulator ^= Cycle_Data); +} + +// Undocumented - This opcode ORs the A register with #xx, ANDs the result with an immediate +// value, and then stores the result in both A and X. +// xx may be EE,EF,FE, OR FF, but most emulators seem to use EE +void MOS6510::oal_instr (void) +{ + setFlagsNZ (Register_X = (Register_Accumulator = (Cycle_Data & (Register_Accumulator | 0xee)))); +} + +// Undocumented - RLA ROLs the contents of a memory location and then ANDs the result with +// the accumulator. +void MOS6510::rla_instr (void) +{ + uint8_t tmp = Cycle_Data & 0x80; + Cycle_Data = Cycle_Data << 1; + if (getFlagC ()) Cycle_Data |= 0x01; + setFlagC (tmp); + setFlagsNZ (Register_Accumulator &= Cycle_Data); +} + +// Undocumented - RRA RORs the contents of a memory location and then ADCs the result with +// the accumulator. +void MOS6510::rra_instr (void) +{ + uint8_t tmp = Cycle_Data & 0x01; + Cycle_Data >>= 1; + if (getFlagC ()) Cycle_Data |= 0x80; + setFlagC (tmp); + Perform_ADC (); +} + +// Undocumented - This opcode ANDs the contents of the A and X registers (without changing +// the contents of either register) and transfers the result to the stack +// pointer. It then ANDs that result with the contents of the high byte of +// the target address of the operand +1 and stores that final result in +// memory. +void MOS6510::tas_instr (void) +{ + endian_16lo8 (Register_StackPointer, Register_Accumulator & Register_X); + uint_least16_t tmp = Register_StackPointer & (Cycle_EffectiveAddress + 1); + Cycle_Data = (signed) endian_16lo8 (tmp); +} + +#endif // X86 + + +//-------------------------------------------------------------------------// +// Initialise and create CPU Chip // + +//MOS6510::MOS6510 (model_t _model, const char *id) +MOS6510::MOS6510 (EventContext *context) +:eventContext(*context), + Event("CPU") +{ + struct ProcessorOperations *instr; + uint8_t legalMode = true; + uint8_t legalInstr = true; + uint i, pass; + + //---------------------------------------------------------------------- + // Build up the processor instruction table + for (i = 0; i < 0x100; i++) + { +#if MOS6510_DEBUG > 1 + printf ("Building Command %d[%02x]..", i, i); +#endif + + // Pass 1 allocates the memory, Pass 2 builds the instruction + instr = &instrTable[i]; + instr->cycle = NULL; + + for (pass = 0; pass < 2; pass++) + { + enum {WRITE = 0, RMW = 1, READ = 2}; + int access = WRITE; + cycleCount = -1; + legalMode = true; + legalInstr = true; + if (pass) procCycle = instr->cycle; + + switch (i) + { + // Accumulator or Implied addressing + case ASLn: case CLCn: case CLDn: case CLIn: case CLVn: case DEXn: + case DEYn: case INXn: case INYn: case LSRn: case NOPn_: case PHAn: + case PHPn: case PLAn: case PLPn: case ROLn: case RORn: case RTIn: + case RTSn: case SECn: case SEDn: case SEIn: case TAXn: case TAYn: + case TSXn: case TXAn: case TXSn: case TYAn: +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + // Immediate and Relative Addressing Mode Handler + case ADCb: case ANDb: case ANCb_: case ANEb: case ASRb: case ARRb: + case BCCr: case BCSr: case BEQr: case BMIr: case BNEr: case BPLr: + case BRKn: case BVCr: case BVSr: case CMPb: case CPXb: case CPYb: + case EORb: case LDAb: case LDXb: case LDYb: case LXAb: case NOPb_: + case ORAb: case SBCb_: case SBXb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchDataByte; + break; + + // Zero Page Addressing Mode Handler - Read & RMW + case ADCz: case ANDz: case BITz: case CMPz: case CPXz: case CPYz: + case EORz: case LAXz: case LDAz: case LDXz: case LDYz: case ORAz: + case NOPz_: case SBCz: + access++; + case ASLz: case DCPz: case DECz: case INCz: case ISBz: case LSRz: + case ROLz: case RORz: case SREz: case SLOz: case RLAz: case RRAz: + access++; + case SAXz: case STAz: case STXz: case STYz: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddr; + if (access == READ) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + } else if (access == RMW) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchPutEffAddrDataByte; + } + break; + + // Zero Page with X Offset Addressing Mode Handler + case ADCzx: case ANDzx: case CMPzx: case EORzx: case LDAzx: case LDYzx: + case NOPzx_: case ORAzx: case SBCzx: + access++; + case ASLzx: case DCPzx: case DECzx: case INCzx: case ISBzx: case LSRzx: + case RLAzx: case ROLzx: case RORzx: case RRAzx: case SLOzx: case SREzx: + access++; + case STAzx: case STYzx: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddrX; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + if (access == READ) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + } else if (access == RMW) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchPutEffAddrDataByte; + } + break; + + // Zero Page with Y Offset Addressing Mode Handler + case LDXzy: case LAXzy: + access = READ; + case STXzy: case SAXzy: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddrY; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + if (access == READ) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + } + break; + + // Absolute Addressing Mode Handler + case ADCa: case ANDa: case BITa: case CMPa: case CPXa: case CPYa: + case EORa: case LAXa: case LDAa: case LDXa: case LDYa: case NOPa: + case ORAa: case SBCa: + access++; + case ASLa: case DCPa: case DECa: case INCa: case ISBa: case LSRa: + case ROLa: case RORa: case SLOa: case SREa: case RLAa: case RRAa: + access++; + case JMPw: case JSRw: case SAXa: case STAa: case STXa: case STYa: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighAddr; + if (access == READ) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + } else if (access == RMW) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchPutEffAddrDataByte; + } + break; + + // Absolute With X Offset Addressing Mode Handler (Read) + case ADCax: case ANDax: case CMPax: case EORax: case LDAax: + case LDYax: case NOPax_: case ORAax: case SBCax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighAddrX; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + break; + + // Absolute X (No page crossing handled) + case ASLax: case DCPax: case DECax: case INCax: case ISBax: + case LSRax: case RLAax: case ROLax: case RORax: case RRAax: + case SLOax: case SREax: + access = RMW; + case SHYax: case STAax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighAddrX2; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + if (access == RMW) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchPutEffAddrDataByte; + } + break; + + // Absolute With Y Offset Addresing Mode Handler (Read) + case ADCay: case ANDay: case CMPay: case EORay: case LASay: + case LAXay: case LDAay: case LDXay: case ORAay: case SBCay: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighAddrY; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + break; + + // Absolute Y (No page crossing handled) + case DCPay: case ISBay: case RLAay: case RRAay: case SLOay: + case SREay: + access = RMW; + case SHAay: case SHSay: case SHXay: case STAay: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighAddrY2; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + if (access == RMW) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchPutEffAddrDataByte; + } + break; + + // Absolute Indirect Addressing Mode Handler + case JMPi: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowPointer; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighPointer; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowEffAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighEffAddr; + break; + + // Indexed with X Preinc Addressing Mode Handler + case ADCix: case ANDix: case CMPix: case EORix: case LAXix: case LDAix: + case ORAix: case SBCix: + access++; + case DCPix: case ISBix: case SLOix: case SREix: case RLAix: case RRAix: + access++; + case SAXix: case STAix: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowPointer; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowPointerX; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowEffAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighEffAddr; + if (access == READ) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + } else if (access == RMW) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchPutEffAddrDataByte; + } + break; + + // Indexed with Y Postinc Addressing Mode Handler (Read) + case ADCiy: case ANDiy: case CMPiy: case EORiy: case LAXiy: + case LDAiy: case ORAiy: case SBCiy: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowPointer; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowEffAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighEffAddrY; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchEffAddrDataByte; + break; + + // Indexed Y (No page crossing handled) + case DCPiy: case ISBiy: case RLAiy: case RRAiy: case SLOiy: + case SREiy: + access = RMW; + case SHAiy: case STAiy: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowPointer; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchLowEffAddr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchHighEffAddrY2; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + if (access == RMW) { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchPutEffAddrDataByte; + } + break; + + default: + legalMode = false; + break; + } + +#ifdef MOS6510_DEBUG + if (legalMode) + { + cycleCount++; + if (pass) procCycle[cycleCount] = &MOS6510::DebugCycle; + } +#endif // MOS6510_DEBUG + + //--------------------------------------------------------------------------------------- + // Addressing Modes Finished, other cycles are instruction dependent + switch(i) + { + case ADCz: case ADCzx: case ADCa: case ADCax: case ADCay: case ADCix: + case ADCiy: case ADCb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::adc_instr; + break; + + case ANCb_: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::anc_instr; + break; + + case ANDz: case ANDzx: case ANDa: case ANDax: case ANDay: case ANDix: + case ANDiy: case ANDb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::and_instr; + break; + + case ANEb: // Also known as XAA + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::ane_instr; + break; + + case ARRb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::arr_instr; + break; + + case ASLn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::asla_instr; + break; + + case ASLz: case ASLzx: case ASLa: case ASLax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::asl_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case ASRb: // Also known as ALR + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::alr_instr; + break; + + case BCCr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bcc_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case BCSr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bcs_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case BEQr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::beq_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case BITz: case BITa: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bit_instr; + break; + + case BMIr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bmi_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case BNEr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bne_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case BPLr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bpl_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case BRKn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushHighPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushLowPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::brk_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::IRQ1Request; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::IRQ2Request; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchOpcode; + break; + + case BVCr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bvc_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case BVSr: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::bvs_instr; +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + break; + + case CLCn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::clc_instr; + break; + + case CLDn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::cld_instr; + break; + + case CLIn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::cli_instr; + break; + + case CLVn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::clv_instr; + break; + + case CMPz: case CMPzx: case CMPa: case CMPax: case CMPay: case CMPix: + case CMPiy: case CMPb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::cmp_instr; + break; + + case CPXz: case CPXa: case CPXb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::cpx_instr; + break; + + case CPYz: case CPYa: case CPYb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::cpy_instr; + break; + + case DCPz: case DCPzx: case DCPa: case DCPax: case DCPay: case DCPix: + case DCPiy: // Also known as DCM + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::dcm_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case DECz: case DECzx: case DECa: case DECax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::dec_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case DEXn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::dex_instr; + break; + + case DEYn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::dey_instr; + break; + + case EORz: case EORzx: case EORa: case EORax: case EORay: case EORix: + case EORiy: case EORb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::eor_instr; + break; + +/* HLT // Also known as JAM + case 0x02: case 0x12: case 0x22: case 0x32: case 0x42: case 0x52: + case 0x62: case 0x72: case 0x92: case 0xb2: case 0xd2: case 0xf2: + case 0x02: case 0x12: case 0x22: case 0x32: case 0x42: case 0x52: + case 0x62: case 0x72: case 0x92: case 0xb2: case 0xd2: case 0xf2: + cycleCount++; if (pass) procCycle[cycleCount] = hlt_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; +*/ + + case INCz: case INCzx: case INCa: case INCax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::inc_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case INXn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::inx_instr; + break; + + case INYn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::iny_instr; + break; + + case ISBz: case ISBzx: case ISBa: case ISBax: case ISBay: case ISBix: + case ISBiy: // Also known as INS + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::ins_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case JMPw: case JMPi: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::jmp_instr; + break; + + case JSRw: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::jsr_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushLowPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::jmp_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case LASay: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::las_instr; + break; + + case LAXz: case LAXzy: case LAXa: case LAXay: case LAXix: case LAXiy: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::lax_instr; + break; + + case LDAz: case LDAzx: case LDAa: case LDAax: case LDAay: case LDAix: + case LDAiy: case LDAb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::lda_instr; + break; + + case LDXz: case LDXzy: case LDXa: case LDXay: case LDXb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::ldx_instr; + break; + + case LDYz: case LDYzx: case LDYa: case LDYax: case LDYb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::ldy_instr; + break; + + case LSRn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::lsra_instr; + break; + + case LSRz: case LSRzx: case LSRa: case LSRax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::lsr_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case NOPn_: case NOPb_: + // Should not be required! + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case NOPz_: case NOPzx_: case NOPa: case NOPax_: + // NOPb NOPz NOPzx - Also known as SKBn + // NOPa NOPax - Also known as SKWn + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case LXAb: // Also known as OAL + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::oal_instr; + break; + + case ORAz: case ORAzx: case ORAa: case ORAax: case ORAay: case ORAix: + case ORAiy: case ORAb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::ora_instr; + break; + + case PHAn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::pha_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case PHPn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushSR; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case PLAn: +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::pla_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case PLPn: +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PopSR; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case RLAz: case RLAzx: case RLAix: case RLAa: case RLAax: case RLAay: + case RLAiy: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::rla_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case ROLn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::rola_instr; + break; + + case ROLz: case ROLzx: case ROLa: case ROLax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::rol_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case RORn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::rora_instr; + break; + + case RORz: case RORzx: case RORa: case RORax: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::ror_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case RRAa: case RRAax: case RRAay: case RRAz: case RRAzx: case RRAix: + case RRAiy: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::rra_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case RTIn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PopSR; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PopLowPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PopHighPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::rti_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case RTSn: +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PopLowPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PopHighPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::rts_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case SAXz: case SAXzy: case SAXa: case SAXix: // Also known as AXS + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::axs_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + break; + + case SBCz: case SBCzx: case SBCa: case SBCax: case SBCay: case SBCix: + case SBCiy: case SBCb_: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::sbc_instr; + break; + + case SBXb: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::sbx_instr; + break; + + case SECn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::sec_instr; + break; + + case SEDn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::sed_instr; + break; + + case SEIn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::sei_instr; + break; + + case SHAay: case SHAiy: // Also known as AXA + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::axa_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case SHSay: // Also known as TAS + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::shs_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + break; + + case SHXay: // Also known as XAS + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::xas_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + break; + + case SHYax: // Also known as SAY + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::say_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + break; + + case SLOz: case SLOzx: case SLOa: case SLOax: case SLOay: case SLOix: + case SLOiy: // Also known as ASO + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::aso_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case SREz: case SREzx: case SREa: case SREax: case SREay: case SREix: + case SREiy: // Also known as LSE + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::lse_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PutEffAddrDataByte; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case STAz: case STAzx: case STAa: case STAax: case STAay: case STAix: + case STAiy: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::sta_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case STXz: case STXzy: case STXa: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::stx_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case STYz: case STYzx: case STYa: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::sty_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + break; + + case TAXn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::tax_instr; + break; + + case TAYn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::tay_instr; + break; + + case TSXn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::tsx_instr; + break; + + case TXAn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::txa_instr; + break; + + case TXSn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::txs_instr; + break; + + case TYAn: + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::tya_instr; + break; + + default: + legalInstr = false; + break; + } + + if (!(legalMode || legalInstr)) + { + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::illegal_instr; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + } + else if (!(legalMode && legalInstr)) + { + printf ("\nInstruction 0x%x: Not built correctly.\n\n", i); + exit(1); + } + + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::NextInstr; + cycleCount++; + if (!pass) + { // Pass 1 - Allocate Memory + if (cycleCount) + { +#if defined(_MSC_VER) && (_MSC_VER <= _MSC_VER_BAD_NEW) + typedef void (MOS6510::*ptr2cycle) (void); + instr->cycle = (ptr2cycle*) new char[sizeof (ptr2cycle) *cycleCount]; +#else +# ifdef HAVE_EXCEPTIONS + instr->cycle = new(std::nothrow) (void (MOS6510::*[cycleCount]) (void)); +# else + instr->cycle = new (void (MOS6510::*[cycleCount]) (void)); +# endif +#endif // _MSC_VER + if (!instr->cycle) + goto MOS6510_MemAllocFailed; + } + } + else + instr->opcode = i; + +#if MOS6510_DEBUG > 1 + printf ("."); +#endif + } + + instr->cycles = cycleCount; +#if MOS6510_DEBUG > 1 + printf ("Done [%d Cycles]\n", cycleCount); +#endif + } + + //---------------------------------------------------------------------- + // Build interrupts + for (i = 0; i < 3; i++) + { +#if MOS6510_DEBUG > 1 + printf ("Building Interrupt %d[%02x]..", i, i); +#endif + + // Pass 1 allocates the memory, Pass 2 builds the interrupt + instr = &interruptTable[i]; + instr->cycle = NULL; + instr->opcode = 0; + + for (int pass = 0; pass < 2; pass++) + { + cycleCount = -1; + if (pass) procCycle = instr->cycle; + + switch (i) + { + case oRST: +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::RSTRequest; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchOpcode; + break; + + case oNMI: +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushHighPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushLowPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::IRQRequest; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::NMIRequest; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::NMI1Request; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchOpcode; + break; + + case oIRQ: +#ifdef MOS6510_ACCURATE_CYCLES + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::WasteCycle; +#endif + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushHighPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::PushLowPC; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::IRQRequest; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::IRQ1Request; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::IRQ2Request; + cycleCount++; if (pass) procCycle[cycleCount] = &MOS6510::FetchOpcode; + break; + } + + cycleCount++; + if (!pass) + { // Pass 1 - Allocate Memory + if (cycleCount) + { +#if defined(_MSC_VER) && (_MSC_VER <= _MSC_VER_BAD_NEW) + typedef void (MOS6510::*ptr2cycle) (void); + instr->cycle = (ptr2cycle*) new char[sizeof (ptr2cycle) *cycleCount]; +#else +# ifdef HAVE_EXCEPTIONS + instr->cycle = new(std::nothrow) (void (MOS6510::*[cycleCount]) (void)); +# else + instr->cycle = new (void (MOS6510::*[cycleCount]) (void)); +# endif +#endif // _MSC_VER + if (!instr->cycle) + goto MOS6510_MemAllocFailed; + } + } + +#if MOS6510_DEBUG > 1 + printf ("."); +#endif + } + + instr->cycles = cycleCount; +#if MOS6510_DEBUG > 1 + printf ("Done [%d Cycles]\n", cycleCount); +#endif + } + + // Intialise Processor Registers + Register_Accumulator = 0; + Register_X = 0; + Register_Y = 0; + + Cycle_EffectiveAddress = 0; + Cycle_Data = 0; + fetchCycle[0] = &MOS6510::NextInstr; + + dodump = false; + Initialise (); +return; + +MOS6510_MemAllocFailed: + printf ("Unable to allocate enough memory.\n\n"); +exit (-1); +} + +MOS6510::~MOS6510 () +{ + struct ProcessorOperations *instr; + uint i; + + // Remove Opcodes + for (i = 0; i < 0x100; i++) + { + instr = &instrTable[i]; + if (instr->cycle != NULL) delete [] instr->cycle; + } + + // Remove Interrupts + for (i = 0; i < 3; i++) + { + instr = &interruptTable[i]; + if (instr->cycle != NULL) delete [] instr->cycle; + } +} + + +//-------------------------------------------------------------------------// +// Initialise CPU Emulation (Registers) // +void MOS6510::Initialise (void) +{ + // Reset stack + Register_StackPointer = endian_16 (SP_PAGE, 0xFF); + + // Reset Cycle Count + cycleCount = 0; + procCycle = fetchCycle; + + // Reset Status Register + Register_Status = (1 << SR_NOTUSED) | (1 << SR_BREAK); + // FLAGS are set from data directly and do not require + // being calculated first before setting. E.g. if you used + // SetFlags (0), N flag would = 0, and Z flag would = 1. + setFlagsNZ (1); + setFlagC (false); + setFlagV (false); + + // Set PC to some value + Register_ProgramCounter = 0; + // IRQs pending check + interrupts.irqLatch = false; + interrupts.irqRequest = false; + if (interrupts.irqs) + interrupts.irqRequest = true; + + // Signals + aec = true; + rdy = true; + + m_blocked = false; + eventContext.schedule (this, 1); +} + +//-------------------------------------------------------------------------// +// Reset CPU Emulation // +void MOS6510::reset (void) +{ + // Reset Interrupts + interrupts.pending = false; + interrupts.irqs = 0; + interrupts.delay = MOS6510_INTERRUPT_DELAY; + + // Internal Stuff + Initialise (); + + // Requires External Bits + // Read from reset vector for program entry point + endian_16lo8 (Cycle_EffectiveAddress, envReadMemDataByte (0xFFFC)); + endian_16hi8 (Cycle_EffectiveAddress, envReadMemDataByte (0xFFFD)); + Register_ProgramCounter = Cycle_EffectiveAddress; +// filepos = 0; +} + +//-------------------------------------------------------------------------// +// Module Credits // +void MOS6510::credits (char *sbuffer) +{ // Copy credits to buffer + sprintf (sbuffer, "%sModule : MOS6510 Cycle Exact Emulation\n", sbuffer); + sprintf (sbuffer, "%sWritten By : %s\n", sbuffer, MOS6510_AUTHOR); + sprintf (sbuffer, "%sVersion : %s\n", sbuffer, MOS6510_VERSION); + sprintf (sbuffer, "%sReleased : %s\n", sbuffer, MOS6510_DATE); + sprintf (sbuffer, "%sEmail : %s\n", sbuffer, MOS6510_EMAIL); +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/sid6510c.h b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/sid6510c.h new file mode 100644 index 00000000..49d96dd6 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/sid6510c.h @@ -0,0 +1,118 @@ +/*************************************************************************** + sid6510c.h - Special MOS6510 to be fully + compatible with sidplay + ------------------- + begin : Thu May 11 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sid6510c.h,v $ + * Revision 1.16 2002/11/25 21:07:32 s_a_white + * Allow setting of program counter on reset. + * + * Revision 1.15 2002/11/21 19:52:48 s_a_white + * CPU upgraded to be like other components. Theres nolonger a clock call, + * instead events are registered to occur at a specific time. + * + * Revision 1.14 2002/11/19 22:56:25 s_a_white + * Sidplay1 modes modified to make them nolonger require the psid driver. + * + * Revision 1.13 2002/11/01 17:35:27 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.12 2002/03/12 18:47:13 s_a_white + * Made IRQ in sidplay1 compatibility modes behaves like JSR. This fixes tunes + * that have kernel switched out. + * + * Revision 1.11 2002/02/07 18:02:10 s_a_white + * Real C64 compatibility fixes. Debug of BRK works again. Fixed illegal + * instructions to work like sidplay1. + * + * Revision 1.10 2002/02/04 23:53:23 s_a_white + * Improved compatibilty of older sidplay1 modes. Fixed BRK to work like sidplay1 + * only when stack is 0xff in real mode for better compatibility with C64. + * + * Revision 1.9 2001/09/01 11:08:06 s_a_white + * Fixes for sidplay1 environment modes. + * + * Revision 1.8 2001/07/14 13:18:15 s_a_white + * Stack & PC invalid tests now only performed on a BRK. + * + * Revision 1.7 2001/03/24 18:09:17 s_a_white + * On entry to interrupt routine the first instruction in the handler is now always + * executed before pending interrupts are re-checked. + * + * Revision 1.6 2001/03/22 22:40:07 s_a_white + * Replaced tabs characters. + * + * Revision 1.5 2001/03/21 22:26:13 s_a_white + * Fake interrupts now been moved into here from player.cpp. At anytime it's + * now possible to ditch this compatibility class and use the real thing. + * + * Revision 1.4 2001/03/09 22:28:03 s_a_white + * Speed optimisation update. + * + * Revision 1.3 2001/02/13 21:02:25 s_a_white + * Small tidy up and possibly a small performace increase. + * + * Revision 1.2 2000/12/11 19:04:32 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#ifndef _sid6510c_h_ +#define _sid6510c_h_ + +#include "mos6510c.h" +#include "sid2types.h" + +class SID6510: public MOS6510 +{ +private: + // Sidplay Specials + bool m_sleeping; + sid2_env_t m_mode; + event_clock_t m_delayClk, m_delayCycles; + bool m_framelock; + +public: + SID6510 (EventContext *context); + + // Standard Functions + void reset (void); + void reset (uint_least16_t pc, uint8_t a, uint8_t x, uint8_t y); + void clock (void); + + void environment (sid2_env_t mode) { m_mode = mode; } + void triggerRST (void); + void triggerNMI (void); + void triggerIRQ (void); + void sleep (void); + +protected: + void FetchOpcode (void); + +private: + void (MOS6510::*delayCycle[1]) (void); + + inline void sid_illegal (void); + inline void sid_delay (void); + inline void sid_brk (void); + inline void sid_jmp (void); + inline void sid_rts (void); + inline void sid_cli (void); + inline void sid_rti (void); + inline void sid_irq (void); +}; + +#endif // _sid6510c_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/sid6510c.i b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/sid6510c.i new file mode 100644 index 00000000..bc573d3b --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/cycle_based/sid6510c.i @@ -0,0 +1,409 @@ +/*************************************************************************** + sid6510c.i - Sidplay Specific 6510 emulation + ------------------- + begin : Thu May 11 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sid6510c.i,v $ + * Revision 1.28 2002/12/03 23:24:52 s_a_white + * Let environment know when cpu sleeps in real c64 mode. + * + * Revision 1.27 2002/12/02 22:19:43 s_a_white + * sid_brk fix to prevent it running some of the real brk cycles in old emulation + * modes. + * + * Revision 1.26 2002/11/25 21:07:34 s_a_white + * Allow setting of program counter on reset. + * + * Revision 1.25 2002/11/21 19:52:48 s_a_white + * CPU upgraded to be like other components. Theres nolonger a clock call, + * instead events are registered to occur at a specific time. + * + * Revision 1.24 2002/11/19 22:56:25 s_a_white + * Sidplay1 modes modified to make them nolonger require the psid driver. + * + * Revision 1.23 2002/11/01 17:35:27 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.22 2002/10/15 23:52:14 s_a_white + * Fix sidplay2 cpu sleep optimisation and NMIs. + * + * Revision 1.21 2002/09/23 22:50:55 s_a_white + * Reverted update 1.20 as was incorrect. Only need to + * change MOS6510 to SID6510 for compliancy. + * + * Revision 1.20 2002/09/23 19:42:14 s_a_white + * Newer compilers don't allow pointers to be taken directly + * from base class member functions. + * + * Revision 1.19 2002/03/12 18:47:13 s_a_white + * Made IRQ in sidplay1 compatibility modes behaves like JSR. This fixes tunes + * that have kernel switched out. + * + * Revision 1.18 2002/02/07 18:02:10 s_a_white + * Real C64 compatibility fixes. Debug of BRK works again. Fixed illegal + * instructions to work like sidplay1. + * + * Revision 1.17 2002/02/06 17:49:12 s_a_white + * Fixed sign comparison warning. + * + * Revision 1.16 2002/02/04 23:53:23 s_a_white + * Improved compatibilty of older sidplay1 modes. Fixed BRK to work like sidplay1 + * only when stack is 0xff in real mode for better compatibility with C64. + * + * Revision 1.15 2002/01/28 19:32:16 s_a_white + * PSID sample improvements. + * + * Revision 1.14 2001/10/02 18:00:37 s_a_white + * Removed un-necessary cli. + * + * Revision 1.13 2001/09/18 07:51:39 jpaana + * Small fix to rti-processing. + * + * Revision 1.12 2001/09/03 22:23:06 s_a_white + * Fixed faked IRQ trigger on BRK for sidplay1 environment modes. + * + * Revision 1.11 2001/09/01 11:08:06 s_a_white + * Fixes for sidplay1 environment modes. + * + * Revision 1.10 2001/08/05 15:46:02 s_a_white + * No longer need to check on which cycle an instruction ends or when to print + * debug information. + * + * Revision 1.9 2001/07/14 13:17:40 s_a_white + * Sidplay1 optimisations moved to here. Stack & PC invalid tests now only + * performed on a BRK. + * + * Revision 1.8 2001/03/24 18:09:17 s_a_white + * On entry to interrupt routine the first instruction in the handler is now always + * executed before pending interrupts are re-checked. + * + * Revision 1.7 2001/03/22 22:40:07 s_a_white + * Replaced tabs characters. + * + * Revision 1.6 2001/03/21 22:26:24 s_a_white + * Fake interrupts now been moved into here from player.cpp. At anytime it's + * now possible to ditch this compatibility class and use the real thing. + * + * Revision 1.5 2001/03/09 22:28:03 s_a_white + * Speed optimisation update. + * + * Revision 1.4 2001/02/13 21:02:16 s_a_white + * Small tidy up and possibly a small performace increase. + * + * Revision 1.3 2000/12/11 19:04:32 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#include "sid6510c.h" + + +SID6510::SID6510 (EventContext *context) +:MOS6510(context), + m_mode(sid2_envR), + m_framelock(false) +{ // Ok start all the hacks for sidplay. This prevents + // execution of code in roms. For real c64 emulation + // create object from base class! Also stops code + // rom execution when bad code switches roms in over + // itself. + for (uint i = 0; i < OPCODE_MAX; i++) + { + procCycle = instrTable[i].cycle; + if (procCycle == NULL) continue; + + for (uint n = 0; n < instrTable[i].cycles; n++) + { + if (procCycle[n] == &SID6510::illegal_instr) + { // Rev 1.2 (saw) - Changed nasty union to reinterpret_cast + procCycle[n] = reinterpret_cast <void (MOS6510::*)()> + (&SID6510::sid_illegal); + } + else if (procCycle[n] == &SID6510::jmp_instr) + { // Stop jumps into rom code + procCycle[n] = reinterpret_cast <void (MOS6510::*)()> + (&SID6510::sid_jmp); + } + else if (procCycle[n] == &SID6510::cli_instr) + { // No overlapping IRQs allowed + procCycle[n] = reinterpret_cast <void (MOS6510::*)()> + (&SID6510::sid_cli); + } + } + } + + { // Since no real IRQs, all RTIs mapped to RTS + // Required for fix bad tunes in old modes + uint n; + procCycle = instrTable[RTIn].cycle; + for (n = 0; n < instrTable[RTIn].cycles; n++) + { + if (procCycle[n] == &SID6510::PopSR) + { + procCycle[n] = reinterpret_cast <void (MOS6510::*)()> + (&SID6510::sid_rti); + break; + } + } + + procCycle = interruptTable[oIRQ].cycle; + for (n = 0; n < interruptTable[oIRQ].cycles; n++) + { + if (procCycle[n] == &SID6510::IRQRequest) + { + procCycle[n] = reinterpret_cast <void (MOS6510::*)()> + (&SID6510::sid_irq); + break; + } + } + } + + { // Support of sidplays BRK functionality + procCycle = instrTable[BRKn].cycle; + for (uint n = 0; n < instrTable[BRKn].cycles; n++) + { + if (procCycle[n] == &SID6510::PushHighPC) + { + procCycle[n] = reinterpret_cast <void (MOS6510::*)()> + (&SID6510::sid_brk); + break; + } + } + } + + // Used to insert busy delays into the CPU emulation + delayCycle[0] = reinterpret_cast <void (MOS6510::*)()> + (&SID6510::sid_delay); +} + +void SID6510::reset (uint_least16_t pc, uint8_t a, uint8_t x, uint8_t y) +{ // Reset the processor + reset (); + + // Registers not touched by a reset + Register_Accumulator = a; + Register_X = x; + Register_Y = y; + Register_ProgramCounter = pc; +} + +void SID6510::reset () +{ + m_sleeping = false; + // Call inherited reset + MOS6510::reset (); +} + +// Send CPU is about to sleep. Only a reset or +// interrupt will wake up the processor +void SID6510::sleep () +{ // Simulate a delay for JMPw + m_delayClk = eventContext.getTime (); + m_sleeping = true; + procCycle = delayCycle; + cycleCount = 0; + eventContext.cancel (this); + envSleep (); + + // Check for outstanding interrupts + if (interrupts.irqs) + { + interrupts.irqs--; + triggerIRQ (); + } + else if (interrupts.pending) + { + m_sleeping = false; + eventContext.schedule (this, 1); + } +} + +void SID6510::FetchOpcode (void) +{ + if (m_mode == sid2_envR) + { + MOS6510::FetchOpcode (); + return; + } + + // Sid tunes end by wrapping the stack. For compatibilty it + // has to be handled. + m_sleeping |= (endian_16hi8 (Register_StackPointer) != SP_PAGE); + m_sleeping |= (endian_32hi16 (Register_ProgramCounter) != 0); + if (!m_sleeping) + MOS6510::FetchOpcode (); + + if (m_framelock == false) + { + m_framelock = true; + // Simulate sidplay1 frame based execution + while (!m_sleeping) + MOS6510::clock (); + sleep (); + m_framelock = false; + } +} + + +//************************************************************************************** +// For sidplay compatibility implement those instructions which don't behave properly. +//************************************************************************************** +void SID6510::sid_brk (void) +{ + if (m_mode == sid2_envR) + { + MOS6510::PushHighPC (); + return; + } + + sei_instr (); +#if !defined(NO_RTS_UPON_BRK) + sid_rts (); +#endif + FetchOpcode (); +} + +void SID6510::sid_jmp (void) +{ // For sidplay compatibility, inherited from environment + if (m_mode == sid2_envR) + { // If a busy loop then just sleep + if (Cycle_EffectiveAddress != instrStartPC) + jmp_instr (); + else + { + Register_ProgramCounter = Cycle_EffectiveAddress; + sleep (); + } + return; + } + + if (envCheckBankJump (Cycle_EffectiveAddress)) + jmp_instr (); + else + sid_rts (); +} + +// Will do a full rts in 1 cycle, to +// destroy current function and quit +void SID6510::sid_rts (void) +{ + PopLowPC(); + PopHighPC(); + rts_instr(); +} + +void SID6510::sid_cli (void) +{ + if (m_mode == sid2_envR) + cli_instr (); +} + +void SID6510::sid_rti (void) +{ + if (m_mode == sid2_envR) + { + PopSR (); + return; + } + + // Fake RTS + sid_rts (); + FetchOpcode (); +} + +void SID6510::sid_irq (void) +{ + MOS6510::IRQRequest (); + if (m_mode != sid2_envR) + { // RTI behaves like RTI in sidplay1 modes + Register_StackPointer++; + } +} + +// Sidplay Suppresses Illegal Instructions +void SID6510::sid_illegal (void) +{ + if (m_mode == sid2_envR) + { + MOS6510::illegal_instr (); + return; + } +#ifdef MOS6510_DEBUG + DumpState (); +#endif +} + +void SID6510::sid_delay (void) +{ + cycleCount = 0; + if (++m_delayCycles >= 3) + { + (void) interruptPending (); + m_delayCycles = 0; + } +} + + +//************************************************************************************** +// Sidplay compatibility interrupts. Basically wakes CPU if it is m_sleeping +//************************************************************************************** +void SID6510::triggerRST (void) +{ // All modes + MOS6510::triggerRST (); + if (m_sleeping) + { + m_sleeping = false; + eventContext.schedule (this, 1); + } +} + +void SID6510::triggerNMI (void) +{ // Only in Real C64 mode + if (m_mode == sid2_envR) + { + MOS6510::triggerNMI (); + if (m_sleeping) + { + m_delayCycles = eventContext.getTime (m_delayClk) % 3; + m_sleeping = false; + eventContext.schedule (this, 1); + } + } +} + +void SID6510::triggerIRQ (void) +{ + switch (m_mode) + { + default: +#ifdef MOS6510_DEBUG + if (dodump) + { + printf ("****************************************************\n"); + printf (" Fake IRQ Routine\n"); + printf ("****************************************************\n"); + } +#endif + return; + case sid2_envR: + MOS6510::triggerIRQ (); + if (m_sleeping) + { // Simulate busy loop + m_delayCycles = eventContext.getTime (m_delayClk) % 3; + m_sleeping = false; + eventContext.schedule (this, 1); + } + } +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/mos6510.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/mos6510.cpp new file mode 100644 index 00000000..74b09c95 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/mos6510.cpp @@ -0,0 +1,534 @@ +/*************************************************************************** + main.cpp - description + ------------------- + begin : Thu May 11 06:22:40 BST 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: mos6510.cpp,v $ + * Revision 1.8 2001/08/05 15:46:38 s_a_white + * No longer need to check on which cycle to print debug information. + * + * Revision 1.7 2001/07/14 13:04:34 s_a_white + * Accumulator is now unsigned, which improves code readability. + * + * Revision 1.6 2001/03/09 22:27:46 s_a_white + * Speed optimisation update. + * + * Revision 1.5 2001/02/13 23:01:10 s_a_white + * envReadMemDataByte now used for debugging. + * + * Revision 1.4 2000/12/11 19:03:16 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include "sidtypes.h" +#include "sidendian.h" +#include "sidenv.h" +#include "conf6510.h" +#include "opcodes.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif + +#ifdef MOS6510_STATE_6510 +# include "state6510.h" +# include "state6510.cpp" +#else + +#include "mos6510.h" + +// Check to see what type of emulation is required +#ifdef MOS6510_CYCLE_BASED +# include "cycle_based/mos6510c.i" + +# ifdef MOS6510_SIDPLAY + // Compile in sidplay code +# include "cycle_based/sid6510c.i" +# endif // MOS6510_SIDPLAY +#else + // Line based emulation code has not been provided +#endif // MOS6510_CYCLE_BASED + +void MOS6510::DumpState (void) +{ + uint8_t opcode, data; + uint_least16_t operand, address; + + printf(" PC I A X Y SP DR PR NV-BDIZC Instruction\n"); + printf("%04x ", instrStartPC); + printf("%u ", interrupts.irqs); + printf("%02x ", Register_Accumulator); + printf("%02x ", Register_X); + printf("%02x ", Register_Y); + printf("01%02x ", endian_16lo8 (Register_StackPointer)); + printf("%02x ", envReadMemDataByte (0)); + printf("%02x ", envReadMemDataByte (1)); + + if (getFlagN()) printf ("1"); else printf ("0"); + if (getFlagV()) printf ("1"); else printf ("0"); + if (Register_Status & (1 << SR_NOTUSED)) printf ("1"); else printf ("0"); + if (Register_Status & (1 << SR_BREAK)) printf ("1"); else printf ("0"); + if (getFlagD()) printf ("1"); else printf ("0"); + if (getFlagI()) printf ("1"); else printf ("0"); + if (getFlagZ()) printf ("1"); else printf ("0"); + if (getFlagC()) printf ("1"); else printf ("0"); + + opcode = instrOpcode; + operand = Instr_Operand; + data = Cycle_Data; + + switch (opcode) + { + case BCCr: case BCSr: case BEQr: case BMIr: case BNEr: case BPLr: + case BVCr: case BVSr: + address = (uint_least16_t) (Register_ProgramCounter + (int8_t) operand); + break; + + default: + address = Cycle_EffectiveAddress; + break; + } + + printf(" %02x ", opcode); + + switch(opcode) + { + //Accumulator or Implied addressing + case ASLn: case LSRn: case ROLn: case RORn: + printf(" "); + break; + //Zero Page Addressing Mode Handler + case ADCz: case ANDz: case ASLz: case BITz: case CMPz: case CPXz: + case CPYz: case DCPz: case DECz: case EORz: case INCz: case ISBz: + case LAXz: case LDAz: case LDXz: case LDYz: case LSRz: case NOPz_: + case ORAz: case ROLz: case RORz: case SAXz: case SBCz: case SREz: + case STAz: case STXz: case STYz: case SLOz: case RLAz: case RRAz: + //ASOz AXSz DCMz INSz LSEz - Optional Opcode Names + printf("%02x ", (uint8_t) operand); + break; + //Zero Page with X Offset Addressing Mode Handler + case ADCzx: case ANDzx: case ASLzx: case CMPzx: case DCPzx: case DECzx: + case EORzx: case INCzx: case ISBzx: case LDAzx: case LDYzx: case LSRzx: + case NOPzx_: case ORAzx: case RLAzx: case ROLzx: case RORzx: case RRAzx: + case SBCzx: case SLOzx: case SREzx: case STAzx: case STYzx: + //ASOzx DCMzx INSzx LSEzx - Optional Opcode Names + printf("%02x ", (uint8_t) operand); + break; + //Zero Page with Y Offset Addressing Mode Handler + case LDXzy: case STXzy: case SAXzy: case LAXzy: + //AXSzx - Optional Opcode Names + printf("%02x ", endian_16lo8 (operand)); + break; + //Absolute Addressing Mode Handler + case ADCa: case ANDa: case ASLa: case BITa: case CMPa: case CPXa: + case CPYa: case DCPa: case DECa: case EORa: case INCa: case ISBa: + case JMPw: case JSRw: case LAXa: case LDAa: case LDXa: case LDYa: + case LSRa: case NOPa: case ORAa: case ROLa: case RORa: case SAXa: + case SBCa: case SLOa: case SREa: case STAa: case STXa: case STYa: + case RLAa: case RRAa: + //ASOa AXSa DCMa INSa LSEa - Optional Opcode Names + printf("%02x %02x ", endian_16lo8 (operand), endian_16hi8 (operand)); + break; + //Absolute With X Offset Addresing Mode Handler + case ADCax: case ANDax: case ASLax: case CMPax: case DCPax: case DECax: + case EORax: case INCax: case ISBax: case LDAax: case LDYax: case LSRax: + case NOPax_: case ORAax: case RLAax: case ROLax: case RORax: case RRAax: + case SBCax: case SHYax: case SLOax: case SREax: case STAax: + //ASOax DCMax INSax LSEax SAYax - Optional Opcode Names + printf("%02x %02x ", endian_16lo8 (operand), endian_16hi8 (operand)); + break; + //Absolute With Y Offset Addresing Mode Handler + case ADCay: case ANDay: case CMPay: case DCPay: case EORay: case ISBay: + case LASay: case LAXay: case LDAay: case LDXay: case ORAay: case RLAay: + case RRAay: case SBCay: case SHAay: case SHSay: case SHXay: case SLOay: + case SREay: case STAay: + //ASOay AXAay DCMay INSax LSEay TASay XASay - Optional Opcode Names + printf("%02x %02x ", endian_16lo8 (operand), endian_16hi8 (operand)); + break; + //Immediate and Relative Addressing Mode Handler + case ADCb: case ANDb: case ANCb_: case ANEb: case ASRb: case ARRb: + + case CMPb: case CPXb: case CPYb: case EORb: case LDAb: case LDXb: + case LDYb: case LXAb: case NOPb_: case ORAb: case SBCb_: case SBXb: + //OALb ALRb XAAb - Optional Opcode Names + printf("%02x ", endian_16lo8 (operand)); + break; + case BCCr: case BCSr: case BEQr: case BMIr: case BNEr: case BPLr: + case BVCr: case BVSr: + printf("%02x ", endian_16lo8 (operand)); + break; + //Indirect Addressing Mode Handler + case JMPi: + printf("%02x %02x ", endian_16lo8 (operand), endian_16hi8 (operand)); + break; + //Indexed with X Preinc Addressing Mode Handler + case ADCix: case ANDix: case CMPix: case DCPix: case EORix: case ISBix: + case LAXix: case LDAix: case ORAix: case SAXix: case SBCix: case SLOix: + case SREix: case STAix: case RLAix: case RRAix: + //ASOix AXSix DCMix INSix LSEix - Optional Opcode Names + printf("%02x ", endian_16lo8 (operand)); + break; + //Indexed with Y Postinc Addressing Mode Handler + case ADCiy: case ANDiy: case CMPiy: case DCPiy: case EORiy: case ISBiy: + case LAXiy: case LDAiy: case ORAiy: case RLAiy: case RRAiy: case SBCiy: + case SHAiy: case SLOiy: case SREiy: case STAiy: + //AXAiy ASOiy LSEiy DCMiy INSiy - Optional Opcode Names + printf("%02x ", endian_16lo8 (operand)); + break; + default: + printf(" "); + break; + } + + switch(opcode) + { + case ADCb: case ADCz: case ADCzx: case ADCa: case ADCax: case ADCay: + case ADCix: case ADCiy: + printf(" ADC"); break; + case ANCb_: + printf("*ANC"); break; + case ANDb: case ANDz: case ANDzx: case ANDa: case ANDax: case ANDay: + case ANDix: case ANDiy: + printf(" AND"); break; + case ANEb: //Also known as XAA + printf("*ANE"); break; + case ARRb: + printf("*ARR"); break; + case ASLn: case ASLz: case ASLzx: case ASLa: case ASLax: + printf(" ASL"); break; + case ASRb: //Also known as ALR + printf("*ASR"); break; + case BCCr: + printf(" BCC"); break; + case BCSr: + printf(" BCS"); break; + case BEQr: + printf(" BEQ"); break; + case BITz: case BITa: + printf(" BIT"); break; + case BMIr: + printf(" BMI"); break; + case BNEr: + printf(" BNE"); break; + case BPLr: + printf(" BPL"); break; + case BRKn: + printf(" BRK"); break; + case BVCr: + printf(" BVC"); break; + case BVSr: + printf(" BVS"); break; + case CLCn: + printf(" CLC"); break; + case CLDn: + printf(" CLD"); break; + case CLIn: + printf(" CLI"); break; + case CLVn: + printf(" CLV"); break; + case CMPb: case CMPz: case CMPzx: case CMPa: case CMPax: case CMPay: + case CMPix: case CMPiy: + printf(" CMP"); break; + case CPXb: case CPXz: case CPXa: + printf(" CPX"); break; + case CPYb: case CPYz: case CPYa: + printf(" CPY"); break; + case DCPz: case DCPzx: case DCPa: case DCPax: case DCPay: case DCPix: + case DCPiy: //Also known as DCM + printf("*DCP"); break; + case DECz: case DECzx: case DECa: case DECax: + printf(" DEC"); break; + case DEXn: + printf(" DEX"); break; + case DEYn: + printf(" DEY"); break; + case EORb: case EORz: case EORzx: case EORa: case EORax: case EORay: + case EORix: case EORiy: + printf(" EOR"); break; + case INCz: case INCzx: case INCa: case INCax: + printf(" INC"); break; + case INXn: + printf(" INX"); break; + case INYn: + printf(" INY"); break; + case ISBz: case ISBzx: case ISBa: case ISBax: case ISBay: case ISBix: + case ISBiy: //Also known as INS + printf("*ISB"); break; + case JMPw: case JMPi: + printf(" JMP"); break; + case JSRw: + printf(" JSR"); break; + case LASay: + printf("*LAS"); break; + case LAXz: case LAXzy: case LAXa: case LAXay: case LAXix: case LAXiy: + printf("*LAX"); break; + case LDAb: case LDAz: case LDAzx: case LDAa: case LDAax: case LDAay: + case LDAix: case LDAiy: + printf(" LDA"); break; + case LDXb: case LDXz: case LDXzy: case LDXa: case LDXay: + printf(" LDX"); break; + case LDYb: case LDYz: case LDYzx: case LDYa: case LDYax: + printf(" LDY"); break; + case LSRz: case LSRzx: case LSRa: case LSRax: case LSRn: + printf(" LSR"); break; + case NOPn_: case NOPb_: case NOPz_: case NOPzx_: case NOPa: case NOPax_: + if(opcode != NOPn) printf("*"); + else printf(" "); + printf("NOP"); break; + case LXAb: //Also known as OAL + printf("*LXA"); break; + case ORAb: case ORAz: case ORAzx: case ORAa: case ORAax: case ORAay: + case ORAix: case ORAiy: + printf(" ORA"); break; + case PHAn: + printf(" PHA"); break; + case PHPn: + printf(" PHP"); break; + case PLAn: + printf(" PLA"); break; + case PLPn: + printf(" PLP"); break; + case RLAz: case RLAzx: case RLAix: case RLAa: case RLAax: case RLAay: + case RLAiy: + printf("*RLA"); break; + case ROLz: case ROLzx: case ROLa: case ROLax: case ROLn: + printf(" ROL"); break; + case RORz: case RORzx: case RORa: case RORax: case RORn: + printf(" ROR"); break; + case RRAa: case RRAax: case RRAay: case RRAz: case RRAzx: case RRAix: + case RRAiy: + printf("*RRA"); break; + case RTIn: + printf(" RTI"); break; + case RTSn: + printf(" RTS"); break; + case SAXz: case SAXzy: case SAXa: case SAXix: //Also known as AXS + printf("*SAX"); break; + case SBCb_: + if(opcode != SBCb) printf("*"); + else printf(" "); + printf ("SBC"); break; + case SBCz: case SBCzx: case SBCa: case SBCax: case SBCay: case SBCix: + case SBCiy: + printf(" SBC"); break; + case SBXb: + printf("*SBX"); break; + case SECn: + printf(" SEC"); break; + case SEDn: + printf(" SED"); break; + case SEIn: + printf(" SEI"); break; + case SHAay: case SHAiy: //Also known as AXA + printf("*SHA"); break; + case SHSay: //Also known as TAS + printf("*SHS"); break; + case SHXay: //Also known as XAS + printf("*SHX"); break; + case SHYax: //Also known as SAY + printf("*SHY"); break; + case SLOz: case SLOzx: case SLOa: case SLOax: case SLOay: case SLOix: + case SLOiy: //Also known as ASO + printf("*SLO"); break; + case SREz: case SREzx: case SREa: case SREax: case SREay: case SREix: + case SREiy: //Also known as LSE + printf("*SRE"); break; + case STAz: case STAzx: case STAa: case STAax: case STAay: case STAix: + case STAiy: + printf(" STA"); break; + case STXz: case STXzy: case STXa: + printf(" STX"); break; + case STYz: case STYzx: case STYa: + printf(" STY"); break; + case TAXn: + printf(" TAX"); break; + case TAYn: + printf(" TAY"); break; + case TSXn: + printf(" TSX"); break; + case TXAn: + printf(" TXA"); break; + case TXSn: + printf(" TXS"); break; + case TYAn: + printf(" TYA"); break; + default: + printf("*HLT"); break; + } + + switch(opcode) + { + //Accumulator or Implied addressing + case ASLn: case LSRn: case ROLn: case RORn: + printf("n A"); + break; + + //Zero Page Addressing Mode Handler + case ADCz: case ANDz: case ASLz: case BITz: case CMPz: case CPXz: + case CPYz: case DCPz: case DECz: case EORz: case INCz: case ISBz: + case LAXz: case LDAz: case LDXz: case LDYz: case LSRz: case ORAz: + + case ROLz: case RORz: case SBCz: case SREz: case SLOz: case RLAz: + case RRAz: + //ASOz AXSz DCMz INSz LSEz - Optional Opcode Names + printf("z %02x {%02x}", (uint8_t) operand, data); + break; + case SAXz: case STAz: case STXz: case STYz: +#ifdef MOS6510_DEBUG + case NOPz_: +#endif + printf("z %02x", endian_16lo8 (operand)); + break; + + //Zero Page with X Offset Addressing Mode Handler + case ADCzx: case ANDzx: case ASLzx: case CMPzx: case DCPzx: case DECzx: + case EORzx: case INCzx: case ISBzx: case LDAzx: case LDYzx: case LSRzx: + case ORAzx: case RLAzx: case ROLzx: case RORzx: case RRAzx: case SBCzx: + case SLOzx: case SREzx: + //ASOzx DCMzx INSzx LSEzx - Optional Opcode Names + printf("zx %02x,X", endian_16lo8 (operand)); + printf(" [%04x]{%02x}", address, data); + break; + case STAzx: case STYzx: +#ifdef MOS6510_DEBUG + case NOPzx_: +#endif + printf("zx %02x,X", endian_16lo8 (operand)); + printf(" [%04x]", address); + break; + + //Zero Page with Y Offset Addressing Mode Handler + case LAXzy: case LDXzy: + //AXSzx - Optional Opcode Names + printf("zy %02x,Y", endian_16lo8 (operand)); + printf(" [%04x]{%02x}", address, data); + break; + case STXzy: case SAXzy: + printf("zy %02x,Y", endian_16lo8 (operand)); + printf(" [%04x]", address); + break; + + //Absolute Addressing Mode Handler + case ADCa: case ANDa: case ASLa: case BITa: case CMPa: case CPXa: + case CPYa: case DCPa: case DECa: case EORa: case INCa: case ISBa: + case LAXa: case LDAa: case LDXa: case LDYa: case LSRa: case ORAa: + case ROLa: case RORa: case SBCa: case SLOa: case SREa: case RLAa: + case RRAa: + //ASOa AXSa DCMa INSa LSEa - Optional Opcode Names + printf("a %04x {%02x}", operand, data); + break; + case SAXa: case STAa: case STXa: case STYa: +#ifdef MOS6510_DEBUG + case NOPa: +#endif + printf("a %04x", operand); + break; + case JMPw: case JSRw: + printf("w %04x", operand); + break; + + //Absolute With X Offset Addresing Mode Handler + case ADCax: case ANDax: case ASLax: case CMPax: case DCPax: case DECax: + case EORax: case INCax: case ISBax: case LDAax: case LDYax: case LSRax: + case ORAax: case RLAax: case ROLax: case RORax: case RRAax: case SBCax: + case SLOax: case SREax: + //ASOax DCMax INSax LSEax SAYax - Optional Opcode Names + printf("ax %04x,X", operand); + printf(" [%04x]{%02x}", address, data); + break; + case SHYax: case STAax: +#ifdef MOS6510_DEBUG + case NOPax_: +#endif + printf("ax %04x,X", operand); + printf(" [%04x]", address); + break; + + //Absolute With Y Offset Addresing Mode Handler + case ADCay: case ANDay: case CMPay: case DCPay: case EORay: case ISBay: + case LASay: case LAXay: case LDAay: case LDXay: case ORAay: case RLAay: + case RRAay: case SBCay: case SHSay: case SLOay: case SREay: + //ASOay AXAay DCMay INSax LSEay TASay XASay - Optional Opcode Names + printf("ay %04x,Y", operand); + printf(" [%04x]{%02x}", address, data); + break; + case SHAay: case SHXay: case STAay: + printf("ay %04x,Y", operand); + printf(" [%04x]", address); + break; + + //Immediate Addressing Mode Handler + case ADCb: case ANDb: case ANCb_: case ANEb: case ASRb: case ARRb: + case CMPb: case CPXb: case CPYb: case EORb: case LDAb: case LDXb: + case LDYb: case LXAb: case ORAb: case SBCb_: case SBXb: + //OALb ALRb XAAb - Optional Opcode Names +#ifdef MOS6510_DEBUG + case NOPb_: +#endif + printf("b #%02x", endian_16lo8 (operand)); + break; + + //Relative Addressing Mode Handler + case BCCr: case BCSr: case BEQr: case BMIr: case BNEr: case BPLr: + case BVCr: case BVSr: + printf("r #%02x", endian_16lo8 (operand)); + printf(" [%04x]", address); + break; + + //Indirect Addressing Mode Handler + case JMPi: + printf("i (%04x)", operand); + printf(" [%04x]", address); + break; + + //Indexed with X Preinc Addressing Mode Handler + case ADCix: case ANDix: case CMPix: case DCPix: case EORix: case ISBix: + case LAXix: case LDAix: case ORAix: case SBCix: case SLOix: case SREix: + case RLAix: case RRAix: + //ASOix AXSix DCMix INSix LSEix - Optional Opcode Names + printf("ix (%02x,X)", endian_16lo8 (operand)); + printf(" [%04x]{%02x}", address, data); + break; + case SAXix: case STAix: + printf("ix (%02x,X)", endian_16lo8 (operand)); + printf(" [%04x]", address); + break; + + //Indexed with Y Postinc Addressing Mode Handler + case ADCiy: case ANDiy: case CMPiy: case DCPiy: case EORiy: case ISBiy: + case LAXiy: case LDAiy: case ORAiy: case RLAiy: case RRAiy: case SBCiy: + case SLOiy: case SREiy: + //AXAiy ASOiy LSEiy DCMiy INSiy - Optional Opcode Names + printf("iy (%02x),Y", endian_16lo8 (operand)); + printf(" [%04x]{%02x}", address, data); + break; + case SHAiy: case STAiy: + printf("iy (%02x),Y", endian_16lo8 (operand)); + printf(" [%04x]", address); + break; + + default: + break; + } + + printf ("\n\n"); + fflush (stdout); +} + +#endif // MOS6510_STATE_6510 + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/mos6510.h b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/mos6510.h new file mode 100644 index 00000000..e7ad1a3f --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/mos6510.h @@ -0,0 +1,75 @@ +/*************************************************************************** + mos6510.h - description + ------------------- + begin : Thu May 11 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: mos6510.h,v $ + * Revision 1.5 2001/07/14 16:47:21 s_a_white + * Sync with sidbuilder class project. + * + * Revision 1.4 2001/07/14 13:04:34 s_a_white + * Accumulator is now unsigned, which improves code readability. + * + * Revision 1.3 2000/12/11 19:03:16 s_a_white + * AC99 Update. + * + ***************************************************************************/ + +#ifndef _mos6510_h_ +#define _mos6510_h_ + +#include "config.h" +#include "component.h" +#include "sidenv.h" +#include "event.h" + +#undef MOS6510_VERSION +#undef MOS6510_DATE +#undef MOS6510_AUTHOR +#undef MOS6510_EMAIL +#define MOS6510_VERSION "1.08" +#define MOS6510_DATE "23th May 2000" +#define MOS6510_AUTHOR "Simon White" +#define MOS6510_EMAIL "s_a_white@email.com" +#define MOS6510_INTERRUPT_DELAY 2 + +#include "opcodes.h" +#include "conf6510.h" + +// Status Register flag definistions +#define SR_NEGATIVE 7 +#define SR_OVERFLOW 6 +#define SR_NOTUSED 5 +#define SR_BREAK 4 +#define SR_DECIMAL 3 +#define SR_INTERRUPT 2 +#define SR_ZERO 1 +#define SR_CARRY 0 + +#define SP_PAGE 0x01 + +// Check to see what type of emulation is required +#ifdef MOS6510_CYCLE_BASED +# ifdef MOS6510_SIDPLAY +# include "cycle_based/sid6510c.h" +# else +# include "cycle_based/mos6510c.h" +# endif // MOS6510_SIDPLAY +#else + // Line based emulation code has not been provided +#endif // MOS6510_CYCLE_BASED + +#endif // _mos6510_h_ + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/opcodes.h b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/opcodes.h new file mode 100644 index 00000000..e4d44acd --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6510/opcodes.h @@ -0,0 +1,331 @@ +/*************************************************************************** + opcodes.h - description + ------------------- + begin : Thu May 11 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef _opcodes_h_ +#define _opcodes_h_ + +#define OPCODE_MAX 0x100 + +/* HLT + case 0x02: case 0x12: case 0x22: case 0x32: case 0x42: case 0x52: + case 0x62: case 0x72: case 0x92: case 0xb2: case 0xd2: case 0xf2: + case 0x02: case 0x12: case 0x22: case 0x32: case 0x42: case 0x52: + case 0x62: case 0x72: case 0x92: case 0xb2: case 0xd2: case 0xf2: +*/ + +#define BRKn 0x00 +#define JSRw 0x20 +#define RTIn 0x40 +#define RTSn 0x60 +#define NOPb 0x80 +#define NOPb_ NOPb: case 0x82: case 0xC2: case 0xE2: case 0x89 +#define LDYb 0xA0 +#define CPYb 0xC0 +#define CPXb 0xE0 + +#define ORAix 0x01 +#define ANDix 0x21 +#define EORix 0x41 +#define ADCix 0x61 +#define STAix 0x81 +#define LDAix 0xA1 +#define CMPix 0xC1 +#define SBCix 0xE1 + +#define LDXb 0xA2 + +#define SLOix 0x03 +#define RLAix 0x23 +#define SREix 0x43 +#define RRAix 0x63 +#define SAXix 0x83 +#define LAXix 0xA3 +#define DCPix 0xC3 +#define ISBix 0xE3 + +#define NOPz 0x04 +#define NOPz_ NOPz: case 0x44: case 0x64 +#define BITz 0x24 +#define STYz 0x84 +#define LDYz 0xA4 +#define CPYz 0xC4 +#define CPXz 0xE4 + +#define ORAz 0x05 +#define ANDz 0x25 +#define EORz 0x45 +#define ADCz 0x65 +#define STAz 0x85 +#define LDAz 0xA5 +#define CMPz 0xC5 +#define SBCz 0xE5 + +#define ASLz 0x06 +#define ROLz 0x26 +#define LSRz 0x46 +#define RORz 0x66 +#define STXz 0x86 +#define LDXz 0xA6 +#define DECz 0xC6 +#define INCz 0xE6 + +#define SLOz 0x07 +#define RLAz 0x27 +#define SREz 0x47 +#define RRAz 0x67 +#define SAXz 0x87 +#define LAXz 0xA7 +#define DCPz 0xC7 +#define ISBz 0xE7 + +#define PHPn 0x08 +#define PLPn 0x28 +#define PHAn 0x48 +#define PLAn 0x68 +#define DEYn 0x88 +#define TAYn 0xA8 +#define INYn 0xC8 +#define INXn 0xE8 + +#define ORAb 0x09 +#define ANDb 0x29 +#define EORb 0x49 +#define ADCb 0x69 +#define LDAb 0xA9 +#define CMPb 0xC9 +#define SBCb 0xE9 +#define SBCb_ SBCb: case 0XEB + +#define ASLn 0x0A +#define ROLn 0x2A +#define LSRn 0x4A +#define RORn 0x6A +#define TXAn 0x8A +#define TAXn 0xAA +#define DEXn 0xCA +#define NOPn 0xEA +#define NOPn_ NOPn: case 0x1A: case 0x3A: case 0x5A: case 0x7A: case 0xDA: case 0xFA + +#define ANCb 0x0B +#define ANCb_ ANCb: case 0x2B +#define ASRb 0x4B +#define ARRb 0x6B +#define ANEb 0x8B +#define XAAb 0x8B +#define LXAb 0xAB +#define SBXb 0xCB + +#define NOPa 0x0C +#define BITa 0x2C +#define JMPw 0x4C +#define JMPi 0x6C +#define STYa 0x8C +#define LDYa 0xAC +#define CPYa 0xCC +#define CPXa 0xEC + +#define ORAa 0x0D +#define ANDa 0x2D +#define EORa 0x4D +#define ADCa 0x6D +#define STAa 0x8D +#define LDAa 0xAD +#define CMPa 0xCD +#define SBCa 0xED + +#define ASLa 0x0E +#define ROLa 0x2E +#define LSRa 0x4E +#define RORa 0x6E +#define STXa 0x8E +#define LDXa 0xAE +#define DECa 0xCE +#define INCa 0xEE + +#define SLOa 0x0F +#define RLAa 0x2F +#define SREa 0x4F +#define RRAa 0x6F +#define SAXa 0x8F +#define LAXa 0xAF +#define DCPa 0xCF +#define ISBa 0xEF + +#define BPLr 0x10 +#define BMIr 0x30 +#define BVCr 0x50 +#define BVSr 0x70 +#define BCCr 0x90 +#define BCSr 0xB0 +#define BNEr 0xD0 +#define BEQr 0xF0 + +#define ORAiy 0x11 +#define ANDiy 0x31 +#define EORiy 0x51 +#define ADCiy 0x71 +#define STAiy 0x91 +#define LDAiy 0xB1 +#define CMPiy 0xD1 +#define SBCiy 0xF1 + +#define SLOiy 0x13 +#define RLAiy 0x33 +#define SREiy 0x53 +#define RRAiy 0x73 +#define SHAiy 0x93 +#define LAXiy 0xB3 +#define DCPiy 0xD3 +#define ISBiy 0xF3 + +#define NOPzx 0x14 +#define NOPzx_ NOPzx: case 0x34: case 0x54: case 0x74: case 0xD4: case 0xF4 +#define STYzx 0x94 +#define LDYzx 0xB4 + +#define ORAzx 0x15 +#define ANDzx 0x35 +#define EORzx 0x55 +#define ADCzx 0x75 +#define STAzx 0x95 +#define LDAzx 0xB5 +#define CMPzx 0xD5 +#define SBCzx 0xF5 + +#define ASLzx 0x16 +#define ROLzx 0x36 +#define LSRzx 0x56 +#define RORzx 0x76 +#define STXzy 0x96 +#define LDXzy 0xB6 +#define DECzx 0xD6 +#define INCzx 0xF6 + +#define SLOzx 0x17 +#define RLAzx 0x37 +#define SREzx 0x57 +#define RRAzx 0x77 +#define SAXzy 0x97 +#define LAXzy 0xB7 +#define DCPzx 0xD7 +#define ISBzx 0xF7 + +#define CLCn 0x18 +#define SECn 0x38 +#define CLIn 0x58 +#define SEIn 0x78 +#define TYAn 0x98 +#define CLVn 0xB8 +#define CLDn 0xD8 +#define SEDn 0xF8 + +#define ORAay 0x19 +#define ANDay 0x39 +#define EORay 0x59 +#define ADCay 0x79 +#define STAay 0x99 +#define LDAay 0xB9 +#define CMPay 0xD9 +#define SBCay 0xF9 + +#define TXSn 0x9A +#define TSXn 0xBA + +#define SLOay 0x1B +#define RLAay 0x3B +#define SREay 0x5B +#define RRAay 0x7B +#define SHSay 0x9B +#define TASay 0x9B +#define LASay 0xBB +#define DCPay 0xDB +#define ISBay 0xFB + +#define NOPax 0x1C +#define NOPax_ NOPax: case 0x3C: case 0x5C: case 0x7C: case 0xDC: case 0xFC +#define SHYax 0x9C +#define LDYax 0xBC + +#define ORAax 0x1D +#define ANDax 0x3D +#define EORax 0x5D +#define ADCax 0x7D +#define STAax 0x9D +#define LDAax 0xBD +#define CMPax 0xDD +#define SBCax 0xFD + +#define ASLax 0x1E +#define ROLax 0x3E +#define LSRax 0x5E +#define RORax 0x7E +#define SHXay 0x9E +#define LDXay 0xBE +#define DECax 0xDE +#define INCax 0xFE + +#define SLOax 0x1F +#define RLAax 0x3F +#define SREax 0x5F +#define RRAax 0x7F +#define SHAay 0x9F +#define LAXay 0xBF +#define DCPax 0xDF +#define ISBax 0xFF + +// Instruction Aliases +#define ASOix SLOix +#define LSEix SREix +#define AXSix SAXix +#define DCMix DCPix +#define INSix ISBix +#define ASOz SLOz +#define LSEz SREz +#define AXSz SAXz +#define DCMz DCPz +#define INSz ISBz +#define ALRb ASRb +#define OALb LXAb +#define ASOa SLOa +#define LSEa SREa +#define AXSa SAXa +#define DCMa DCPa +#define INSa ISBa +#define ASOiy SLOiy +#define LSEiy SREiy +#define AXAiy SHAiy +#define DCMiy DCPiy +#define INSiy ISBiy +#define ASOzx SLOzx +#define LSEzx SREzx +#define AXSzy SAXzy +#define DCMzx DCPzx +#define INSzx ISBzx +#define ASOay SLOay +#define LSEay SREay +#define DCMay DCPay +#define INSay ISBay +#define SAYax SHYax +#define XASay SHXay +#define ASOax SLOax +#define LSEax SREax +#define AXAay SHAay +#define DCMax DCPax +#define INSax ISBax +#define SKBn NOPb +#define SKWn NOPa + +#endif // _opcodes_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/Makefile.am new file mode 100644 index 00000000..e5029df5 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/Makefile.am @@ -0,0 +1,7 @@ + +noinst_LTLIBRARIES = libmos6526.la + +libmos6526_la_SOURCES = mos6526.cpp mos6526.h + +# Remove bad default includes +DEFAULT_INCLUDES= diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/Makefile.in new file mode 100644 index 00000000..8f1667ec --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/Makefile.in @@ -0,0 +1,424 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +noinst_LTLIBRARIES = libmos6526.la + +libmos6526_la_SOURCES = mos6526.cpp mos6526.h + +# Remove bad default includes +DEFAULT_INCLUDES = +subdir = src/mos6526 +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libmos6526_la_LDFLAGS = +libmos6526_la_LIBADD = +am_libmos6526_la_OBJECTS = mos6526.lo +libmos6526_la_OBJECTS = $(am_libmos6526_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/unix/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/mos6526.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libmos6526_la_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libmos6526_la_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/mos6526/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmos6526.la: $(libmos6526_la_OBJECTS) $(libmos6526_la_DEPENDENCIES) + $(CXXLINK) $(libmos6526_la_LDFLAGS) $(libmos6526_la_OBJECTS) $(libmos6526_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mos6526.Plo@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/mos6526.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/mos6526.cpp new file mode 100644 index 00000000..32b6f1f2 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/mos6526.cpp @@ -0,0 +1,322 @@ +/*************************************************************************** + mos6526.cpp - CIA Timer + ------------------- + begin : Wed Jun 7 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: mos6526.cpp,v $ + * Revision 1.10 2002/12/16 22:12:24 s_a_white + * Simulate serial input from data port A to prevent kernel lockups. + * + * Revision 1.9 2002/11/20 22:50:27 s_a_white + * Reload count when timers are stopped + * + * Revision 1.8 2002/10/02 19:49:21 s_a_white + * Revert previous change as was incorrect. + * + * Revision 1.7 2002/09/11 22:30:47 s_a_white + * Counter interval writes now go to a new register call prescaler. This is + * copied to the timer latch/counter as appropriate. + * + * Revision 1.6 2002/09/09 22:49:06 s_a_white + * Proper idr clear if interrupt was only internally pending. + * + * Revision 1.5 2002/07/20 08:34:52 s_a_white + * Remove unnecessary and pointless conts. + * + * Revision 1.4 2002/03/03 22:04:08 s_a_white + * Tidy. + * + * Revision 1.3 2001/07/14 13:03:33 s_a_white + * Now uses new component classes and event generation. + * + * Revision 1.2 2001/03/23 23:21:38 s_a_white + * Removed redundant reset funtion. Timer b now gets initialised properly. + * Switch case now allows write/read from timer b. + * + * Revision 1.1 2001/03/21 22:41:45 s_a_white + * Non faked CIA emulation with NMI support. Removal of Hacked VIC support + * off CIA timer. + * + * Revision 1.8 2001/03/09 23:44:30 s_a_white + * Integrated more 6526 features. All timer modes and interrupts correctly + * supported. + * + * Revision 1.7 2001/02/21 22:07:10 s_a_white + * Prevent re-triggering of interrupt if it's already active. + * + * Revision 1.6 2001/02/13 21:00:01 s_a_white + * Support for real interrupts. + * + * Revision 1.4 2000/12/11 18:52:12 s_a_white + * Conversion to AC99 + * + ***************************************************************************/ + +#include "sidendian.h" +#include "mos6526.h" + +enum +{ + INTERRUPT_TA = 1 << 0, + INTERRUPT_TB = 1 << 1, + INTERRUPT_ALARM = 1 << 2, + INTERRUPT_SP = 1 << 3, + INTERRUPT_FLAG = 1 << 4, + INTERRUPT_REQUEST = 1 << 7 +}; + +const char *MOS6526::credit = +{ // Optional information + "*MOS6526 (CIA) Emulation:\0" + "\tCopyright (C) 2001 Simon White <sidplay2@email.com>\0" +}; + + +MOS6526::MOS6526 (EventContext *context) +:idr(0), + event_context(*context), + event_ta(this), + event_tb(this) +{ + reset (); +} + +void MOS6526::reset (void) +{ + ta = ta_latch = 0xffff; + tb = tb_latch = 0xffff; + cra = crb = 0; + // Clear off any IRQs + trigger (0); + cnt_high = true; + icr = idr = 0; + m_accessClk = 0; + dpa = 0xf0; +} + +uint8_t MOS6526::read (uint_least8_t addr) +{ + event_clock_t cycles; + if (addr > 0x0f) return 0; + + cycles = event_context.getTime (m_accessClk); + m_accessClk += cycles; + + // Sync up timers + if ((cra & 0x21) == 0x01) + ta -= cycles; + if ((crb & 0x61) == 0x01) + tb -= cycles; + + switch (addr) + { + case 0x0: // Simulate a serial port + dpa = ((dpa << 1) | (dpa >> 7)) & 0xff; + if (dpa & 0x80) + return 0xc0; + return 0; + case 0x4: return endian_16lo8 (ta); + case 0x5: return endian_16hi8 (ta); + case 0x6: return endian_16lo8 (tb); + case 0x7: return endian_16hi8 (tb); + + case 0xd: + { // Clear IRQs, and return interrupt + // data register + uint8_t ret = idr; + trigger (0); + return ret; + } + + case 0x0e: return cra; + case 0x0f: return crb; + default: return regs[addr]; + } +} + +void MOS6526::write (uint_least8_t addr, uint8_t data) +{ + event_clock_t cycles; + if (addr > 0x0f) return; + + regs[addr] = data; + cycles = event_context.getTime (m_accessClk); + m_accessClk += cycles; + + // Sync up timers + if ((cra & 0x21) == 0x01) + ta -= cycles; + if ((crb & 0x61) == 0x01) + tb -= cycles; + + switch (addr) + { + case 0x4: endian_16lo8 (ta_latch, data); break; + case 0x5: + endian_16hi8 (ta_latch, data); + if (!(cra & 0x01)) // Reload timer if stopped + ta = ta_latch; + break; + + case 0x6: endian_16lo8 (tb_latch, data); break; + case 0x7: + endian_16hi8 (tb_latch, data); + if (!(crb & 0x01)) // Reload timer if stopped + tb = tb_latch; + break; + + case 0xd: + if (data & 0x80) + icr |= data & 0x1f; + else + icr &= ~data; + trigger (idr); + break; + + case 0x0e: + // Check for forced load + cra = data; + if (data & 0x10) + { + cra &= (~0x10); + ta = ta_latch; + } + + if ((data & 0x21) == 0x01) + { // Active + event_context.schedule (&event_ta, (event_clock_t) ta + 1); + } else + { // Inactive + ta = ta_latch; + event_context.cancel (&event_ta); + } + break; + + case 0x0f: + // Check for forced load + crb = data; + if (data & 0x10) + { + crb &= (~0x10); + tb = tb_latch; + } + + if ((data & 0x61) == 0x01) + { // Active + event_context.schedule (&event_tb, (event_clock_t) tb + 1); + } else + { // Inactive + tb = tb_latch; + event_context.cancel (&event_tb); + } + break; + + default: + break; + } +} + +void MOS6526::trigger (int irq) +{ + if (!irq) + { // Clear any requested IRQs + if (idr & INTERRUPT_REQUEST) + interrupt (false); + idr = 0; + return; + } + + idr |= irq; + if (icr & idr) + { + if (!(idr & INTERRUPT_REQUEST)) + { + idr |= INTERRUPT_REQUEST; + interrupt (true); + } + } +} + +void MOS6526::ta_event (void) +{ // Timer Modes + event_clock_t cycles; + uint8_t mode = cra & 0x21; + + if (mode == 0x21) + { + if (ta--) + return; + } + + cycles = event_context.getTime (m_accessClk); + m_accessClk += cycles; + + ta = ta_latch; + if (cra & 0x08) + { // one shot, stop timer A + cra &= (~0x01); + } else if (mode == 0x01) + { // Reset event + event_context.schedule (&event_ta, (event_clock_t) ta + 1); + } + trigger (INTERRUPT_TA); + + switch (crb & 0x61) + { + case 0x01: tb -= cycles; break; + case 0x41: + case 0x61: + tb_event (); + break; + } +} + +void MOS6526::tb_event (void) +{ // Timer Modes + uint8_t mode = crb & 0x61; + switch (mode) + { + case 0x01: + break; + + case 0x21: + case 0x41: + if (tb--) + return; + break; + + case 0x61: + if (cnt_high) + { + if (tb--) + return; + } + break; + + default: + return; + } + + m_accessClk = event_context.getTime (); + tb = tb_latch; + if (crb & 0x08) + { // one shot, stop timer A + crb &= (~0x01); + } else if (mode == 0x01) + { // Reset event + event_context.schedule (&event_tb, (event_clock_t) tb + 1); + } + trigger (INTERRUPT_TB); +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/mos6526.h b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/mos6526.h new file mode 100644 index 00000000..5fa11bcf --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos6526/mos6526.h @@ -0,0 +1,156 @@ +/*************************************************************************** + mos6526.h - CIA timer to produce interrupts + ------------------- + begin : Wed Jun 7 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: mos6526.h,v $ + * Revision 1.11 2002/12/16 22:12:27 s_a_white + * Simulate serial input from data port A to prevent kernel lockups. + * + * Revision 1.10 2002/10/02 19:49:22 s_a_white + * Revert previous change as was incorrect. + * + * Revision 1.9 2002/09/11 22:30:47 s_a_white + * Counter interval writes now go to a new register call prescaler. This is + * copied to the timer latch/counter as appropriate. + * + * Revision 1.8 2002/07/20 08:34:52 s_a_white + * Remove unnecessary and pointless conts. + * + * Revision 1.7 2001/10/18 22:35:45 s_a_white + * GCC3 fixes. + * + * Revision 1.6 2001/07/14 16:46:59 s_a_white + * Sync with sidbuilder class project. + * + * Revision 1.5 2001/07/14 13:03:33 s_a_white + * Now uses new component classes and event generation. + * + * Revision 1.4 2001/03/25 19:50:16 s_a_white + * Timer B counts timer Aer a underflows correc + * + * Revision 1.3 2001/03/23 23:20:29 s_a_white + * Removed redundant reset prototype. + * + * Revision 1.2 2001/03/22 22:41:45 s_a_white + * Replaced tab characters + * + * Revision 1.1 2001/03/21 22:41:45 s_a_white + * Non faked CIA emulation with NMI support. Removal of Hacked VIC support + * off CIA timer. + * + * Revision 1.7 2001/03/09 23:44:30 s_a_white + * Integrated more 6526 features. All timer modes and interrupts correctly + * supported. + * + * Revision 1.6 2001/02/21 22:07:10 s_a_white + * Prevent re-triggering of interrupt if it's already active. + * + * Revision 1.5 2001/02/13 21:00:01 s_a_white + * Support for real interrupts. + * + * Revision 1.3 2000/12/11 18:52:12 s_a_white + * Conversion to AC99 + * + ***************************************************************************/ + +#ifndef _mos6526_h_ +#define _mos6526_h_ + +#include "component.h" +#include "event.h" + +class MOS6526: public component +{ +private: + static const char *credit; + +protected: + uint8_t regs[0x10]; + bool cnt_high; + + // Timer A + uint8_t cra, cra_latch, dpa; + uint_least16_t ta, ta_latch; + int ta_state; + + // Timer B + uint8_t crb; + uint_least16_t tb, tb_latch; + + uint8_t icr, idr; // Interrupt Control Register + event_clock_t m_accessClk; + EventContext &event_context; + + class EventTa: public Event + { + private: + MOS6526 &m_cia; + void event (void) {m_cia.ta_event ();} + + public: + EventTa (MOS6526 *cia) + :Event("CIA Timer A"), + m_cia(*cia) {} + } event_ta; + + /* + class EventStateMachineA: public Event + { + private: + MOS6526 &m_cia; + void event (void) {m_cia.cra_event ();} + + public: + EventStateMachineA (MOS6526 *cia) + :Event("CIA Timer A (State Machine)"), + m_cia(*cia) {} + } event_stateMachineA; +*/ + class EventTb: public Event + { + private: + MOS6526 &m_cia; + void event (void) {m_cia.tb_event ();} + + public: + EventTb (MOS6526 *cia) + :Event("CIA Timer B"), + m_cia(*cia) {} + } event_tb; + + friend class EventTa; +// friend class EventStateMachineA; + friend class EventTb; + +protected: + MOS6526 (EventContext *context); + void ta_event (void); + void tb_event (void); + void trigger (int irq); +// void stateMachineA_event (void); + + // Environment Interface + virtual void interrupt (bool state) = 0; + +public: + // Component Standard Calls + void reset (void); + uint8_t read (uint_least8_t addr); + void write (uint_least8_t addr, uint8_t data); + const char *credits (void) {return credit;} +}; + +#endif // _mos6526_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/Makefile.am new file mode 100644 index 00000000..7a228bca --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/Makefile.am @@ -0,0 +1,7 @@ + +noinst_LTLIBRARIES = libmos656x.la + +libmos656x_la_SOURCES = mos656x.cpp mos656x.h + +# Remove bad default includes +DEFAULT_INCLUDES= diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/Makefile.in new file mode 100644 index 00000000..eeeea606 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/Makefile.in @@ -0,0 +1,424 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +noinst_LTLIBRARIES = libmos656x.la + +libmos656x_la_SOURCES = mos656x.cpp mos656x.h + +# Remove bad default includes +DEFAULT_INCLUDES = +subdir = src/mos656x +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libmos656x_la_LDFLAGS = +libmos656x_la_LIBADD = +am_libmos656x_la_OBJECTS = mos656x.lo +libmos656x_la_OBJECTS = $(am_libmos656x_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/unix/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/mos656x.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libmos656x_la_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libmos656x_la_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/mos656x/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmos656x.la: $(libmos656x_la_OBJECTS) $(libmos656x_la_DEPENDENCIES) + $(CXXLINK) $(libmos656x_la_LDFLAGS) $(libmos656x_la_OBJECTS) $(libmos656x_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mos656x.Plo@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/mos656x.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/mos656x.cpp new file mode 100644 index 00000000..a7e03642 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/mos656x.cpp @@ -0,0 +1,256 @@ +/*************************************************************************** + + mos656x.cpp - Minimal VIC emulation + ------------------- + begin : Wed May 21 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "sidendian.h" +#include "mos656x.h" + +#define MOS6567R56A_FIRST_DMA_LINE 0x30 +#define MOS6567R56A_LAST_DMA_LINE 0xf7 + +#define MOS6567R8_FIRST_DMA_LINE 0x30 +#define MOS6567R8_LAST_DMA_LINE 0xf7 + +#define MOS6569_FIRST_DMA_LINE 0x30 +#define MOS6569_LAST_DMA_LINE 0xff + +const char *MOS656X::credit = +{ // Optional information + "*MOS656X (VICII) Emulation:\0" + "\tCopyright (C) 2001 Simon White <sidplay2@email.com>\0" +}; + + +MOS656X::MOS656X (EventContext *context) +:Event("VIC Raster"), + event_context(*context) +{ + chip (MOS6569); +} + +void MOS656X::reset () +{ + icr = idr = ctrl1 = 0; + raster_irq = 0; + y_scroll = 0; + raster_y = yrasters - 1; + raster_x = xrasters - 1; + bad_lines_enabled = false; + event_context.schedule (this, 1); + m_accessClk = 0; +} + +void MOS656X::chip (mos656x_model_t model) +{ + switch (model) + { + // Seems to be an older NTSC chip + case MOS6567R56A: + yrasters = 262; + xrasters = 64; + first_dma_line = MOS6567R56A_FIRST_DMA_LINE; + last_dma_line = MOS6567R56A_LAST_DMA_LINE; + break; + + // NTSC Chip + case MOS6567R8: + yrasters = 263; + xrasters = 65; + first_dma_line = MOS6567R8_FIRST_DMA_LINE; + last_dma_line = MOS6567R8_LAST_DMA_LINE; + break; + + // PAL Chip + case MOS6569: + yrasters = 312; + xrasters = 63; + first_dma_line = MOS6569_FIRST_DMA_LINE; + last_dma_line = MOS6569_LAST_DMA_LINE; + break; + } + + reset (); +} + +uint8_t MOS656X::read (uint_least8_t addr) +{ + if (addr > 0x3f) return 0; + if (addr > 0x2e) return 0xff; + + switch (addr) + { + case 0x11: // Control register 1 + return (raster_y & 0x100) >> 1; + case 0x12: // Raster counter + return raster_y & 0xFF; + case 0x19: // IRQ flags + return idr; + case 0x1a: // IRQ mask + return icr | 0xf0; + default: return regs[addr]; + } +} + +void MOS656X::write (uint_least8_t addr, uint8_t data) +{ + if (addr > 0x3f) return; + + regs[addr] = data; + + switch (addr) + { + case 0x11: // Control register 1 + endian_16hi8 (raster_irq, data >> 7); + ctrl1 = data; + y_scroll = data & 7; + + if (raster_x < 11) + break; + + // In line $30, the DEN bit controls if Bad Lines can occur + if (raster_y == 0x30 && data & 0x10) + bad_lines_enabled = true; + + // Bad Line condition? + bad_line = (raster_y >= first_dma_line) && + (raster_y <= last_dma_line) && + ((raster_y & 7) == y_scroll) && + bad_lines_enabled; + + // Start DMA + if (bad_line && (raster_x < 54)) + { + busaccess(false); + if (raster_x < 52) + event_context.schedule (this, 3); + } + break; + + case 0x12: // Raster counter + endian_16lo8 (raster_irq, data); + break; + + case 0x19: // IRQ flags + idr &= ((~data & 0x0f) | 0x80); + if (idr == 0x80) + trigger (0); + break; + + case 0x1a: // IRQ mask + icr = data & 0x0f; + trigger (icr & idr); + break; + } +} + + +void MOS656X::trigger (int irq) +{ + if (!irq) + { // Clear any requested IRQs + if (idr & MOS656X_INTERRUPT_REQUEST) + interrupt (false); + idr = 0; + return; + } + + idr |= irq; + if (icr & idr) + { + if (!(idr & MOS656X_INTERRUPT_REQUEST)) + { + idr |= MOS656X_INTERRUPT_REQUEST; + interrupt (true); + } + } +} + +void MOS656X::event (void) +{ + event_clock_t delay = 1; + + switch (raster_x) + { + case 0: // IRQ occurred (xraster != 0) + if (raster_y != yrasters - 1) + { + raster_y++; + // Trigger raster IRQ if IRQ line reached + if (raster_y == raster_irq) + trigger (MOS656X_INTERRUPT_RST); + delay = 11; + } + break; + case 1: // Vertical blank (line 0) + // Trigger raster IRQ if IRQ in line 0 + raster_y = 0; + if (raster_y == raster_irq) + trigger (MOS656X_INTERRUPT_RST); + delay = 10; + break; + + case 11: // Start bad line + { // In line $30, the DEN bit controls if Bad Lines can occur + if (raster_y == first_dma_line) + bad_lines_enabled = (ctrl1 & 0x10) != 0; + + // Test for bad line condition + bad_line = (raster_y >= first_dma_line) && + (raster_y <= last_dma_line) && + ((raster_y & 7) == y_scroll) && + bad_lines_enabled; + + delay = xrasters - 11; + if (bad_line) + { + delay = 3; + busaccess (false); + } + break; + } + + case 14: // Start DMA + addrctrl (false); + delay = 40; + break; + case 54: // End DMA + busaccess (true); + addrctrl (true); + delay = xrasters - 54; + break; + + case 12: + case 13: + break; + + default: + if (bad_line && (raster_x < 54)) + { + addrctrl (false); + delay = 54 - raster_x; + } + else + { // Skip to the end of raster + busaccess (true); + delay = xrasters - raster_x; + } + } + + raster_x += delay; + raster_x %= xrasters; + event_context.schedule (this, delay); +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/mos656x.h b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/mos656x.h new file mode 100644 index 00000000..7cf9867e --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/mos656x/mos656x.h @@ -0,0 +1,79 @@ +/*************************************************************************** + mos656x.h - Minimal VIC emulation + ------------------- + begin : Wed May 21 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _mos656x_h_ +#define _mos656x_h_ + +#include "component.h" +#include "event.h" + +typedef enum +{ + MOS6567R56A, /* OLD NTSC CHIP */ + MOS6567R8, /* NTSC */ + MOS6569 /* PAL */ +} mos656x_model_t; + + +class MOS656X: public component, public Event +{ +private: + static const char *credit; + +protected: + uint8_t regs[0x40]; + uint8_t icr, idr, ctrl1; + uint_least16_t yrasters, xrasters, raster_irq; + uint_least16_t raster_x, raster_y; + uint_least16_t first_dma_line, last_dma_line, y_scroll; + bool bad_lines_enabled, bad_line; + + event_clock_t m_accessClk; + EventContext &event_context; + +protected: + MOS656X (EventContext *context); + void event (void); + void trigger (int irq); + + // Environment Interface + virtual void interrupt (bool state) = 0; + virtual void busaccess (bool state) = 0; + virtual void addrctrl (bool state) = 0; + +public: + void chip (mos656x_model_t model); + + // Component Standard Calls + void reset (void); + uint8_t read (uint_least8_t addr); + void write (uint_least8_t addr, uint8_t data); + const char *credits (void) {return credit;} +}; + + +/*************************************************************************** + * Inline functions + **************************************************************************/ + +enum +{ + MOS656X_INTERRUPT_RST = 1 << 0, + MOS656X_INTERRUPT_REQUEST = 1 << 7 +}; + +#endif // _mos656x_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/nullsid.h b/sid/sidplay-libs-2.1.0/libsidplay/src/nullsid.h new file mode 100644 index 00000000..7865d9e9 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/nullsid.h @@ -0,0 +1,43 @@ +/*************************************************************************** + nullsid.h - Null SID Emulation + ------------------- + begin : Thurs Sep 20 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _nullsid_h_ +#define _nullsid_h_ + +#include "sidbuilder.h" + +class NullSID: public sidemu +{ +public: + NullSID () : sidemu (NULL) {;} + + // Standard component functions + void reset () { ; } + void reset (uint8_t) { ; } + uint8_t read (uint_least8_t) { return 0; } + void write (uint_least8_t, uint8_t) { ; } + const char *credits (void) { return ""; } + const char *error (void) { return ""; } + + // Standard SID functions + int_least32_t output (uint_least8_t) { return 0; } + void voice (uint_least8_t, uint_least8_t, + bool) { ; } + void gain (int_least8_t) { ; } +}; + +#endif // _nullsid_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/player.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/player.cpp new file mode 100644 index 00000000..38b612c0 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/player.cpp @@ -0,0 +1,945 @@ +/*************************************************************************** + player.cpp - Main Library Code + ------------------- + begin : Fri Jun 9 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: player.cpp,v $ + * Revision 1.57 2002/12/14 10:10:30 s_a_white + * Kernal Mod: Bypass screen clear as we don't have a screen. Fix setting + * of PAL/NTSC flag for real c64 mode. + * + * Revision 1.56 2002/12/13 22:01:54 s_a_white + * Kernel mods: Memory now bypassed by upping the start address so the + * end or ram is found instantly. Basic cold/warm start address points to a + * busy loop to prevent undersiable side effects (this may change later). + * + * Revision 1.55 2002/11/27 00:16:51 s_a_white + * Make sure driver info gets reset and exported properly. + * + * Revision 1.54 2002/11/25 21:09:41 s_a_white + * Reset address for old sidplay1 modes now directly passed to the CPU. This + * prevents tune corruption and banking issues for the different modes. + * + * Revision 1.53 2002/11/21 19:53:58 s_a_white + * CPU nolonger a special case. It now uses the event scheduler like all the + * other components. + * + * Revision 1.52 2002/11/20 21:44:03 s_a_white + * Fix fake IRQ to properly obtain next address. + * + * Revision 1.51 2002/11/19 22:55:18 s_a_white + * Sidplay1 modes modified to make them nolonger require the psid driver. + * Full c64 kernal supported in real c64 mode. + * + * Revision 1.50 2002/11/01 17:36:01 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.49 2002/10/20 08:58:36 s_a_white + * Modify IO map so psiddrv can detect special cases. + * + * Revision 1.48 2002/10/15 18:20:54 s_a_white + * Make all addresses from ea31 to ea7d valid IRQ exit points. This + * approximates the functionality of a real C64. + * + * Revision 1.47 2002/10/02 19:43:47 s_a_white + * RSID support. + * + * Revision 1.46 2002/09/17 17:02:41 s_a_white + * Fixed location of kernel IRQ exit code. + * + * Revision 1.45 2002/09/12 21:01:30 s_a_white + * Added support for simulating the random delay before the user loads a + * program on a real C64. + * + * Revision 1.44 2002/09/09 18:01:30 s_a_white + * Prevent m_info driver details getting modified when C64 crashes. + * + * Revision 1.43 2002/08/20 23:21:41 s_a_white + * Setup default sample format. + * + * Revision 1.42 2002/04/14 21:46:50 s_a_white + * PlaySID reads fixed to come from RAM only. + * + * Revision 1.41 2002/03/12 18:43:59 s_a_white + * Tidy up handling of envReset on illegal CPU instructions. + * + * Revision 1.40 2002/03/11 18:01:30 s_a_white + * Prevent lockup if config call fails with existing and old configurations. + * + * Revision 1.39 2002/03/03 22:01:58 s_a_white + * New clock speed & sid model interface. + * + * Revision 1.38 2002/02/17 16:33:02 s_a_white + * New reset interface for sidbuilders. + * + * Revision 1.37 2002/02/17 12:42:45 s_a_white + * envReset now sets playerStopped indicators. This means the player + * nolonger locks up when a HLT instruction is encountered. + * + * Revision 1.36 2002/02/06 20:12:03 s_a_white + * Added sidplay1 random extension for vic reads. + * + * Revision 1.35 2002/01/29 21:50:33 s_a_white + * Auto switching to a better emulation mode. m_tuneInfo reloaded after a + * config. Initial code added to support more than two sids. + * + * Revision 1.34 2002/01/14 23:16:27 s_a_white + * Prevent multiple initialisations if already stopped. + * + * Revision 1.33 2001/12/13 08:28:08 s_a_white + * Added namespace support to fix problems with xsidplay. + * + * Revision 1.32 2001/11/16 19:25:33 s_a_white + * Removed m_context as where getting mixed with parent class. + * + * Revision 1.31 2001/10/18 22:33:40 s_a_white + * Initialisation order fixes. + * + * Revision 1.30 2001/10/02 18:26:36 s_a_white + * Removed ReSID support and updated for new scheduler. + * + * Revision 1.29 2001/09/17 19:02:38 s_a_white + * Now uses fixed point maths for sample output and rtc. + * + * Revision 1.28 2001/09/04 18:50:57 s_a_white + * Fake CIA address now masked. + * + * Revision 1.27 2001/09/01 11:15:46 s_a_white + * Fixes sidplay1 environment modes. + * + * Revision 1.26 2001/08/10 20:04:46 s_a_white + * Initialise requires rtc reset for correct use with stop operation. + * + * Revision 1.25 2001/07/27 12:51:55 s_a_white + * Removed warning. + * + * Revision 1.24 2001/07/25 17:01:13 s_a_white + * Support for new configuration interface. + * + * Revision 1.23 2001/07/14 16:46:16 s_a_white + * Sync with sidbuilder class project. + * + * Revision 1.22 2001/07/14 12:56:15 s_a_white + * SID caching no longer needed. IC components now run using event + * generation (based on VICE). Handling of IRQs now more effecient. All + * sidplay1 hacks either removed or moved to sid6510. Fixed PAL/NTSC + * speeding fixing. Now uses new component and sidbuilder classes. + * + * Revision 1.21 2001/04/23 17:09:56 s_a_white + * Fixed video speed selection using unforced/forced and NTSC clockSpeeds. + * + * Revision 1.20 2001/03/26 21:46:43 s_a_white + * Removed unused #include. + * + * Revision 1.19 2001/03/25 19:48:13 s_a_white + * xsid.reset added. + * + * Revision 1.18 2001/03/22 22:45:20 s_a_white + * Re-ordered initialisations to match defintions. + * + * Revision 1.17 2001/03/21 22:32:34 s_a_white + * Filter redefinition support. VIC & NMI support added. Moved fake interrupts + * to sid6510 class. + * + * Revision 1.16 2001/03/09 22:26:36 s_a_white + * Support for updated C64 player. + * + * Revision 1.15 2001/03/08 22:46:42 s_a_white + * playAddr = 0xffff now better supported. + * + * Revision 1.14 2001/03/01 23:46:37 s_a_white + * Support for sample mode to be selected at runtime. + * + * Revision 1.13 2001/02/28 18:55:27 s_a_white + * Removed initBank* related stuff. IRQ terminating ROM jumps at 0xea31, + * 0xea7e and 0xea81 now handled. + * + * Revision 1.12 2001/02/21 21:43:10 s_a_white + * Now use VSID code and this handles interrupts much better! The whole + * initialise sequence has been modified to support this. + * + * Revision 1.11 2001/02/13 21:01:14 s_a_white + * Support for real interrupts. C64 Initialisation routine now run from Player::play + * instead of Player::initialise. Prevents lockups if init routine does not return. + * + * Revision 1.10 2001/02/08 17:21:14 s_a_white + * Initial SID volumes not being stored in cache. Fixes Dulcedo Cogitationis. + * + * Revision 1.9 2001/02/07 20:56:46 s_a_white + * Samples now delayed until end of simulated frame. + * + * Revision 1.8 2001/01/23 21:26:28 s_a_white + * Only way to load a tune now is by passing in a sidtune object. This is + * required for songlength database support. + * + * Revision 1.7 2001/01/07 15:13:39 s_a_white + * Hardsid update to mute sids when program exits. + * + * Revision 1.6 2000/12/21 22:48:27 s_a_white + * Re-order voices for mono to stereo conversion to match sidplay1. + * + * Revision 1.5 2000/12/14 23:53:36 s_a_white + * Small optimisation update, and comment revision. + * + * Revision 1.4 2000/12/13 17:56:24 s_a_white + * Interrupt vector address changed from 0x315 to 0x314. + * + * Revision 1.3 2000/12/13 12:00:25 mschwendt + * Corrected order of members in member initializer-list. + * + * Revision 1.2 2000/12/12 22:50:15 s_a_white + * Bug Fix #122033. + * + ***************************************************************************/ + +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include "config.h" +#include "sidendian.h" +#include "player.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif + +static const uint8_t kernal[] = { +#include "kernal.bin" +}; + +SIDPLAY2_NAMESPACE_START + +const double Player::CLOCK_FREQ_NTSC = 1022727.14; +const double Player::CLOCK_FREQ_PAL = 985248.4; +const double Player::VIC_FREQ_PAL = 50.0; +const double Player::VIC_FREQ_NTSC = 60.0; + +// These texts are used to override the sidtune settings. +const char *Player::TXT_PAL_VBI = "50 Hz VBI (PAL)"; +const char *Player::TXT_PAL_VBI_FIXED = "60 Hz VBI (PAL FIXED)"; +const char *Player::TXT_PAL_CIA = "CIA (PAL)"; +const char *Player::TXT_PAL_UNKNOWN = "UNKNOWN (PAL)"; +const char *Player::TXT_NTSC_VBI = "60 Hz VBI (NTSC)"; +const char *Player::TXT_NTSC_VBI_FIXED = "50 Hz VBI (NTSC FIXED)"; +const char *Player::TXT_NTSC_CIA = "CIA (NTSC)"; +const char *Player::TXT_NTSC_UNKNOWN = "UNKNOWN (NTSC)"; +const char *Player::TXT_NA = "NA"; + +// Error Strings +const char *Player::ERR_CONF_WHILST_ACTIVE = "SIDPLAYER ERROR: Trying to configure player whilst active."; +const char *Player::ERR_UNSUPPORTED_FREQ = "SIDPLAYER ERROR: Unsupported sampling frequency."; +const char *Player::ERR_UNSUPPORTED_PRECISION = "SIDPLAYER ERROR: Unsupported sample precision."; +const char *Player::ERR_MEM_ALLOC = "SIDPLAYER ERROR: Memory Allocation Failure."; +const char *Player::ERR_UNSUPPORTED_MODE = "SIDPLAYER ERROR: Unsupported Environment Mode (Coming Soon)."; + +const char *Player::credit[]; + + +// Set the ICs environment variable to point to +// this player +Player::Player (void) +// Set default settings for system +:c64env (&m_scheduler), + m_scheduler ("SIDPlay 2"), + sid6510 (&m_scheduler), + mos6510 (&m_scheduler), + cpu (&sid6510), + xsid (this, &nullsid), + cia (this), + cia2 (this), + sid6526 (this), + vic (this), + mixerEvent (this), + rtc (&m_scheduler), + m_tune (NULL), + m_ram (NULL), + m_rom (NULL), + m_errorString (TXT_NA), + m_fastForwardFactor (1.0), + m_mileage (0), + m_playerState (sid2_stopped), + m_running (false), + m_sampleCount (0) +{ + srand ((uint) ::time(NULL)); + m_rand = (uint_least32_t) rand (); + + // Set the ICs to use this environment + sid6510.setEnvironment (this); + mos6510.setEnvironment (this); + + // SID Initialise + for (int i = 0; i < SID2_MAX_SIDS; i++) + sid[i] = &nullsid; + xsid.emulation(sid[0]); + sid[0] = &xsid; + + // Setup exported info + m_info.credits = credit; + m_info.channels = 1; + m_info.driverAddr = 0; + m_info.driverLength = 0; + m_info.name = PACKAGE; + m_info.tuneInfo = NULL; + m_info.version = VERSION; + m_info.eventContext = &context(); + // Number of SIDs support by this library + m_info.maxsids = SID2_MAX_SIDS; + m_info.environment = sid2_envR; + + // Configure default settings + m_cfg.clockDefault = SID2_CLOCK_CORRECT; + m_cfg.clockForced = false; + m_cfg.clockSpeed = SID2_CLOCK_CORRECT; + m_cfg.environment = m_info.environment; + m_cfg.forceDualSids = false; + m_cfg.frequency = SID2_DEFAULT_SAMPLING_FREQ; + m_cfg.optimisation = SID2_DEFAULT_OPTIMISATION; + m_cfg.playback = sid2_mono; + m_cfg.precision = SID2_DEFAULT_PRECISION; + m_cfg.sidDefault = SID2_MODEL_CORRECT; + m_cfg.sidEmulation = NULL; + m_cfg.sidModel = SID2_MODEL_CORRECT; + m_cfg.sidSamples = true; + m_cfg.leftVolume = 255; + m_cfg.rightVolume = 255; + m_cfg.sampleFormat = SID2_LITTLE_SIGNED; + + // Configured by default for Sound Blaster (compatibles) + if (SID2_DEFAULT_PRECISION == 8) + m_cfg.sampleFormat = SID2_LITTLE_UNSIGNED; + config (m_cfg); + + // Get component credits + credit[0] = PACKAGE " V" VERSION " Engine:\0\tCopyright (C) 2000 Simon White <sidplay2@email.com>\0"; + credit[1] = xsid.credits (); + credit[2] = "*MOS6510 (CPU) Emulation:\0\tCopyright (C) 2000 Simon White <sidplay2@email.com>\0"; + credit[3] = cia.credits (); + credit[4] = vic.credits (); + credit[5] = NULL; +} + +// Makes the next sequence of notes available. For sidplay compatibility +// this function should be called from interrupt event +void Player::fakeIRQ (void) +{ // Check to see if the play address has been provided or whether + // we should pick it up from an IRQ vector + uint_least16_t playAddr = m_tuneInfo.playAddr; + + // We have to reload the new play address + if (playAddr) + evalBankSelect (m_playBank); + else + { + if (isKernal) + { // Setup the entry point from hardware IRQ + playAddr = endian_little16 (&m_ram[0x0314]); + } + else + { // Setup the entry point from software IRQ + playAddr = endian_little16 (&m_ram[0xFFFF]); + } + } + + // Setup the entry point and restart the cpu + cpu->triggerIRQ (); + sid6510.reset (playAddr, 0, 0, 0); +} + +int Player::fastForward (uint percent) +{ + if (percent > 3200) + { + m_errorString = "SIDPLAYER ERROR: Percentage value out of range"; + return -1; + } + { + float64_t fastForwardFactor; + fastForwardFactor = (float64_t) percent / 100.0; + // Conversion to fixed point 8.24 + m_samplePeriod = (event_clock_t) ((float64_t) m_samplePeriod / + m_fastForwardFactor * fastForwardFactor); + m_fastForwardFactor = fastForwardFactor; + } + return 0; +} + +int Player::initialise () +{ // Fix the mileage counter if just finished another song. + mileageCorrect (); + m_mileage += time (); + + reset (); + if (psidDrvInstall (m_tuneInfo, m_info) < 0) + return -1; + + // The Basic ROM sets these values on loading a file. + { // Program start address + uint_least16_t addr = m_tuneInfo.loadAddr; + endian_little16 (&m_ram[0x2b], addr); + // Program end address + 1 + addr += m_tuneInfo.c64dataLen; + endian_little16 (&m_ram[0x2d], addr); + } + + if (!m_tune->placeSidTuneInC64mem (m_ram)) + { // Rev 1.6 (saw) - Allow loop through errors + m_errorString = m_tuneInfo.statusString; + return -1; + } + + rtc.reset (); + envReset (false); + return 0; +} + +int Player::load (SidTune *tune) +{ + m_tune = tune; + if (!tune) + { // Unload tune + m_info.tuneInfo = NULL; + return 0; + } + m_info.tuneInfo = &m_tuneInfo; + + // Un-mute all voices + xsid.mute (false); + + for (int i = 0; i < SID2_MAX_SIDS; i++) + { + uint_least8_t v = 3; + while (v--) + sid[i]->voice (v, 0, false); + } + + { // Must re-configure on fly for stereo support! + int ret = config (m_cfg); + // Failed configuration with new tune, reject it + if (ret < 0) + { + m_tune = NULL; + return -1; + } + } + return 0; +} + +void Player::mileageCorrect (void) +{ // If just finished a song, round samples to correct mileage + if (m_sampleCount >= (m_cfg.frequency / 2)) + m_mileage++; + m_sampleCount = 0; +} + +void Player::pause (void) +{ + if (m_running) + { + m_playerState = sid2_paused; + m_running = false; + } +} + +uint_least32_t Player::play (void *buffer, uint_least32_t length) +{ + // Make sure a _tune is loaded + if (!m_tune) + return 0; + + // Setup Sample Information + m_sampleIndex = 0; + m_sampleCount = length; + m_sampleBuffer = (char *) buffer; + + // Start the player loop + m_playerState = sid2_playing; + m_running = true; + + while (m_running) + m_scheduler.clock (); + + if (m_playerState == sid2_stopped) + initialise (); + return m_sampleIndex; +} + +void Player::stop (void) +{ // Re-start song + if (m_tune && (m_playerState != sid2_stopped)) + { + if (!m_running) + initialise (); + else + { + m_playerState = sid2_stopped; + m_running = false; + } + } +} + + +//------------------------------------------------------------------------- +// Temporary hack till real bank switching code added + +// Input: A 16-bit effective address +// Output: A default bank-select value for $01. +uint8_t Player::iomap (uint_least16_t addr) +{ + if (m_info.environment != sid2_envPS) + { // Force Real C64 Compatibility + if (m_tuneInfo.compatibility == SIDTUNE_COMPATIBILITY_R64) + return 0; // Special case, converted to 0x37 later + + if (addr == 0) + return 0; // Special case, converted to 0x37 later + if (addr < 0xa000) + return 0x37; // Basic-ROM, Kernal-ROM, I/O + if (addr < 0xd000) + return 0x36; // Kernal-ROM, I/O + if (addr >= 0xe000) + return 0x35; // I/O only + } + return 0x34; // RAM only (special I/O in PlaySID mode) +} + +void Player::evalBankSelect (uint8_t data) +{ // Determine new memory configuration. + isBasic = ((data & 3) == 3); + isIO = ((data & 7) > 4); + isKernal = ((data & 2) != 0); + m_bankReg = data; +} + +uint8_t Player::readMemByte_player (uint_least16_t addr) +{ + if (m_info.environment == sid2_envR) + return readMemByte_sidplaybs (addr); + return readMemByte_plain (addr); +} + +uint8_t Player::readMemByte_plain (uint_least16_t addr) +{ // Bank Select Register Value DOES NOT get to ram + if (addr == 0x0001) + return m_bankReg; + return m_ram[addr]; +} + +uint8_t Player::readMemByte_io (uint_least16_t addr) +{ + uint_least16_t tempAddr = (addr & 0xfc1f); + + // Not SID ? + if (( tempAddr & 0xff00 ) != 0xd400 ) + { + if (m_info.environment == sid2_envR) + { + switch (endian_16hi8 (addr)) + { + case 0: + return readMemByte_plain (addr); + case 0xdc: + return cia.read (addr&0x0f); + case 0xdd: + return cia2.read (addr&0x0f); + case 0xd0: + return vic.read (addr&0x3f); + default: + return m_rom[addr]; + } + } + else + { + switch (endian_16hi8 (addr)) + { + case 0: + return readMemByte_plain (addr); + // Sidplay1 Random Extension CIA + case 0xdc: + return sid6526.read (addr&0x0f); + // Sidplay1 Random Extension VIC + case 0xd0: + switch (addr & 0x3f) + { + case 0x11: + case 0x12: + return sid6526.read ((addr-13)&0x0f); + } + // Deliberate run on + default: + return m_rom[addr]; + } + } + } + + // Read real sid for these + if ((addr & 0xff00) == m_sidAddress[1]) + return sid[1]->read ((uint8_t) addr); + return sid[0]->read ((uint8_t) tempAddr); +} + +uint8_t Player::readMemByte_sidplaytp(uint_least16_t addr) +{ + if (addr < 0xD000) + return readMemByte_plain (addr); + else + { + // Get high-nibble of address. + switch (addr >> 12) + { + case 0xd: + if (isIO) + return readMemByte_io (addr); + else + return m_ram[addr]; + break; + case 0xe: + case 0xf: + default: // <-- just to please the compiler + return m_ram[addr]; + } + } +} + +uint8_t Player::readMemByte_sidplaybs (uint_least16_t addr) +{ + if (addr < 0xA000) + return readMemByte_plain (addr); + else + { + // Get high-nibble of address. + switch (addr >> 12) + { + case 0xa: + case 0xb: + if (isBasic) + return m_rom[addr]; + else + return m_ram[addr]; + break; + case 0xc: + return m_ram[addr]; + break; + case 0xd: + if (isIO) + return readMemByte_io (addr); + else + return m_ram[addr]; + break; + case 0xe: + case 0xf: + default: // <-- just to please the compiler + if (isKernal) + return m_rom[addr]; + else + return m_ram[addr]; + } + } +} + +void Player::writeMemByte_plain (uint_least16_t addr, uint8_t data) +{ + if (addr == 0x0001) + { // Determine new memory configuration. + evalBankSelect (data); + return; + } + m_ram[addr] = data; +} + +void Player::writeMemByte_playsid (uint_least16_t addr, uint8_t data) +{ + uint_least16_t tempAddr = (addr & 0xfc1f); + + // Not SID ? + if (( tempAddr & 0xff00 ) != 0xd400 ) + { + if (m_info.environment == sid2_envR) + { + switch (endian_16hi8 (addr)) + { + case 0: + writeMemByte_plain (addr, data); + return; + case 0xdc: + cia.write (addr&0x0f, data); + return; + case 0xdd: + cia2.write (addr&0x0f, data); + return; + case 0xd0: + vic.write (addr&0x3f, data); + return; + default: + m_rom[addr] = data; + return; + } + } + else + { + switch (endian_16hi8 (addr)) + { + case 0: + writeMemByte_plain (addr, data); + return; + case 0xdc: // Sidplay1 CIA + sid6526.write (addr&0x0f, data); + return; + default: + m_rom[addr] = data; + return; + } + } + } + + // $D41D/1E/1F, $D43D/3E/3F, ... + // Map to real address to support PlaySID + // Extended SID Chip Registers. + if (( tempAddr & 0x00ff ) >= 0x001d ) + xsid.write16 (addr & 0x01ff, data); + else // Mirrored SID. + { // SID. + // Convert address to that acceptable by resid + // Support dual sid + if ((addr & 0xff00) == m_sidAddress[1]) + { + sid[1]->write (addr & 0xff, data); + // Prevent sid write accessing other sid + // if not doing mono to stereo conversion. + if (m_sidAddress[1] != m_sidAddress[0]) + return; + } + sid[0]->write (tempAddr & 0xff, data); + } +} + +void Player::writeMemByte_sidplay (uint_least16_t addr, uint8_t data) +{ + if (addr < 0xA000) + writeMemByte_plain (addr, data); + else + { + // Get high-nibble of address. + switch (addr >> 12) + { + case 0xa: + case 0xb: + case 0xc: + m_ram[addr] = data; + break; + case 0xd: + if (isIO) + writeMemByte_playsid (addr, data); + else + m_ram[addr] = data; + break; + case 0xe: + case 0xf: + default: // <-- just to please the compiler + m_ram[addr] = data; + } + } +} + +// -------------------------------------------------- +// These must be available for use: +void Player::reset (void) +{ + int i; + + m_playerState = sid2_stopped; + m_running = false; + + // Select Sidplay1 compatible CPU or real thing + cpu = &sid6510; + sid6510.environment (m_info.environment); + + m_scheduler.reset (); + for (i = 0; i < SID2_MAX_SIDS; i++) + sid[i]->reset (0x0f); + + if (m_info.environment == sid2_envR) + { + cia.reset (); + cia2.reset (); + vic.reset (); + } + else + { + sid6526.reset (); + sid6526.write (0x0e, 1); // Start timer + if (m_tuneInfo.songSpeed == SIDTUNE_SPEED_VBI) + sid6526.lock (); + } + + // Initalise Memory + memset (m_ram, 0, 0x10000); + memset (m_rom, 0, 0x10000); + if (m_info.environment != sid2_envPS) + memset (m_rom + 0xA000, RTSn, 0x2000); + + if (m_info.environment == sid2_envR) + { + memcpy (&m_rom[0xe000], kernal, sizeof (kernal)); + // Since we don't yet run the kernal power up + // routines, set somethings here. + endian_little16 (&m_ram[0x028f], 0xEB48); // keyboard poll + m_rom[0xfd69] = 0x9f; // Bypass memory check + m_rom[0xe55f] = 0x00; // Bypass screen clear + endian_little16 (&m_rom[0xa000], 0xA004); + endian_little16 (&m_rom[0xa002], 0xA004); + m_rom[0xa004] = JMPw; + endian_little16 (&m_rom[0xa005], 0xA004); + } + else // !sid2_envR + { + memset (m_rom + 0xE000, RTSn, 0x2000); + // fake VBI-interrupts that do $D019, BMI ... + m_rom[0x0d019] = 0xff; + if (m_info.environment == sid2_envPS) + { + m_ram[0xff48] = JMPi; + endian_little16 (&m_ram[0xff49], 0x0314); + } + + // Software vectors + endian_little16 (&m_ram[0x0314], 0xEA31); // IRQ + endian_little16 (&m_ram[0x0316], 0xFE66); // BRK + endian_little16 (&m_ram[0x0318], 0xFE47); // NMI + // Hardware vectors + if (m_info.environment == sid2_envPS) + endian_little16 (&m_rom[0xfffa], 0xFFFA); // NMI + else + endian_little16 (&m_rom[0xfffa], 0xFE43); // NMI + endian_little16 (&m_rom[0xfffc], 0xFCE2); // RESET + endian_little16 (&m_rom[0xfffe], 0xFF48); // IRQ + memcpy (&m_ram[0xfffa], &m_rom[0xfffa], 6); + } + + // Will get done later if can't now + if (m_tuneInfo.clockSpeed == SIDTUNE_CLOCK_PAL) + m_ram[0x02a6] = 1; + else // SIDTUNE_CLOCK_NTSC + m_ram[0x02a6] = 0; +} + +// This resets the cpu once the program is loaded to begin +// running. Also called when the emulation crashes +void Player::envReset (bool safe) +{ + if (safe) + { // Emulation crashed so run in safe mode + uint8_t prg[] = {LDAb, 0x7f, STAa, 0x0d, 0xdc, RTSn}; + sid2_info_t info; + SidTuneInfo tuneInfo; + // Install driver + tuneInfo.relocStartPage = 0x09; + tuneInfo.relocPages = 0x20; + tuneInfo.initAddr = 0x0800; + tuneInfo.songSpeed = SIDTUNE_SPEED_CIA_1A; + info.environment = m_info.environment; + psidDrvInstall (tuneInfo, info); + // Install prg + memcpy (&m_ram[0x0800], prg, sizeof (prg)); + + // Make sids silent + for (int i = 0; i < SID2_MAX_SIDS; i++) + sid[i]->reset (0); + } + + m_ram[0] = 0x2F; + evalBankSelect (0x37); + // defaults: Basic-ROM on, Kernal-ROM on, I/O on + if (m_info.environment != sid2_envR) + { + uint8_t song = m_tuneInfo.currentSong - 1; + uint8_t bank = iomap (m_tuneInfo.initAddr); + if (bank == 0) + bank = 0x37; + evalBankSelect (bank); + m_playBank = iomap (m_tuneInfo.playAddr); + if (m_info.environment != sid2_envPS) + sid6510.reset (m_tuneInfo.initAddr, song, 0, 0); + else + sid6510.reset (m_tuneInfo.initAddr, song, song, song); + } + else + cpu->reset (); + + mixerReset (); + xsid.suppress (true); +} + +uint8_t Player::envReadMemByte (uint_least16_t addr) +{ // Read from plain only to prevent execution of rom code + return (this->*(m_readMemByte)) (addr); +} + +void Player::envWriteMemByte (uint_least16_t addr, uint8_t data) +{ // Writes must be passed to env version. + (this->*(m_writeMemByte)) (addr, data); +} + +uint8_t Player::envReadMemDataByte (uint_least16_t addr) +{ // Read from plain only to prevent execution of rom code + return (this->*(m_readMemDataByte)) (addr); +} + +bool Player::envCheckBankJump (uint_least16_t addr) +{ + switch (m_info.environment) + { + case sid2_envBS: + if (addr >= 0xA000) + { + // Get high-nibble of address. + switch (addr >> 12) + { + case 0xa: + case 0xb: + if (isBasic) + return false; + break; + + case 0xc: + break; + + case 0xd: + if (isIO) + return false; + break; + + case 0xe: + case 0xf: + default: // <-- just to please the compiler + if (isKernal) + return false; + break; + } + } + break; + + case sid2_envTP: + if ((addr >= 0xd000) && isKernal) + return false; + break; + + default: + break; + } + + return true; +} + +SIDPLAY2_NAMESPACE_STOP diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/player.h b/sid/sidplay-libs-2.1.0/libsidplay/src/player.h new file mode 100644 index 00000000..e50a3412 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/player.h @@ -0,0 +1,434 @@ + /*************************************************************************** + player.h - description + ------------------- + begin : Fri Jun 9 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: player.h,v $ + * Revision 1.39 2002/12/03 23:25:53 s_a_white + * Prevent PSID digis from playing in real C64 mode. + * + * Revision 1.38 2002/11/27 00:16:51 s_a_white + * Make sure driver info gets reset and exported properly. + * + * Revision 1.37 2002/11/20 21:44:34 s_a_white + * Initial support for external DMA to steal cycles away from the CPU. + * + * Revision 1.36 2002/11/19 22:55:50 s_a_white + * PSIDv2NG/RSID changes to deal with spec updates for recommended + * implementation. + * + * Revision 1.35 2002/11/01 17:36:01 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.34 2002/10/02 19:45:23 s_a_white + * RSID support. + * + * Revision 1.33 2002/09/12 21:01:31 s_a_white + * Added support for simulating the random delay before the user loads a + * program on a real C64. + * + * Revision 1.32 2002/09/09 18:01:30 s_a_white + * Prevent m_info driver details getting modified when C64 crashes. + * + * Revision 1.31 2002/07/21 19:39:41 s_a_white + * Proper error handling of reloc info overlapping load image. + * + * Revision 1.30 2002/07/20 08:34:52 s_a_white + * Remove unnecessary and pointless conts. + * + * Revision 1.29 2002/07/17 21:48:10 s_a_white + * PSIDv2NG reloc exclude region extension. + * + * Revision 1.28 2002/04/14 21:46:50 s_a_white + * PlaySID reads fixed to come from RAM only. + * + * Revision 1.27 2002/03/12 18:43:59 s_a_white + * Tidy up handling of envReset on illegal CPU instructions. + * + * Revision 1.26 2002/03/03 22:01:58 s_a_white + * New clock speed & sid model interface. + * + * Revision 1.25 2002/01/29 21:50:33 s_a_white + * Auto switching to a better emulation mode. m_tuneInfo reloaded after a + * config. Initial code added to support more than two sids. + * + * Revision 1.24 2002/01/28 19:32:01 s_a_white + * PSID sample improvements. + * + * Revision 1.23 2001/12/13 08:28:08 s_a_white + * Added namespace support to fix problems with xsidplay. + * + * Revision 1.22 2001/10/18 22:34:04 s_a_white + * GCC3 fixes. + * + * Revision 1.21 2001/10/02 18:26:36 s_a_white + * Removed ReSID support and updated for new scheduler. + * + * Revision 1.20 2001/09/20 19:32:39 s_a_white + * Support for a null sid emulation to use when a builder create call fails. + * + * Revision 1.19 2001/09/17 19:02:38 s_a_white + * Now uses fixed point maths for sample output and rtc. + * + * Revision 1.18 2001/09/01 11:15:46 s_a_white + * Fixes sidplay1 environment modes. + * + * Revision 1.17 2001/08/10 21:01:06 s_a_white + * Fixed RTC initialisation order warning. + * + * Revision 1.16 2001/08/10 20:03:19 s_a_white + * Added RTC reset. + * + * Revision 1.15 2001/07/25 17:01:13 s_a_white + * Support for new configuration interface. + * + * Revision 1.14 2001/07/14 16:46:16 s_a_white + * Sync with sidbuilder class project. + * + * Revision 1.13 2001/07/14 12:50:58 s_a_white + * Support for credits and debuging. External filter selection removed. RTC + * and samples obtained in a more efficient way. Support for component + * and sidbuilder classes. + * + * Revision 1.12 2001/04/23 17:09:56 s_a_white + * Fixed video speed selection using unforced/forced and NTSC clockSpeeds. + * + * Revision 1.11 2001/03/22 22:45:20 s_a_white + * Re-ordered initialisations to match defintions. + * + * Revision 1.10 2001/03/21 23:28:12 s_a_white + * Support new component names. + * + * Revision 1.9 2001/03/21 22:32:55 s_a_white + * Filter redefinition support. VIC & NMI support added. + * + * Revision 1.8 2001/03/08 22:48:33 s_a_white + * Sid reset on player destruction removed. Now handled locally by the sids. + * + * Revision 1.7 2001/03/01 23:46:37 s_a_white + * Support for sample mode to be selected at runtime. + * + * Revision 1.6 2001/02/28 18:52:55 s_a_white + * Removed initBank* related stuff. + * + * Revision 1.5 2001/02/21 21:41:51 s_a_white + * Added seperate ram bank to hold C64 player. + * + * Revision 1.4 2001/02/07 20:56:46 s_a_white + * Samples now delayed until end of simulated frame. + * + * Revision 1.3 2001/01/23 21:26:28 s_a_white + * Only way to load a tune now is by passing in a sidtune object. This is + * required for songlength database support. + * + * Revision 1.2 2001/01/07 15:58:37 s_a_white + * SID2_LIB_API now becomes a core define (SID_API). + * + * Revision 1.1 2000/12/12 19:15:40 s_a_white + * Renamed from sidplayer + * + ***************************************************************************/ + +#ifndef _player_h_ +#define _player_h_ + +#include <string.h> + +#include "config.h" +#include "sidplay2.h" +#include "sidenv.h" +#include "c64env.h" +#include "c64/c64xsid.h" +#include "c64/c64cia.h" +#include "c64/c64vic.h" + +#include "mos6510/mos6510.h" +#include "sid6526/sid6526.h" +#include "nullsid.h" +#define SID2_MAX_SIDS 2 + +SIDPLAY2_NAMESPACE_START + +class Player: private C64Environment, c64env +{ +private: + static const double CLOCK_FREQ_NTSC; + static const double CLOCK_FREQ_PAL; + static const double VIC_FREQ_PAL; + static const double VIC_FREQ_NTSC; + + static const char *TXT_PAL_VBI; + static const char *TXT_PAL_VBI_FIXED; + static const char *TXT_PAL_CIA; + static const char *TXT_PAL_UNKNOWN; + static const char *TXT_NTSC_VBI; + static const char *TXT_NTSC_VBI_FIXED; + static const char *TXT_NTSC_CIA; + static const char *TXT_NTSC_UNKNOWN; + static const char *TXT_NA; + + static const char *ERR_CONF_WHILST_ACTIVE; + static const char *ERR_UNSUPPORTED_FREQ; + static const char *ERR_UNSUPPORTED_PRECISION; + static const char *ERR_MEM_ALLOC; + static const char *ERR_UNSUPPORTED_MODE; + static const char *credit[10]; // 10 credits max + + static const char *ERR_PSIDDRV_NO_SPACE; + static const char *ERR_PSIDDRV_RELOC; + + EventScheduler m_scheduler; + + //SID6510 cpu(6510, "Main CPU"); + SID6510 sid6510; + MOS6510 mos6510; + MOS6510 *cpu; + // Sid objects to use. + NullSID nullsid; + c64xsid xsid; + c64cia1 cia; + c64cia2 cia2; + SID6526 sid6526; + c64vic vic; + sidemu *sid[SID2_MAX_SIDS]; + + class EventMixer: public Event + { + private: + Player &m_player; + void event (void) { m_player.mixer (); } + + public: + EventMixer (Player *player) + :Event("Mixer"), + m_player(*player) {} + } mixerEvent; + friend class EventMixer; + + class EventRTC: public Event + { + private: + EventContext &m_eventContext; + event_clock_t m_seconds; + event_clock_t m_period; + event_clock_t m_clk; + + void event (void) + { // Fixed point 25.7 (approx 2 dp) + event_clock_t cycles; + m_clk += m_period; + cycles = m_clk >> 7; + m_clk &= 0x7F; + m_seconds++; + m_eventContext.schedule (this, cycles); + } + + public: + EventRTC (EventContext *context) + :Event("RTC"), + m_eventContext(*context), + m_seconds(0) + {;} + + event_clock_t getTime () const {return m_seconds;} + + void reset (void) + { // Fixed point 25.7 + m_seconds = 0; + m_clk = m_period & 0x7F; + m_eventContext.schedule (this, m_period >> 7); + } + + void clock (float64_t period) + { // Fixed point 25.7 + m_period = (event_clock_t) (period / 10.0 * (float64_t) (1 << 7)); + reset (); + } + } rtc; + + // User Configuration Settings + SidTuneInfo m_tuneInfo; + SidTune *m_tune; + uint8_t *m_ram, *m_rom; + sid2_info_t m_info; + sid2_config_t m_cfg; + + const char *m_errorString; + float64_t m_fastForwardFactor; + uint_least32_t m_mileage; + int_least32_t m_leftVolume; + int_least32_t m_rightVolume; + volatile sid2_player_t m_playerState; + volatile bool m_running; + int m_rand; + + // Mixer settings + event_clock_t m_sampleClock; + event_clock_t m_samplePeriod; + uint_least32_t m_sampleCount; + uint_least32_t m_sampleIndex; + char *m_sampleBuffer; + + // C64 environment settings + uint8_t m_bankReg; + uint8_t m_playBank; + uint_least16_t m_sidAddress[2]; + + // temp stuff ------------- + bool isKernal; + bool isBasic; + bool isIO; + inline void evalBankSelect (uint8_t data); + void c64_initialise (void); + // ------------------------ + +private: + float64_t clockSpeed (sid2_clock_t clock, sid2_clock_t defaultClock, + bool forced); + int environment (sid2_env_t env); + void fakeIRQ (void); + int initialise (void); + void nextSequence (void); + void mixer (void); + void mixerReset (void); + void mileageCorrect (void); + int sidCreate (sidbuilder *builder, sid2_model_t model, + sid2_model_t defaultModel); + void sidSamples (bool enable); + void reset (); + uint8_t iomap (uint_least16_t addr); + + uint8_t readMemByte_player (uint_least16_t addr); + uint8_t readMemByte_plain (uint_least16_t addr); + uint8_t readMemByte_io (uint_least16_t addr); + uint8_t readMemByte_sidplaytp (uint_least16_t addr); + uint8_t readMemByte_sidplaybs (uint_least16_t addr); + void writeMemByte_plain (uint_least16_t addr, uint8_t data); + void writeMemByte_playsid (uint_least16_t addr, uint8_t data); + void writeMemByte_sidplay (uint_least16_t addr, uint8_t data); + + // Use pointers to please requirements of all the provided + // environments. + uint8_t (Player::*m_readMemByte) (uint_least16_t); + void (Player::*m_writeMemByte) (uint_least16_t, uint8_t); + uint8_t (Player::*m_readMemDataByte)(uint_least16_t); + + uint8_t readMemRamByte (uint_least16_t addr) + { return m_ram[addr]; } + + // Environment Function entry Points + void envReset (bool safe); + inline void envReset (void) { envReset (true); } + inline uint8_t envReadMemByte (uint_least16_t addr); + inline void envWriteMemByte (uint_least16_t addr, uint8_t data); + inline bool envCheckBankJump (uint_least16_t addr); + inline uint8_t envReadMemDataByte (uint_least16_t addr); + inline void envSleep (void); + + void envLoadFile (char *file) + { + char name[0x100] = "e:/emulators/c64/games/prgs/"; + strcat (name, file); + strcat (name, ".sid"); + m_tune->load (name); + stop (); + } + + // Rev 2.0.3 Added - New Mixer Routines + uint_least32_t (Player::*output) (char *buffer); + + // Rev 2.0.4 (saw) - Added to reduce code size + int_least32_t monoOutGenericLeftIn (uint_least8_t bits); + int_least32_t monoOutGenericStereoIn (uint_least8_t bits); + int_least32_t monoOutGenericRightIn (uint_least8_t bits); + + // 8 bit output + uint_least32_t monoOut8MonoIn (char *buffer); + uint_least32_t monoOut8StereoIn (char *buffer); + uint_least32_t monoOut8StereoRIn (char *buffer); + uint_least32_t stereoOut8MonoIn (char *buffer); + uint_least32_t stereoOut8StereoIn (char *buffer); + + // Rev 2.0.4 (jp) - Added 16 bit support + uint_least32_t monoOut16MonoIn (char *buffer); + uint_least32_t monoOut16StereoIn (char *buffer); + uint_least32_t monoOut16StereoRIn (char *buffer); + uint_least32_t stereoOut16MonoIn (char *buffer); + uint_least32_t stereoOut16StereoIn (char *buffer); + + void interruptIRQ (bool state); + void interruptNMI (void); + void interruptRST (void); + void signalBA (bool state) { cpu->rdySignal (state); } + void signalAEC (bool state) { cpu->aecSignal (state); } + + // PSID driver + int psidDrvInstall (SidTuneInfo &tuneInfo, sid2_info_t &info); + void psidRelocAddr (SidTuneInfo &tuneInfo, int startp, int endp); + +public: + Player (); + + const sid2_config_t &config (void) const { return m_cfg; } + const sid2_info_t &info (void) const { return m_info; } + + int config (const sid2_config_t &cfg); + int fastForward (uint percent); + int load (SidTune *tune); + uint_least8_t mileage (void) const { return m_mileage + time(); } + void pause (void); + uint_least32_t play (void *buffer, uint_least32_t length); + sid2_player_t state (void) const { return m_playerState; } + void stop (void); + uint_least32_t time (void) const {return rtc.getTime (); } + void debug (bool enable) { cpu->debug (enable); } + const char *error (void) const { return m_errorString; } +}; + +inline void Player::envSleep (void) +{ + if (m_info.environment != sid2_envR) + { // Start the sample sequence + xsid.suppress (false); + xsid.suppress (true); + } +} + +inline void Player::interruptIRQ (bool state) +{ + if (state) + { + if (m_info.environment == sid2_envR) + cpu->triggerIRQ (); + else + fakeIRQ (); + } + else + cpu->clearIRQ (); +} + +inline void Player::interruptNMI () +{ + cpu->triggerNMI (); +} + +inline void Player::interruptRST () +{ + stop (); +} + +SIDPLAY2_NAMESPACE_STOP + +#endif // _player_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/poweron.bin b/sid/sidplay-libs-2.1.0/libsidplay/src/poweron.bin new file mode 100644 index 00000000..b5850151 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/poweron.bin @@ -0,0 +1,79 @@ +0x9a, 0x03,
+0x18, 0x3c,
+0x01, 0x03,
+0x0f, 0xa0,
+0x01, 0x30,
+0x01, 0xfd,
+0x08, 0x0c,
+0x01, 0x0c,
+0x05, 0x04,
+0x03, 0x27,
+0x04, 0x84,
+0x01, 0x84,
+0x01, 0x84,
+0x01, 0x84,
+0x01, 0x84,
+0x01, 0x84,
+0x01, 0x84,
+0x01, 0x85,
+0x01, 0x85,
+0x01, 0x85,
+0x01, 0x85,
+0x01, 0x85,
+0x01, 0x85,
+0x01, 0x86,
+0x01, 0x86,
+0x01, 0x86,
+0x01, 0x86,
+0x01, 0x86,
+0x01, 0x86,
+0x01, 0x86,
+0x01, 0x87,
+0x01, 0x87,
+0x01, 0x87,
+0x01, 0x87,
+0x01, 0x87,
+0x01, 0x87,
+0x02, 0xd8,
+0xff, 0x00,
+0x8f, 0x08,
+0x02, 0xa0,
+0x02, 0x0e,
+0x02, 0x04,
+0x01, 0x0a,
+0x02, 0x04,
+0x01, 0x0a,
+0x03, 0x48,
+0x01, 0xeb,
+0x84, 0x31,
+0x01, 0xea,
+0x01, 0x66,
+0x01, 0xfe,
+0x01, 0x47,
+0x01, 0xfe,
+0x01, 0x4a,
+0x01, 0xf3,
+0x01, 0x91,
+0x01, 0xf2,
+0x01, 0x0e,
+0x01, 0xf2,
+0x01, 0x50,
+0x01, 0xf2,
+0x01, 0x33,
+0x01, 0xf3,
+0x01, 0x57,
+0x01, 0xf1,
+0x01, 0xca,
+0x01, 0xf1,
+0x01, 0xed,
+0x01, 0xf6,
+0x01, 0x3e,
+0x01, 0xf1,
+0x01, 0x2f,
+0x01, 0xf3,
+0x01, 0x66,
+0x01, 0xfe,
+0x01, 0xa5,
+0x01, 0xf4,
+0x01, 0xed,
+0x01, 0xf5,
diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.a65 b/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.a65 new file mode 100644 index 00000000..8d269662 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.a65 @@ -0,0 +1,210 @@ +/*************************************************************************** + psiddrv.a65 - C64 Sid Player + ------------------- + begin : + copyright : (C) 2000 by Dag Lem + email : resid@nimrod.no + ***************************************************************************/ +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ +/*************************************************************************** + * Modified by Simon White <sidplay2@email.com> for use in the sidplayer + * SIDPlay2. + * + * Build with: + * xa -R -G psiddrv.a65 -o psiddrv.o65 + * od -v -An -w8 -tx1 psiddrv.o65 | sed 's/\w\w/0x&,/g' > psiddrv.bin + ***************************************************************************/ +/*************************************************************************** + * $Log: psiddrv.a65,v $ + * Revision 1.16 2002/12/13 22:04:54 s_a_white + * Nolonger CLI after returning from INIT for RSID tunes. Since the tunes are + * more complicated rely on the init to do the right thing. + * + * Revision 1.15 2002/11/20 21:43:08 s_a_white + * Enable the VIC screen and therefore DMA. + * + * Revision 1.14 2002/11/19 22:53:23 s_a_white + * Sidplay1 modes modified to make them nolonger require the psid driver. + * + * Revision 1.13 2002/11/01 17:36:01 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.12 2002/10/20 08:59:14 s_a_white + * Prevent some PSID tunes being handled like RSID ones. + * + * Revision 1.11 2002/10/02 19:42:59 s_a_white + * RSID support. + * + * Revision 1.10 2002/09/21 22:32:18 s_a_white + * Prevent some of the real c64 only tunes abusing play != 0. Some busy + * looping ones may still get away with it... + * + * Revision 1.9 2002/09/12 20:39:47 s_a_white + * Added support for simulating the random delay before the user loads a + * program on a real C64. + * + * Revision 1.8 2002/03/12 18:45:37 s_a_white + * Added PHP to push stack as sidplay1 compatibility IRQ now behaves like + * JSR. + * + * Revision 1.7 2002/02/17 12:35:35 s_a_white + * BRK handler clean up and better sidplay2 optimisation usage. + * + * Revision 1.6 2002/02/05 08:48:58 s_a_white + * Small fix for psid specific rips and real irq handlers (A reg now zeroed). + * + * Revision 1.5 2002/02/04 23:50:48 s_a_white + * Improved compatibilty with older sidplay1 modes. + * + * Revision 1.4 2001/12/17 23:43:29 s_a_white + * Fix for real C64 tunes where BRK handler is run. + * + * Revision 1.3 2001/10/02 18:05:27 s_a_white + * Fix for real C64 tunes which correctly handle BRK. + * + * Revision 1.2 2001/09/01 11:12:22 s_a_white + * Fixes sidplay1 environment modes. + * + * Revision 1.1 2001/07/27 12:12:23 s_a_white + * Initial release. + * + ***************************************************************************/ + + ; entry address +coldvec .word cold + ; redirect basic restart vector + ; to finish the init sequence +finitvec .word setiomap + + ; initial user interrupt vectors +retusr .word irqret + .byte 0 +irqusr .word irqret +brkusr .word brkjob +nmiusr .word nmijob + +playnum .byte 0 +speed .byte 0 +initvec .word 0 +playvec .word 0 +rndwait .word 0 +initiomap .byte 0 +playiomap .byte 0 + + ; init/play PSID +play jmp (playvec) +init jmp (initvec) + + ; cold start +cold sei + + ; set CIA Timer A to 60Hz + lda $02a6 + beq ntsc +pal lda #$25 + ldx #$40 + bne timer +ntsc lda #$95 + ldx #$42 +timer sta $dc04 + stx $dc05 + + ; enable the VICs screen + lda $d011 + ora #$10 + sta $d011 + + ; 0 indicates VIC timing, else it's from CIA + ldx #$81 + lda speed + bne ciainit + + ; enable VICII raster interrupt + stx $d01a + beq doinit + + ; enable CIA 1 timer A interrupt +ciainit stx $dc0d + + ; always enable timer A for random numbers +doinit lda #$01 + sta $dc0e + + ; If play address, override default irq vector so + ; we reach are routine to handle play routine + lda playiomap + beq noplay + lda #<irqjob + sta $0314 + + ; set I/O map and call song init routine +noplay lda initiomap + bne setbank + ; Only release interrupt mask for real + ; C64 tunes (initiomap = 0) thus + ; providing a more realistic environment + lda #$37 + ; cli dosen't come into effect until + ; after the sta! + cli +setbank sta $01 + + ; simulate time before user loads tune +random tya + ldx rndwait + ldy rndwait+1 + inx + iny +wait dex + bne wait + dey + bne wait + tay + + ; get song number +getsong ldx playnum + dex + txa + ldx #0 + ldy #0 + jsr init +setiomap lda initiomap + beq idle + lda playiomap + beq run + lda #$37 + sta $01 + bne run + +brkjob ldx #$ff + txs +run cli +idle jmp idle + +irqjob lda $01 + pha + lda playiomap + sta $01 + lda #0 + jsr play + pla + sta $01 + inc $d019 + + ; IRQ Exit (code from Kernel ROM) +irqret lda $dc0d + pla + tay + pla + tax + pla +nmijob rti + +.end diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.bin b/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.bin new file mode 100644 index 00000000..a7e8ae05 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.bin @@ -0,0 +1,32 @@ + 0x01, 0x00, 0x6f, 0x36, 0x35, 0x00, 0x00, 0x00, + 0x00, 0x10, 0xb2, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1d, 0x10, 0x7f, 0x10, 0xa9, + 0x10, 0x00, 0xa9, 0x10, 0x8f, 0x10, 0xb1, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x6c, 0x11, 0x10, 0x6c, 0x0f, 0x10, + 0x78, 0xad, 0xa6, 0x02, 0xf0, 0x06, 0xa9, 0x25, + 0xa2, 0x40, 0xd0, 0x04, 0xa9, 0x95, 0xa2, 0x42, + 0x8d, 0x04, 0xdc, 0x8e, 0x05, 0xdc, 0xad, 0x11, + 0xd0, 0x09, 0x10, 0x8d, 0x11, 0xd0, 0xa2, 0x81, + 0xad, 0x0e, 0x10, 0xd0, 0x05, 0x8e, 0x1a, 0xd0, + 0xf0, 0x03, 0x8e, 0x0d, 0xdc, 0xa9, 0x01, 0x8d, + 0x0e, 0xdc, 0xad, 0x16, 0x10, 0xf0, 0x05, 0xa9, + 0x96, 0x8d, 0x14, 0x03, 0xad, 0x15, 0x10, 0xd0, + 0x03, 0xa9, 0x37, 0x58, 0x85, 0x01, 0x98, 0xae, + 0x13, 0x10, 0xac, 0x14, 0x10, 0xe8, 0xc8, 0xca, + 0xd0, 0xfd, 0x88, 0xd0, 0xfa, 0xa8, 0xae, 0x0d, + 0x10, 0xca, 0x8a, 0xa2, 0x00, 0xa0, 0x00, 0x20, + 0x1a, 0x10, 0xad, 0x15, 0x10, 0xf0, 0x0f, 0xad, + 0x16, 0x10, 0xf0, 0x09, 0xa9, 0x37, 0x85, 0x01, + 0xd0, 0x03, 0xa2, 0xff, 0x9a, 0x58, 0x4c, 0x93, + 0x10, 0xa5, 0x01, 0x48, 0xad, 0x16, 0x10, 0x85, + 0x01, 0xa9, 0x00, 0x20, 0x17, 0x10, 0x68, 0x85, + 0x01, 0xee, 0x19, 0xd0, 0xad, 0x0d, 0xdc, 0x68, + 0xa8, 0x68, 0xaa, 0x68, 0x40, 0x00, 0x00, 0x01, + 0x82, 0x02, 0x82, 0x02, 0x82, 0x03, 0x82, 0x02, + 0x82, 0x02, 0x82, 0x0d, 0x82, 0x03, 0x82, 0x23, + 0x82, 0x12, 0x82, 0x05, 0x22, 0x05, 0x82, 0x0b, + 0x82, 0x03, 0x82, 0x0c, 0x82, 0x09, 0x82, 0x03, + 0x82, 0x05, 0x82, 0x0f, 0x82, 0x06, 0x82, 0x07, + 0x82, 0x00, 0x00, 0x00, 0x00, diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.cpp new file mode 100644 index 00000000..5a8cf894 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/psiddrv.cpp @@ -0,0 +1,266 @@ +/*************************************************************************** + psiddrv.cpp - PSID Driver Installtion + ------------------- + begin : Fri Jul 27 2001 + copyright : (C) 2001 by Simon White + email : s_a_white@email.com + ***************************************************************************/ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: psiddrv.cpp,v $ + * Revision 1.25 2002/12/13 22:07:29 s_a_white + * C64 code fixed so a theres no decrement before checking the random value. + * + * Revision 1.24 2002/11/27 00:16:51 s_a_white + * Make sure driver info gets reset and exported properly. + * + * Revision 1.23 2002/11/25 21:09:42 s_a_white + * Reset address for old sidplay1 modes now directly passed to the CPU. This + * prevents tune corruption and banking issues for the different modes. + * + * Revision 1.22 2002/11/19 22:53:23 s_a_white + * Sidplay1 modes modified to make them nolonger require the psid driver. + * + * Revision 1.21 2002/11/01 19:11:21 s_a_white + * Export random delay used in song. + * + * Revision 1.20 2002/11/01 17:36:02 s_a_white + * Frame based support for old sidplay1 modes. + * + * Revision 1.19 2002/10/02 19:42:59 s_a_white + * RSID support. + * + * Revision 1.18 2002/09/12 21:01:32 s_a_white + * Added support for simulating the random delay before the user loads a + * program on a real C64. + * + * Revision 1.17 2002/09/09 18:01:30 s_a_white + * Prevent m_info driver details getting modified when C64 crashes. + * + * Revision 1.16 2002/07/21 19:39:40 s_a_white + * Proper error handling of reloc info overlapping load image. + * + * Revision 1.15 2002/07/18 18:37:42 s_a_white + * Buffer overflow fixes for tunes providing bad reloc information. + * + * Revision 1.14 2002/07/17 21:48:10 s_a_white + * PSIDv2NG reloc exclude region extension. + * + * Revision 1.13 2002/03/12 18:43:59 s_a_white + * Tidy up handling of envReset on illegal CPU instructions. + * + * Revision 1.12 2002/03/03 22:02:36 s_a_white + * Sidplay2 PSID driver length now exported. + * + * Revision 1.11 2002/02/17 12:41:18 s_a_white + * Fixed to not so easily break when C64 code is modified. + * + * Revision 1.10 2002/02/04 23:50:48 s_a_white + * Improved compatibilty with older sidplay1 modes. + * + * Revision 1.9 2002/01/29 21:50:33 s_a_white + * Auto switching to a better emulation mode. tuneInfo reloaded after a + * config. Initial code added to support more than two sids. + * + * Revision 1.8 2001/12/21 21:54:14 s_a_white + * Improved compatibility if Sidplay1 bankswitching mode. + * + * Revision 1.7 2001/12/13 08:28:08 s_a_white + * Added namespace support to fix problems with xsidplay. + * + * Revision 1.6 2001/11/16 19:23:18 s_a_white + * Fixed sign of buf for reloc65 call. + * + * Revision 1.5 2001/10/28 21:28:35 s_a_white + * For none real mode if play != 0 we now always jump to irqjob instead of + * playAddr. + * + * Revision 1.4 2001/10/02 18:31:24 s_a_white + * No longer dies if relocStartPages != 0 byr relocPages == 0. For none real + * evironment modes, play is always followed even if interrupt handlers are + * installed. + * + * Revision 1.3 2001/09/01 11:13:18 s_a_white + * Fixes sidplay1 environment modes. + * + * Revision 1.2 2001/07/27 12:52:12 s_a_white + * Removed warning. + * + * Revision 1.1 2001/07/27 12:12:23 s_a_white + * Initial release. + * + ***************************************************************************/ + +// -------------------------------------------------------- +// The code here is use to support the PSID Version 2NG +// (proposal B) file format for player relocation support. +// -------------------------------------------------------- +#include "sidendian.h" +#include "player.h" + +#define PSIDDRV_MAX_PAGE 0xff + +SIDPLAY2_NAMESPACE_START + +const char *Player::ERR_PSIDDRV_NO_SPACE = "ERROR: No space to install psid driver in C64 ram"; +const char *Player::ERR_PSIDDRV_RELOC = "ERROR: Failed whilst relocating psid driver"; + +extern "C" int reloc65(unsigned char** buf, int* fsize, int addr); + +int Player::psidDrvInstall (SidTuneInfo &tuneInfo, sid2_info_t &info) +{ + uint_least16_t relocAddr; + int startlp = tuneInfo.loadAddr >> 8; + int endlp = (tuneInfo.loadAddr + (tuneInfo.c64dataLen - 1)) >> 8; + + if (info.environment != sid2_envR) + { // Sidplay1 modes require no psid driver + info.driverAddr = 0; + info.driverLength = 0; + info.rnddelay = 0; + return 0; + } + + // Check for free space in tune + if (tuneInfo.relocStartPage == PSIDDRV_MAX_PAGE) + tuneInfo.relocPages = 0; + // Check if we need to find the reloc addr + else if (tuneInfo.relocStartPage == 0) + { // Tune is clean so find some free ram around the + // load image + psidRelocAddr (tuneInfo, startlp, endlp); + } + else + { // Check reloc information mode + int startrp = tuneInfo.relocStartPage; + int endrp = startrp + (tuneInfo.relocPages - 1); + + // New relocation implementation (exclude region) + // to complement existing method rejected as being + // unnecessary. From tests in most cases this + // method increases memory availibility. + /************************************************* + if ((startrp <= startlp) && (endrp >= endlp)) + { // Is describing used space so find some free + // ram outside this range + psidRelocAddr (tuneInfo, startrp, endrp); + } + *************************************************/ + } + + if (tuneInfo.relocPages < 1) + { + m_errorString = ERR_PSIDDRV_NO_SPACE; + return -1; + } + + relocAddr = tuneInfo.relocStartPage << 8; + + { // Place psid driver into ram + uint8_t psid_driver[] = { +# include "psiddrv.bin" + }; + uint8_t *reloc_driver = psid_driver; + int reloc_size = sizeof (psid_driver); + + if (!reloc65 (&reloc_driver, &reloc_size, relocAddr - 13)) + { + m_errorString = ERR_PSIDDRV_RELOC; + return -1; + } + + // Adjust size to not included initialisation data. + reloc_size -= 13; + info.driverAddr = relocAddr; + info.driverLength = (uint_least16_t) reloc_size; + // Round length to end of page + info.driverLength += 0xff; + info.driverLength &= 0xff00; + + m_ram[0x310] = JMPw; + memcpy (&m_ram[0x0311], &reloc_driver[4], 9); + memcpy (&m_rom[0xfffc], &reloc_driver[0], 2); /* RESET */ + + { // Experimental exit to basic support + uint_least16_t addr; + addr = endian_little16(&reloc_driver[2]); + m_rom[0xa7ae] = JMPw; + endian_little16 (&m_rom[0xa7af], 0xffe1); + endian_little16 (&m_ram[0x0328], addr); + } + memcpy (&m_ram[relocAddr], &reloc_driver[13], reloc_size); + } + + { // Setup the Initial entry point + uint_least16_t playAddr = tuneInfo.playAddr; + uint_least16_t addr = relocAddr; + + // Tell C64 about song + m_ram[addr++] = (uint8_t) tuneInfo.currentSong; + if (tuneInfo.songSpeed == SIDTUNE_SPEED_VBI) + m_ram[addr] = 0; + else // SIDTUNE_SPEED_CIA_1A + m_ram[addr] = 1; + + addr++; + endian_little16 (&m_ram[addr], tuneInfo.initAddr); + addr += 2; + endian_little16 (&m_ram[addr], playAddr); + addr += 2; + // Below we limit the delay to something sensible. + info.rnddelay = (uint_least16_t) (m_rand >> 3) & 0x0FFF; + endian_little16 (&m_ram[addr], m_info.rnddelay); + addr += 2; + m_rand = m_rand * 13 + 1; + m_ram[addr++] = iomap (m_tuneInfo.initAddr); + m_ram[addr++] = iomap (m_tuneInfo.playAddr); + } + return 0; +} + + +void Player::psidRelocAddr (SidTuneInfo &tuneInfo, int startp, int endp) +{ // Used memory ranges. + bool pages[256]; + int used[] = {0x00, 0x03, + 0xa0, 0xbf, + 0xd0, 0xff, + startp, endp}; + + // Mark used pages in table. + memset(pages, false, sizeof(pages)); + for (size_t i = 0; i < sizeof(used)/sizeof(*used); i += 2) + { + for (int page = used[i]; page <= used[i + 1]; page++) + pages[page] = true; + } + + { // Find largest free range. + int relocPages, lastPage = 0; + tuneInfo.relocPages = 0; + for (size_t page = 0; page < sizeof(pages)/sizeof(*pages); page++) + { + if (pages[page] == false) + continue; + relocPages = page - lastPage; + if (relocPages > tuneInfo.relocPages) + { + tuneInfo.relocStartPage = lastPage; + tuneInfo.relocPages = relocPages; + } + lastPage = page + 1; + } + } + + if (tuneInfo.relocPages == 0) + tuneInfo.relocStartPage = PSIDDRV_MAX_PAGE; +} + +SIDPLAY2_NAMESPACE_STOP diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/reloc65.c b/sid/sidplay-libs-2.1.0/libsidplay/src/reloc65.c new file mode 100644 index 00000000..3c732a39 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/reloc65.c @@ -0,0 +1,232 @@ +/* + xa65 - 6502 cross assembler and utility suite + reloc65 - relocates 'o65' files + Copyright (C) 1997 André Fachat (a.fachat@physik.tu-chemnitz.de) + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + Modified by Dag Lem <resid@nimrod.no> + Relocate and extract text segment from memory buffer instead of file. + For use with VICE VSID. +*/ + +#include <stdio.h> +#include <string.h> + +#define BUF (9*2+8) /* 16 bit header */ + +typedef struct { + char *fname; + size_t fsize; + unsigned char *buf; + int tbase, tlen, dbase, dlen, bbase, blen, zbase, zlen; + int tdiff, ddiff, bdiff, zdiff; + unsigned char *segt; + unsigned char *segd; + unsigned char *utab; + unsigned char *rttab; + unsigned char *rdtab; + unsigned char *extab; +} file65; + + +int read_options(unsigned char *f); +int read_undef(unsigned char *f); +unsigned char *reloc_seg(unsigned char *f, int len, unsigned char *rtab, file65 *fp); +unsigned char *reloc_globals(unsigned char *, file65 *fp); + +file65 file; +unsigned char cmp[] = { 1, 0, 'o', '6', '5' }; + +int reloc65(unsigned char** buf, int* fsize, int addr) +{ + int mode, hlen; + + int tflag=0, dflag=0, bflag=0, zflag=0; + int tbase=0, dbase=0, bbase=0, zbase=0; + int extract = 0; + + file.buf = *buf; + file.fsize = *fsize; + tflag= 1; + tbase = addr; + extract = 1; + + if (memcmp(file.buf, cmp, 5) != 0) { + return 0; + } + + mode=file.buf[7]*256+file.buf[6]; + if(mode & 0x2000) { + return 0; + } else if(mode & 0x4000) { + return 0; + } + + hlen = BUF+read_options(file.buf+BUF); + + file.tbase = file.buf[ 9]*256+file.buf[ 8]; + file.tlen = file.buf[11]*256+file.buf[10]; + file.tdiff = tflag? tbase - file.tbase : 0; + file.dbase = file.buf[13]*256+file.buf[12]; + file.dlen = file.buf[15]*256+file.buf[14]; + file.ddiff = dflag? dbase - file.dbase : 0; + file.bbase = file.buf[17]*256+file.buf[16]; + file.blen = file.buf[19]*256+file.buf[18]; + file.bdiff = bflag? bbase - file.bbase : 0; + file.zbase = file.buf[21]*256+file.buf[20]; + file.zlen = file.buf[23]*256+file.buf[21]; + file.zdiff = zflag? zbase - file.zbase : 0; + + file.segt = file.buf + hlen; + file.segd = file.segt + file.tlen; + file.utab = file.segd + file.dlen; + + file.rttab = file.utab + read_undef(file.utab); + + file.rdtab = reloc_seg(file.segt, file.tlen, file.rttab, &file); + file.extab = reloc_seg(file.segd, file.dlen, file.rdtab, &file); + + reloc_globals(file.extab, &file); + + if(tflag) { + file.buf[ 9]= (tbase>>8)&255; + file.buf[ 8]= tbase & 255; + } + if(dflag) { + file.buf[13]= (dbase>>8)&255; + file.buf[12]= dbase & 255; + } + if(bflag) { + file.buf[17]= (bbase>>8)&255; + file.buf[16]= bbase & 255; + } + if(zflag) { + file.buf[21]= (zbase>>8)&255; + file.buf[20]= zbase & 255; + } + + switch(extract) { + case 0: /* whole file */ + return 1; + case 1: /* text segment */ + *buf = file.segt; + *fsize = file.tlen; + return 1; + case 2: + *buf = file.segd; + *fsize = file.dlen; + return 1; + default: + return 0; + } +} + + +int read_options(unsigned char *buf) { + int c, l=0; + + c=buf[0]; + while(c && c!=EOF) { + c&=255; + l+=c; + c=buf[l]; + } + return ++l; +} + +int read_undef(unsigned char *buf) { + int n, l = 2; + + n = buf[0] + 256*buf[1]; + while(n){ + n--; + while(!buf[l++]); + } + return l; +} + +#define reldiff(s) (((s)==2)?fp->tdiff:(((s)==3)?fp->ddiff:(((s)==4)?fp->bdiff:(((s)==5)?fp->zdiff:0)))) + +unsigned char *reloc_seg(unsigned char *buf, int len, unsigned char *rtab, file65 *fp) { + int adr = -1; + int type, seg, old, new; +/*printf("tdiff=%04x, ddiff=%04x, bdiff=%04x, zdiff=%04x\n", + fp->tdiff, fp->ddiff, fp->bdiff, fp->zdiff);*/ + while(*rtab) { + if((*rtab & 255) == 255) { + adr += 254; + rtab++; + } else { + adr += *rtab & 255; + rtab++; + type = *rtab & 0xe0; + seg = *rtab & 0x07; +/*printf("reloc entry @ rtab=%p (offset=%d), adr=%04x, type=%02x, seg=%d\n",rtab-1, *(rtab-1), adr, type, seg);*/ + rtab++; + switch(type) { + case 0x80: + old = buf[adr] + 256*buf[adr+1]; + new = old + reldiff(seg); + buf[adr] = new & 255; + buf[adr+1] = (new>>8)&255; + break; + case 0x40: + old = buf[adr]*256 + *rtab; + new = old + reldiff(seg); + buf[adr] = (new>>8)&255; + *rtab = new & 255; + rtab++; + break; + case 0x20: + old = buf[adr]; + new = old + reldiff(seg); + buf[adr] = new & 255; + break; + } + if(seg==0) rtab+=2; + } + } + if(adr > len) { +/* + fprintf(stderr,"reloc65: %s: Warning: relocation table entries past segment end!\n", + fp->fname); +*/ + } + return ++rtab; +} + +unsigned char *reloc_globals(unsigned char *buf, file65 *fp) { + int n, old, new, seg; + + n = buf[0] + 256*buf[1]; + buf +=2; + + while(n) { +/*printf("relocating %s, ", buf);*/ + while(*(buf++)); + seg = *buf; + old = buf[1] + 256*buf[2]; + new = old + reldiff(seg); +/*printf("old=%04x, seg=%d, rel=%04x, new=%04x\n", old, seg, reldiff(seg), new);*/ + buf[1] = new & 255; + buf[2] = (new>>8) & 255; + buf +=3; + n--; + } + return buf; +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/Makefile.am new file mode 100644 index 00000000..8b282820 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/Makefile.am @@ -0,0 +1,7 @@ + +noinst_LTLIBRARIES = libsid6526.la + +libsid6526_la_SOURCES = sid6526.cpp sid6526.h + +# Remove bad default includes +DEFAULT_INCLUDES= diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/Makefile.in new file mode 100644 index 00000000..ef5bdb03 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/Makefile.in @@ -0,0 +1,424 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +noinst_LTLIBRARIES = libsid6526.la + +libsid6526_la_SOURCES = sid6526.cpp sid6526.h + +# Remove bad default includes +DEFAULT_INCLUDES = +subdir = src/sid6526 +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libsid6526_la_LDFLAGS = +libsid6526_la_LIBADD = +am_libsid6526_la_OBJECTS = sid6526.lo +libsid6526_la_OBJECTS = $(am_libsid6526_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/unix/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/sid6526.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libsid6526_la_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libsid6526_la_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/sid6526/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libsid6526.la: $(libsid6526_la_OBJECTS) $(libsid6526_la_DEPENDENCIES) + $(CXXLINK) $(libsid6526_la_LDFLAGS) $(libsid6526_la_OBJECTS) $(libsid6526_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sid6526.Plo@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/sid6526.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/sid6526.cpp new file mode 100644 index 00000000..8737f7f0 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/sid6526.cpp @@ -0,0 +1,135 @@ +/*************************************************************************** + sid6526.cpp - description + ------------------- + begin : Wed Jun 7 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sid6526.cpp,v $ + * Revision 1.7 2002/10/02 19:48:15 s_a_white + * Make CIA control register reflect that the timer cannot be disabled. + * + * Revision 1.6 2002/03/11 18:00:29 s_a_white + * Better mirror sidplay1s handling of random numbers. + * + * Revision 1.5 2002/03/03 22:03:49 s_a_white + * Tidy. + * + * Revision 1.4 2001/10/02 18:01:36 s_a_white + * Support for cleaned c64env. + * + * Revision 1.3 2001/09/18 02:22:37 jpaana + * Fixed include filename to lowercase + * + * Revision 1.2 2001/09/03 22:24:09 s_a_white + * New counts for timer A are correctly formed. + * + * Revision 1.1 2001/09/01 11:11:19 s_a_white + * This is the old fake6526 code required for sidplay1 environment modes. + * + ***************************************************************************/ + +#include <time.h> +#include "sidendian.h" +#include "sid6526.h" + +const char * const SID6526::credit = +{ // Optional information + "*SID6526 (SIDPlay1 Fake CIA) Emulation:\0" + "\tCopyright (C) 2001 Simon White <sidplay2@email.com>\0" +}; + +SID6526::SID6526 (c64env *env) +:m_env(*env), + m_eventContext(m_env.context ()), + rnd(0), + m_taEvent(*this) +{ + clock (0xffff); + reset (); +} + +void SID6526::reset (void) +{ + locked = false; + ta = ta_latch = m_count; + cra = 0; + rnd += time(NULL) & 0xff; + m_accessClk = 0; +} + +uint8_t SID6526::read (uint_least8_t addr) +{ + if (addr > 0x0f) + return 0; + + switch (addr) + { + case 0x04: + case 0x05: + case 0x11: + case 0x12: + rnd = rnd * 13 + 1; + return (uint8_t) (rnd >> 3); + break; + default: + return regs[addr]; + } +} + +void SID6526::write (uint_least8_t addr, uint8_t data) +{ + if (addr > 0x0f) + return; + + regs[addr] = data; + + if (locked) + return; // Stop program changing time interval + + { // Sync up timer + event_clock_t cycles; + cycles = m_eventContext.getTime (m_accessClk); + m_accessClk += cycles; + ta -= cycles; + } + + switch (addr) + { + case 0x4: endian_16lo8 (ta_latch, data); break; + case 0x5: + endian_16hi8 (ta_latch, data); + if (!(cra & 0x01)) // Reload timer if stopped + ta = ta_latch; + break; + case 0x0e: + cra = data | 0x01; + if (data & 0x10) + { + cra &= (~0x10); + ta = ta_latch; + } + m_eventContext.schedule (&m_taEvent, (event_clock_t) ta + 1); + break; + default: + break; + } +} + +void SID6526::event (void) +{ // Timer Modes + m_accessClk = m_eventContext.getTime (); + ta = ta_latch; + m_eventContext.schedule (&m_taEvent, (event_clock_t) ta + 1); + m_env.interruptIRQ (true); +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/sid6526.h b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/sid6526.h new file mode 100644 index 00000000..d92c230c --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sid6526/sid6526.h @@ -0,0 +1,84 @@ +/*************************************************************************** + sid6526.h - fake CIA timer for sidplay1 + environment modes + ------------------- + begin : Wed Jun 7 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sid6526.h,v $ + * Revision 1.3 2002/07/20 08:34:52 s_a_white + * Remove unnecessary and pointless conts. + * + * Revision 1.2 2002/03/11 18:00:29 s_a_white + * Better mirror sidplay1s handling of random numbers. + * + * Revision 1.1 2001/09/01 11:11:19 s_a_white + * This is the old fake6526 code required for sidplay1 environment modes. + * + ***************************************************************************/ + +#ifndef _sid6526_h_ +#define _sid6526_h_ + +#include "component.h" +#include "event.h" +#include "c64env.h" + +class SID6526: public component +{ +private: + + static const char * const credit; + + c64env &m_env; + EventContext &m_eventContext; + event_clock_t m_accessClk; + + uint8_t regs[0x10]; + uint8_t cra; // Timer A Control Register + uint_least16_t ta_latch; + uint_least16_t ta; // Current count (reduces to zero) + uint_least32_t rnd; + uint_least16_t m_count; + bool locked; // Prevent code changing CIA. + + class TaEvent: public Event + { + private: + SID6526 &m_cia; + void event (void) {m_cia.event ();} + + public: + TaEvent (SID6526 &cia) + :Event("CIA Timer A"), + m_cia(cia) {} + } m_taEvent; + +public: + SID6526 (c64env *env); + + //Common: + void reset (void); + uint8_t read (uint_least8_t addr); + void write (uint_least8_t addr, uint8_t data); + const char *credits (void) {return credit;} + const char *error (void) {return "";} + + // Specific: + void event (void); + void clock (uint_least16_t count) { m_count = count; } + void lock () { locked = true; } +}; + +#endif // _sid6526_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidplay2.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidplay2.cpp new file mode 100644 index 00000000..e3535ddb --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidplay2.cpp @@ -0,0 +1,131 @@ +/*************************************************************************** + sidplayer.cpp - Wrapper to hide private + header files (see below) + ------------------- + begin : Fri Jun 9 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: sidplay2.cpp,v $ + * Revision 1.15 2002/03/04 19:05:49 s_a_white + * Fix C++ use of nothrow. + * + * Revision 1.14 2001/12/13 08:28:08 s_a_white + * Added namespace support to fix problems with xsidplay. + * + * Revision 1.13 2001/12/11 19:24:15 s_a_white + * More GCC3 Fixes. + * + * Revision 1.12 2001/09/17 19:03:58 s_a_white + * 2.1.0 interface stabalisation. + * + * Revision 1.11 2001/09/01 11:16:12 s_a_white + * Renamed configure to config. + * + * Revision 1.10 2001/07/25 17:01:13 s_a_white + * Support for new configuration interface. + * + * Revision 1.9 2001/07/14 16:46:16 s_a_white + * Sync with sidbuilder class project. + * + * Revision 1.8 2001/07/14 12:57:38 s_a_white + * Added credits and debug functions. Removed external filter. + * + * Revision 1.7 2001/03/21 22:31:22 s_a_white + * Filter redefinition support. + * + * Revision 1.6 2001/03/01 23:46:37 s_a_white + * Support for sample mode to be selected at runtime. + * + * Revision 1.5 2001/02/21 21:49:21 s_a_white + * Now uses new player::getErrorString function. + * + * Revision 1.4 2001/02/13 21:32:35 s_a_white + * Windows DLL export fix. + * + * Revision 1.3 2001/02/07 20:57:08 s_a_white + * New SID_EXPORT define. Supports SidTune now. + * + * Revision 1.2 2001/01/23 21:26:28 s_a_white + * Only way to load a tune now is by passing in a sidtune object. This is + * required for songlength database support. + * + * Revision 1.1 2000/12/12 19:14:44 s_a_white + * Library wrapper. + * + ***************************************************************************/ + +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- +// Redirection to private version of sidplayer (This method is called Cheshire Cat) +// [ms: which is J. Carolan's name for a degenerate 'bridge'] +// This interface can be directly replaced with a libsidplay1 or C interface wrapper. +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- + +#include "config.h" +#include "player.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif + +sidplay2::sidplay2 () +#ifdef HAVE_EXCEPTIONS +: sidplayer (*(new(std::nothrow) SIDPLAY2_NAMESPACE::Player)) +#else +: sidplayer (*(new SIDPLAY2_NAMESPACE::Player)) +#endif +{ +} + +sidplay2::~sidplay2 () +{ if (&sidplayer) delete &sidplayer; } + +int sidplay2::config (const sid2_config_t &cfg) +{ return sidplayer.config (cfg); } + +const sid2_config_t &sidplay2::config (void) const +{ return sidplayer.config (); } + +void sidplay2::stop (void) +{ sidplayer.stop (); } + +void sidplay2::pause (void) +{ sidplayer.pause (); } + +uint_least32_t sidplay2::play (void *buffer, uint_least32_t length) +{ return sidplayer.play (buffer, length); } + +int sidplay2::load (SidTune *tune) +{ return sidplayer.load (tune); } + +const sid2_info_t &sidplay2::info () const +{ return sidplayer.info (); } + +uint_least32_t sidplay2::time (void) const +{ return sidplayer.time (); } + +uint_least32_t sidplay2::mileage (void) const +{ return sidplayer.mileage (); } + +const char *sidplay2::error (void) const +{ return sidplayer.error (); } + +int sidplay2::fastForward (uint percent) +{ return sidplayer.fastForward (percent); } + +void sidplay2::debug (bool enable) +{ sidplayer.debug (enable); } + +sid2_player_t sidplay2::state (void) const +{ return sidplayer.state (); } diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/IconInfo.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/IconInfo.cpp new file mode 100644 index 00000000..37717694 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/IconInfo.cpp @@ -0,0 +1,468 @@ +/* + * /home/ms/files/source/libsidtune/RCS/IconInfo.cpp,v + * + * Amiga icon tooltype PlaySID file format (.info) support. + * + * This is a derived work, courtesy of Peter Kunath, who has + * provided an examplary source code to examine an Amiga icon file. + * + * It has been ported and heavily modified to suit certain + * requirements. This replaces the old code, which was simply + * scanning input data for a first, presumedly constant, Id string. + * This code does not require the default tool to serve as a + * constant Id by containing "SID:PlaySID". + * + * 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 + */ + +#include "config.h" +#include "SidTune.h" +#include "SmartPtr.h" +#include "SidTuneTools.h" +#include "sidendian.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif +#include <string.h> +#include <strstream> + +// Amiga Workbench specific structures. + +struct Border +{ + uint8_t LeftEdge[2]; // uint_least16_t; initial offsets from the origin + uint8_t TopEdge[2]; // uint_least16_t + uint8_t FrontPen, BackPen; // pens numbers for rendering + uint8_t DrawMode; // mode for rendering + uint8_t Count; // number of XY pairs + uint8_t pXY[4]; // int_least16_t *XY; vector coordinate pairs rel to LeftTop + uint8_t pNextBorder[4]; // Border *NextBorder; pointer to any other Border too +}; + +struct Image +{ + uint8_t LeftEdge[2]; // uint_least16_t; starting offset relative to some origin + uint8_t TopEdge[2]; // uint_least16_t; starting offsets relative to some origin + uint8_t Width[2]; // uint_least16_t; pixel size (though data is word-aligned) + uint8_t Height[2]; // uint_least16_t + uint8_t Depth[2]; // uint_least16_t; >= 0, for images you create + uint8_t pImageData[4]; // uint_least16_t *ImageData; pointer to the actual word-aligned bits + uint8_t PlanePick, PlaneOnOff; + uint8_t pNextImage[4]; // Image *NextImage; +}; + +struct Gadget +{ + uint8_t pNextGadget[4]; // Gadget *NextGadget; next gadget in the list + uint8_t LeftEdge[2]; // uint_least16_t; "hit box" of gadget + uint8_t TopEdge[2]; // uint_least16_t + uint8_t Width[2]; // uint_least16_t; "hit box" of gadget + uint8_t Height[2]; // uint_least16_t + uint8_t Flags[2]; // uint_least16_t; see below for list of defines + uint8_t Activation[2]; // uint_least16_t + uint8_t GadgetType[2]; // uint_least16_t; see below for defines + uint8_t pGadgetRender[4]; // Image *GadgetRender; + uint8_t pSelectRender[4]; // Image *SelectRender; + uint8_t pGadgetText[4]; // void *GadgetText; + uint8_t MutualExclude[4]; // udword + uint8_t pSpecialInfo[4]; // void *SpecialInfo; + uint8_t GadgetID[2]; // uint_least16_t + uint8_t UserData[4]; // udword; ptr to general purpose User data +}; + +struct DiskObject +{ + uint8_t Magic[2]; // uint_least16_t; a magic num at the start of the file + uint8_t Version[2]; // uint_least16_t; a version number, so we can change it + struct Gadget Gadget; // a copy of in core gadget + uint8_t Type; + uint8_t PAD_BYTE; // Pad it out to the next word boundry + uint8_t pDefaultTool[4]; // char *DefaultTool; + uint8_t ppToolTypes[4]; // char **ToolTypes; + uint8_t CurrentX[4]; // udword + uint8_t CurrentY[4]; // udword + uint8_t pDrawerData[4]; // char *DrawerData; + uint8_t pToolWindow[4]; // char *ToolWindow; only applies to tools + uint8_t StackSize[4]; // udword; only applies to tools +}; + + +// A magic number, not easily impersonated. +#define WB_DISKMAGIC 0xE310 +// Our current version number. +#define WB_DISKVERSION 1 +// Our current revision number. +#define WB_DISKREVISION 1 +// I only use the lower 8 bits of Gadget.UserData for the revision #. +#define WB_DISKREVISIONMASK 0xFF + +// The Workbench object types. +#define WB_DISK 1 +#define WB_DRAWER 2 +#define WB_TOOL 3 +#define WB_PROJECT 4 +#define WB_GARBAGE 5 +#define WB_DEVICE 6 +#define WB_KICK 7 +#define WB_APPICON 8 + +// --- Gadget.Flags values --- +// Combinations in these bits describe the highlight technique to be used. +#define GFLG_GADGHIGHBITS 0x0003 +// Complement the select box. +#define GFLG_GADGHCOMP 0x0000 +// Draw a box around the image. +#define GFLG_GADGHBOX 0x0001 +// Blast in this alternate image. +#define GFLG_GADGHIMAGE 0x0002 +// Don't highlight. +#define GFLG_GADGHNONE 0x0003 +// Set if GadgetRender and SelectRender point to an Image structure, +// clear if they point to Border structures. +#define GFLG_GADGIMAGE 0x0004 + +const char _sidtune_txt_format[] = "Raw plus PlaySID icon tooltype file (INFO)"; + +const char _sidtune_keyword_id[] = "SID:PLAYSID"; +const char _sidtune_keyword_address[] = "ADDRESS="; +const char _sidtune_keyword_songs[] = "SONGS="; +const char _sidtune_keyword_speed[] = "SPEED="; +const char _sidtune_keyword_name[] = "NAME="; +const char _sidtune_keyword_author[] = "AUTHOR="; +const char _sidtune_keyword_copyright[] = "COPYRIGHT="; +const char _sidtune_keyword_musPlayer[] = "SIDSONG=YES"; + +const char _sidtune_txt_noMemError[] = "ERROR: Not enough free memory"; +const char _sidtune_txt_corruptError[] = "ERROR: Info file is incomplete or corrupt"; +const char _sidtune_txt_noStringsError[] = "ERROR: Info file does not contain required strings"; +const char _sidtune_txt_dataCorruptError[] = "ERROR: C64 data file is corrupt"; +#if defined(SIDTUNE_REJECT_UNKNOWN_FIELDS) +const char _sidtune_txt_chunkError[] = "ERROR: Invalid tooltype information in icon file"; +#endif + +const uint_least16_t safeBufferSize = 64; // for string comparison, stream parsing + + +bool SidTune::INFO_fileSupport(const void* dataBuffer, uint_least32_t dataLength, + const void* infoBuffer, uint_least32_t infoLength) +{ + // Require a first minimum safety size. + uint_least32_t minSize = 1+sizeof(struct DiskObject); + if (infoLength < minSize) + return( false ); + + const DiskObject *dobject = (const DiskObject *)infoBuffer; + + // Require Magic_Id in the first two bytes of the file. + if ( endian_16(dobject->Magic[0],dobject->Magic[1]) != WB_DISKMAGIC ) + return false; + + // Only version 1.x supported. + if ( endian_16(dobject->Version[0],dobject->Version[1]) != WB_DISKVERSION ) + return false; + + // A PlaySID icon must be of type project. + if ( dobject->Type != WB_PROJECT ) + return false; + + uint i; // general purpose index variable + + // We want to skip a possible Gadget Image item. + const char *icon = (const char*)infoBuffer + sizeof(DiskObject); + + if ( (endian_16(dobject->Gadget.Flags[0],dobject->Gadget.Flags[1]) & GFLG_GADGIMAGE) == 0) + { + // Calculate size of gadget borders (vector image). + + if (dobject->Gadget.pGadgetRender[0] | + dobject->Gadget.pGadgetRender[1] | + dobject->Gadget.pGadgetRender[2] | + dobject->Gadget.pGadgetRender[3]) // border present? + { + // Require another minimum safety size. + minSize += sizeof(struct Border); + if (infoLength < minSize) + return( false ); + + const Border *brd = (const Border *)icon; + icon += sizeof(Border); + icon += brd->Count * (2+2); // pair of uint_least16_t + } + + if (dobject->Gadget.pSelectRender[0] | + dobject->Gadget.pSelectRender[1] | + dobject->Gadget.pSelectRender[2] | + dobject->Gadget.pSelectRender[3]) // alternate border present? + { + // Require another minimum safety size. + minSize += sizeof(Border); + if (infoLength < minSize) + return( false ); + + const Border *brd = (const Border *)icon; + icon += sizeof(Border); + icon += brd->Count * (2+2); // pair of uint_least16_t + } + } + else + { + // Calculate size of gadget images (bitmap image). + + if (dobject->Gadget.pGadgetRender[0] | + dobject->Gadget.pGadgetRender[1] | + dobject->Gadget.pGadgetRender[2] | + dobject->Gadget.pGadgetRender[3]) // image present? + { + // Require another minimum safety size. + minSize += sizeof(Image); + if (infoLength < minSize) + return( false ); + + const Image *img = (const Image *)icon; + icon += sizeof(Image); + + uint_least32_t imgsize = 0; + for(i=0;i<endian_16(img->Depth[0],img->Depth[1]);i++) + { + if ( (img->PlanePick & (1<<i)) != 0) + { + // NOTE: Intuition relies on PlanePick to know how many planes + // of data are found in ImageData. There should be no more + // '1'-bits in PlanePick than there are planes in ImageData. + imgsize++; + } + } + + imgsize *= ((endian_16(img->Width[0],img->Width[1])+15)/16)*2; // bytes per line + imgsize *= endian_16(img->Height[0],img->Height[1]); // bytes per plane + + icon += imgsize; + } + + if (dobject->Gadget.pSelectRender[0] | + dobject->Gadget.pSelectRender[1] | + dobject->Gadget.pSelectRender[2] | + dobject->Gadget.pSelectRender[3]) // alternate image present? + { + // Require another minimum safety size. + minSize += sizeof(Image); + if (infoLength < minSize) + return( false ); + + const Image *img = (const Image *)icon; + icon += sizeof(Image); + + uint_least32_t imgsize = 0; + for(i=0;i<endian_16(img->Depth[0],img->Depth[1]);i++) + { + if ( (img->PlanePick & (1<<i)) != 0) + { + // NOTE: Intuition relies on PlanePick to know how many planes + // of data are found in ImageData. There should be no more + // '1'-bits in PlanePick than there are planes in ImageData. + imgsize++; + } + } + + imgsize *= ((endian_16(img->Width[0],img->Width[1])+15)/16)*2; // bytes per line + imgsize *= endian_16(img->Height[0],img->Height[1]); // bytes per plane + icon += imgsize; + } + } + + // Here use a smart pointer to prevent access violation errors. + SmartPtr_sidtt<const char> spTool((const char*)icon,infoLength-(uint_least32_t)(icon-(const char*)infoBuffer)); + if ( !spTool ) + { + info.formatString = _sidtune_txt_corruptError; + return false; + } + + // A separate safe buffer is used for each tooltype string. +#ifdef HAVE_EXCEPTIONS + SmartPtr_sidtt<char> spCmpBuf(new(std::nothrow) char[safeBufferSize],safeBufferSize,true); +#else + SmartPtr_sidtt<char> spCmpBuf(new char[safeBufferSize],safeBufferSize,true); +#endif + if ( !spCmpBuf ) + { + info.formatString = _sidtune_txt_noMemError; + return false; + } + +#ifndef SID_HAVE_BAD_COMPILER + char* cmpBuf = spCmpBuf.tellBegin(); +#else + // This should not be necessary, but for some reason + // Microsoft Visual C++ says spCmpBuf is const... + char* cmpBuf = (char*) spCmpBuf.tellBegin(); +#endif + + // Skip default tool. + spTool += endian_32(spTool[0],spTool[1],spTool[2],spTool[3]) + 4; + + // Defaults. + fileOffset = 0; // no header in separate data file + info.sidChipBase1 = 0xd400; + info.sidChipBase2 = 0; + info.musPlayer = false; + info.numberOfInfoStrings = 0; + uint_least32_t oldStyleSpeed = 0; + + // Flags for required entries. + bool hasAddress = false, + hasName = false, + hasAuthor = false, + hasCopyright = false, + hasSongs = false, + hasSpeed = false, + hasUnknownChunk = false; + + // Calculate number of tooltype strings. + i = (endian_32(spTool[0],spTool[1],spTool[2],spTool[3])/4) - 1; + spTool += 4; // skip size info + + while( i-- > 0 ) + { + // Get length of this tool. + uint_least32_t toolLen = endian_32(spTool[0],spTool[1],spTool[2],spTool[3]); + spTool += 4; // skip tool length + // Copy item to safe buffer. + for ( uint ci = 0; ci < toolLen; ci++ ) + { +#ifndef SID_HAVE_BAD_COMPILER + spCmpBuf[ci] = spTool[ci]; +#else + // This should not be necessary, but for some reason + // Microsoft Visual C++ says spCmpBuf is const... + (*((char*) (&spCmpBuf[ci]))) = (char) spTool[ci]; +#endif + } + if ( !(spTool&&spCmpBuf) ) + { + return false; + } + + // Now check all possible keywords. + if ( SidTuneTools::myStrNcaseCmp(cmpBuf,_sidtune_keyword_address) == 0 ) + { + std::istrstream addrIn(cmpBuf + strlen(_sidtune_keyword_address), + toolLen - strlen(_sidtune_keyword_address)); + info.loadAddr = (uint_least16_t)SidTuneTools::readHex( addrIn ); + info.initAddr = (uint_least16_t)SidTuneTools::readHex( addrIn ); + info.playAddr = (uint_least16_t)SidTuneTools::readHex( addrIn ); + if ( !addrIn ) + { + return false; + } + hasAddress = true; + } + else if ( SidTuneTools::myStrNcaseCmp(cmpBuf,_sidtune_keyword_songs) == 0 ) + { + std::istrstream numIn( cmpBuf + strlen(_sidtune_keyword_songs), + toolLen - strlen(_sidtune_keyword_songs) ); + if ( !numIn ) + { + return false; + } + info.songs = (uint_least16_t)SidTuneTools::readDec( numIn ); + info.startSong = (uint_least16_t)SidTuneTools::readDec( numIn ); + hasSongs = true; + } + else if ( SidTuneTools::myStrNcaseCmp(cmpBuf,_sidtune_keyword_speed) == 0 ) + { + std::istrstream speedIn( cmpBuf + strlen(_sidtune_keyword_speed), + toolLen - strlen(_sidtune_keyword_speed) ); + if ( !speedIn ) + { + return false; + } + oldStyleSpeed = SidTuneTools::readHex(speedIn); + hasSpeed = true; + } + else if ( SidTuneTools::myStrNcaseCmp(cmpBuf,_sidtune_keyword_name) == 0 ) + { + strncpy( &infoString[0][0], cmpBuf + strlen(_sidtune_keyword_name), 31 ); + info.infoString[0] = &infoString[0][0]; + hasName = true; + } + else if ( SidTuneTools::myStrNcaseCmp(cmpBuf,_sidtune_keyword_author) == 0 ) + { + strncpy( &infoString[1][0], cmpBuf + strlen(_sidtune_keyword_author), 31 ); + info.infoString[1] = &infoString[1][0]; + hasAuthor = true; + } + else if ( SidTuneTools::myStrNcaseCmp(cmpBuf,_sidtune_keyword_copyright) == 0 ) + { + strncpy( &infoString[2][0], cmpBuf + strlen(_sidtune_keyword_copyright), 31 ); + info.infoString[2] = &infoString[2][0]; + hasCopyright = true; + } + else if ( SidTuneTools::myStrNcaseCmp(cmpBuf,_sidtune_keyword_musPlayer) == 0 ) + { + info.musPlayer = true; + } + else + { + hasUnknownChunk = true; +#if defined(SIDTUNE_REJECT_UNKNOWN_FIELDS) + info.formatString = _sidtune_txt_chunkError; + return false; +#endif + } + // Skip to next tool. + spTool += toolLen; + } + + // Collected ``required'' information complete ? + if ( hasAddress && hasName && hasAuthor && hasCopyright && hasSongs && hasSpeed ) + { + // Create the speed/clock setting table. + convertOldStyleSpeedToTables(oldStyleSpeed); + if (( info.loadAddr == 0 ) && ( dataLength != 0 )) + { + SmartPtr_sidtt<const uint_least8_t> spDataBuf((const uint_least8_t*)dataBuffer,dataLength); + spDataBuf += fileOffset; + info.loadAddr = endian_16(spDataBuf[1],spDataBuf[0]); + if ( !spDataBuf ) + { + info.formatString = _sidtune_txt_dataCorruptError; + return false; + } + fileOffset += 2; + } + if ( info.initAddr == 0 ) + { + info.initAddr = info.loadAddr; + } + info.numberOfInfoStrings = 3; + // We finally accept the input data. + info.formatString = _sidtune_txt_format; + return true; + } + else if ( hasAddress || hasName || hasAuthor || hasCopyright || hasSongs || hasSpeed ) + { + // Something is missing (or damaged?). + info.formatString = _sidtune_txt_corruptError; + return false; + } + else + { + // No PlaySID conform info strings. + info.formatString = _sidtune_txt_noStringsError; + return false; + } +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/InfoFile.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/InfoFile.cpp new file mode 100644 index 00000000..18e6d1b8 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/InfoFile.cpp @@ -0,0 +1,395 @@ +/* + * /home/ms/files/source/libsidtune/RCS/InfoFile.cpp,v + * + * SIDPLAY INFOFILE format support. + * + * 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 + */ + +#include "config.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif +#include <iostream> +#include <iomanip> +#include <strstream> +#include <ctype.h> +#include <string.h> + +#include "SidTune.h" +#include "SidTuneTools.h" +#include "sidendian.h" + + +const char text_format[] = "Raw plus SIDPLAY ASCII text file (SID)"; + +const char text_truncatedError[] = "ERROR: SID file is truncated"; +const char text_noMemError[] = "ERROR: Not enough free memory"; + +const char keyword_id[] = "SIDPLAY INFOFILE"; + +const char keyword_name[] = "NAME="; // No white-space characters +const char keyword_author[] = "AUTHOR="; // in these keywords, because +const char keyword_copyright[] = "COPYRIGHT="; // we want to use a white-space +const char keyword_released[] = "RELEASED="; // we want to use a white-space +const char keyword_address[] = "ADDRESS="; // eating string stream to +const char keyword_songs[] = "SONGS="; // parse most of the header. +const char keyword_speed[] = "SPEED="; +const char keyword_musPlayer[] = "SIDSONG=YES"; +const char keyword_reloc[] = "RELOC="; +const char keyword_clock[] = "CLOCK="; +const char keyword_sidModel[] = "SIDMODEL="; +const char keyword_compatibility[] = "COMPATIBILITY="; + +const uint_least16_t sidMinFileSize = 1+sizeof(keyword_id); // Just to avoid a first segm.fault. +const uint_least16_t parseChunkLen = 80; // Enough for all keywords incl. their values. + + +bool SidTune::SID_fileSupport(const void* dataBuffer, uint_least32_t dataBufLen, + const void* sidBuffer, uint_least32_t sidBufLen) +{ + // Make sure SID buffer pointer is not zero. + // Check for a minimum file size. If it is smaller, we will not proceed. + if ((sidBuffer==0) || (sidBufLen<sidMinFileSize)) + { + return false; + } + + const char* pParseBuf = (const char*)sidBuffer; + // First line has to contain the exact identification string. + if ( SidTuneTools::myStrNcaseCmp( pParseBuf, keyword_id ) != 0 ) + { + return false; + } + else + { + // At least the ID was found, so set a default error message. + info.formatString = text_truncatedError; + + // Defaults. + fileOffset = 0; // no header in separate data file + info.sidChipBase1 = 0xd400; + info.sidChipBase2 = 0; + info.musPlayer = false; + info.numberOfInfoStrings = 0; + uint_least32_t oldStyleSpeed = 0; + + // Flags for required entries. + bool hasAddress = false, + hasName = false, + hasAuthor = false, + hasReleased = false, + hasSongs = false, + hasSpeed = false; + + // Using a temporary instance of an input string chunk. +#ifdef HAVE_EXCEPTIONS + char* pParseChunk = new(std::nothrow) char[parseChunkLen+1]; +#else + char* pParseChunk = new char[parseChunkLen+1]; +#endif + if ( pParseChunk == 0 ) + { + info.formatString = text_noMemError; + return false; + } + + // Parse as long we have not collected all ``required'' entries. + //while ( !hasAddress || !hasName || !hasAuthor || !hasCopyright + // || !hasSongs || !hasSpeed ) + + // Above implementation is wrong, we need to get all known + // fields and then check if all ``required'' ones were found. + for (;;) + { + // Skip to next line. Leave loop, if none. + if (( pParseBuf = SidTuneTools::returnNextLine( pParseBuf )) == 0 ) + { + break; + } + // And get a second pointer to the following line. + const char* pNextLine = SidTuneTools::returnNextLine( pParseBuf ); + uint_least32_t restLen; + if ( pNextLine != 0 ) + { + // Calculate number of chars between current pos and next line. + restLen = (uint_least32_t)(pNextLine - pParseBuf); + } + else + { + // Calculate number of chars between current pos and end of buf. + restLen = sidBufLen - (uint_least32_t)(pParseBuf - (char*)sidBuffer); + } + // Create whitespace eating (!) input string stream. + std::istrstream parseStream((char *) pParseBuf, restLen ); + // A second one just for copying. + std::istrstream parseCopyStream((char *) pParseBuf, restLen ); + if ( !parseStream || !parseCopyStream ) + { + break; + } + // Now copy the next X characters except white-spaces. + for ( uint_least16_t i = 0; i < parseChunkLen; i++ ) + { + char c; + parseCopyStream >> c; + pParseChunk[i] = c; + } + pParseChunk[parseChunkLen]=0; + // Now check for the possible keywords. + // ADDRESS + if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_address ) == 0 ) + { + SidTuneTools::skipToEqu( parseStream ); + info.loadAddr = (uint_least16_t)SidTuneTools::readHex( parseStream ); + if ( !parseStream ) + break; + info.initAddr = (uint_least16_t)SidTuneTools::readHex( parseStream ); + if ( !parseStream ) + break; + info.playAddr = (uint_least16_t)SidTuneTools::readHex( parseStream ); + hasAddress = true; + } + // NAME + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_name ) == 0 ) + { + SidTuneTools::copyStringValueToEOL(pParseBuf,&infoString[0][0],SIDTUNE_MAX_CREDIT_STRLEN); + info.infoString[0] = &infoString[0][0]; + hasName = true; + } + // AUTHOR + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_author ) == 0 ) + { + SidTuneTools::copyStringValueToEOL(pParseBuf,&infoString[1][0],SIDTUNE_MAX_CREDIT_STRLEN); + info.infoString[1] = &infoString[1][0]; + hasAuthor = true; + } + // COPYRIGHT + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_copyright ) == 0 ) + { + SidTuneTools::copyStringValueToEOL(pParseBuf,&infoString[2][0],SIDTUNE_MAX_CREDIT_STRLEN); + info.infoString[2] = &infoString[2][0]; + hasReleased = true; + } + // RELEASED + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_released ) == 0 ) + { + SidTuneTools::copyStringValueToEOL(pParseBuf,&infoString[2][0],SIDTUNE_MAX_CREDIT_STRLEN); + info.infoString[2] = &infoString[2][0]; + hasReleased = true; + } + // SONGS + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_songs ) == 0 ) + { + SidTuneTools::skipToEqu( parseStream ); + info.songs = (uint_least16_t)SidTuneTools::readDec( parseStream ); + info.startSong = (uint_least16_t)SidTuneTools::readDec( parseStream ); + hasSongs = true; + } + // SPEED + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_speed ) == 0 ) + { + SidTuneTools::skipToEqu( parseStream ); + oldStyleSpeed = SidTuneTools::readHex(parseStream); + hasSpeed = true; + } + // SIDSONG + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_musPlayer ) == 0 ) + { + info.musPlayer = true; + } + // RELOC + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_reloc ) == 0 ) + { + info.relocStartPage = (uint_least8_t)SidTuneTools::readHex( parseStream ); + if ( !parseStream ) + break; + info.relocPages = (uint_least8_t)SidTuneTools::readHex( parseStream ); + } + // CLOCK + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_clock ) == 0 ) + { + char clock[8]; + SidTuneTools::copyStringValueToEOL(pParseBuf,clock,sizeof(clock)); + if ( SidTuneTools::myStrNcaseCmp( clock, "UNKNOWN" ) == 0 ) + info.clockSpeed = SIDTUNE_CLOCK_UNKNOWN; + else if ( SidTuneTools::myStrNcaseCmp( clock, "PAL" ) == 0 ) + info.clockSpeed = SIDTUNE_CLOCK_PAL; + else if ( SidTuneTools::myStrNcaseCmp( clock, "NTSC" ) == 0 ) + info.clockSpeed = SIDTUNE_CLOCK_NTSC; + else if ( SidTuneTools::myStrNcaseCmp( clock, "ANY" ) == 0 ) + info.clockSpeed = SIDTUNE_CLOCK_ANY; + } + // SIDMODEL + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_sidModel ) == 0 ) + { + char model[8]; + SidTuneTools::copyStringValueToEOL(pParseBuf,model,sizeof(model)); + if ( SidTuneTools::myStrNcaseCmp( model, "UNKNOWN" ) == 0 ) + info.sidModel = SIDTUNE_SIDMODEL_UNKNOWN; + else if ( SidTuneTools::myStrNcaseCmp( model, "6581" ) == 0 ) + info.sidModel = SIDTUNE_SIDMODEL_6581; + else if ( SidTuneTools::myStrNcaseCmp( model, "8580" ) == 0 ) + info.sidModel = SIDTUNE_SIDMODEL_8580; + else if ( SidTuneTools::myStrNcaseCmp( model, "ANY" ) == 0 ) + info.sidModel = SIDTUNE_SIDMODEL_ANY; + } + // COMPATIBILITY + else if ( SidTuneTools::myStrNcaseCmp( pParseChunk, keyword_compatibility ) == 0 ) + { + char comp[5]; + SidTuneTools::copyStringValueToEOL(pParseBuf,comp,sizeof(comp)); + if ( SidTuneTools::myStrNcaseCmp( comp, "C64" ) == 0 ) + info.compatibility = SIDTUNE_COMPATIBILITY_C64; + else if ( SidTuneTools::myStrNcaseCmp( comp, "PSID" ) == 0 ) + info.compatibility = SIDTUNE_COMPATIBILITY_PSID; + else if ( SidTuneTools::myStrNcaseCmp( comp, "R64" ) == 0 ) + info.compatibility = SIDTUNE_COMPATIBILITY_R64; + } + }; + + delete[] pParseChunk; + + // Again check for the ``required'' values. + if ( hasAddress || hasName || hasAuthor || hasReleased || hasSongs || hasSpeed ) + { + // Check reserved fields to force real c64 compliance + if (info.compatibility == SIDTUNE_COMPATIBILITY_R64) + { + if (checkRealC64Info (oldStyleSpeed) == false) + return false; + } + // Create the speed/clock setting table. + convertOldStyleSpeedToTables(oldStyleSpeed, info.clockSpeed); + // loadAddr = 0 means, the address is stored in front of the C64 data. + // We cannot verify whether the dataBuffer contains valid data. + // All we want to know is whether the SID buffer is valid. + // If data is present, we access it (here to get the C64 load address). + if (info.loadAddr==0 && (dataBufLen>=(fileOffset+2)) && dataBuffer!=0) + { + const uint8_t* pDataBufCp = (const uint8_t*)dataBuffer + fileOffset; + info.loadAddr = endian_16( *(pDataBufCp + 1), *pDataBufCp ); + fileOffset += 2; // begin of data + } + // Keep compatibility to PSID/SID. + if ( info.initAddr == 0 ) + { + info.initAddr = info.loadAddr; + } + info.numberOfInfoStrings = 3; + // We finally accept the input data. + info.formatString = text_format; + return true; + } + else + { + // Something is missing (or damaged ?). + // Error string set above. + return false; + } + } +} + + +bool SidTune::SID_fileSupportSave( std::ofstream& toFile ) +{ + toFile << keyword_id << std::endl + << keyword_address << std::hex << std::setw(4) + << std::setfill('0') << 0 << ',' + << std::hex << std::setw(4) << info.initAddr << "," + << std::hex << std::setw(4) << info.playAddr << std::endl + << keyword_songs << std::dec << (int)info.songs << "," + << (int)info.startSong << std::endl; + + uint_least32_t oldStyleSpeed = 0; + int maxBugSongs = ((info.songs <= 32) ? info.songs : 32); + for (int s = 0; s < maxBugSongs; s++) + { + if (songSpeed[s] == SIDTUNE_SPEED_CIA_1A) + { + oldStyleSpeed |= (1<<s); + } + } + + toFile + << keyword_speed << std::hex << std::setw(8) + << oldStyleSpeed << std::endl + << keyword_name << info.infoString[0] << std::endl + << keyword_author << info.infoString[1] << std::endl + << keyword_released << info.infoString[2] << std::endl; + if ( info.musPlayer ) + { + toFile << keyword_musPlayer << std::endl; + } + if ( info.relocStartPage ) + { + toFile + << keyword_reloc << std::setfill('0') + << std::hex << std::setw(2) << (int) info.relocStartPage << "," + << std::hex << std::setw(2) << (int) info.relocPages << std::endl; + } + if ( info.clockSpeed != SIDTUNE_CLOCK_UNKNOWN ) + { + toFile << keyword_clock; + switch (info.clockSpeed) + { + case SIDTUNE_CLOCK_PAL: + toFile << "PAL"; + break; + case SIDTUNE_CLOCK_NTSC: + toFile << "NTSC"; + break; + case SIDTUNE_CLOCK_ANY: + toFile << "ANY"; + break; + } + toFile << std::endl; + } + if ( info.sidModel != SIDTUNE_SIDMODEL_UNKNOWN ) + { + toFile << keyword_sidModel; + switch (info.sidModel) + { + case SIDTUNE_SIDMODEL_6581: + toFile << "6581"; + break; + case SIDTUNE_SIDMODEL_8580: + toFile << "8580"; + break; + case SIDTUNE_SIDMODEL_ANY: + toFile << "ANY"; + break; + } + toFile << std::endl; + } + if ( info.compatibility == SIDTUNE_COMPATIBILITY_PSID ) + { + toFile << keyword_compatibility << "C64" << std::endl; + } + else if ( info.compatibility == SIDTUNE_COMPATIBILITY_R64 ) + { + toFile << keyword_compatibility << "R64" << std::endl; + } + + if ( !toFile ) + { + return false; + } + else + { + return true; + } +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/MUS.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/MUS.cpp new file mode 100644 index 00000000..16ea8fe9 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/MUS.cpp @@ -0,0 +1,681 @@ +/* + * /home/ms/files/source/libsidtune/RCS/MUS.cpp,v + * + * Sidplayer and Stereo Sidplayer format support. + * + * 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 + */ + +#include <string.h> + +#include "config.h" +#include "SidTuneCfg.h" +#include "SidTune.h" +#include "sidendian.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif + +static const char _sidtune_txt_format_mus[] = "C64 Sidplayer format (MUS)"; +static const char _sidtune_txt_format_str[] = "C64 Stereo Sidplayer format (MUS+STR)"; +static const char _sidtune_txt_notEnoughMemory[] = "ERROR: Not enough free memory"; +static const char _sidtune_txt_sizeExceeded[] = "ERROR: Total file size too large"; + +static const uint_least16_t SIDTUNE_MUS_HLT_CMD = 0x14F; + +static const uint_least16_t SIDTUNE_MUS_DATA_ADDR = 0x0900; +static const uint_least16_t SIDTUNE_SID1_BASE_ADDR = 0xd400; +static const uint_least16_t SIDTUNE_SID2_BASE_ADDR = 0xd500; + +bool SidTune::MUS_fileSupport(Buffer_sidtt<const uint8_t>& musBuf, + Buffer_sidtt<const uint8_t>& strBuf) +{ + // Clear info strings. + for (int i = 0; i < SIDTUNE_MAX_CREDIT_STRINGS; i++) + infoString[i][0] = 0; + + uint_least32_t voice3Index; + if ( !MUS_detect(musBuf.get(),musBuf.len(),voice3Index) ) + return false; + + // Voice3Index now is offset to text lines (uppercase Pet-strings). + SmartPtr_sidtt<const uint8_t> spPet(musBuf.get(),musBuf.len()); + spPet += voice3Index; + { + for ( int line = 0; line < 5; line++ ) + { + MUS_decodePetLine(spPet,infoString[line]); + info.infoString[line] = infoString[line]; + } + } + info.numberOfInfoStrings = 5; + + info.loadAddr = SIDTUNE_MUS_DATA_ADDR; + info.sidChipBase1 = SIDTUNE_SID1_BASE_ADDR; + info.songs = (info.startSong = 1); + info.musPlayer = true; + + songSpeed[0] = SIDTUNE_SPEED_CIA_1A; +#ifdef SIDTUNE_PSID2NG + clockSpeed[0] = SIDTUNE_CLOCK_ANY; +#endif + fileOffset = 2; // data after load address + + if ( !strBuf.isEmpty() ) + { + if ( !MUS_detect(strBuf.get(),strBuf.len(),voice3Index) ) + return false; + + // Voice3Index now is offset to text lines (uppercase Pet-strings). + SmartPtr_sidtt<const uint8_t> spPet(strBuf.get(),strBuf.len()); + spPet += voice3Index; + for ( int line = 5; line < 10; line++ ) + { + MUS_decodePetLine(spPet,infoString[line]); + info.infoString[line] = infoString[line]; + } + info.numberOfInfoStrings += 5; + + info.sidChipBase2 = SIDTUNE_SID2_BASE_ADDR; + info.formatString = _sidtune_txt_format_str; + } + else + { + info.sidChipBase2 = 0; + info.formatString = _sidtune_txt_format_mus; + } + MUS_setPlayerAddress(); + + // Remove trailing empty lines. + const int lines = info.numberOfInfoStrings; + { + for ( int line = lines-1; line >= 0; line-- ) + { + if (strlen(info.infoString[line]) == 0) + --info.numberOfInfoStrings; + else + break; + } + } + + return true; +} + +bool SidTune::MUS_detect(const void* buffer, const uint_least32_t bufLen, + uint_least32_t& voice3Index) +{ + SmartPtr_sidtt<const uint8_t> spMus((const uint8_t*)buffer,bufLen); + // Skip load address and 3x length entry. + uint_least32_t voice1Index = (2+3*2); + // Add length of voice 1 data. + voice1Index += endian_16(spMus[3],spMus[2]); + // Add length of voice 2 data. + uint_least32_t voice2Index = voice1Index + endian_16(spMus[5],spMus[4]); + // Add length of voice 3 data. + voice3Index = voice2Index + endian_16(spMus[7],spMus[6]); + return ((endian_16(spMus[voice1Index-2],spMus[voice1Index+1-2]) == SIDTUNE_MUS_HLT_CMD) + && (endian_16(spMus[voice2Index-2],spMus[voice2Index+1-2]) == SIDTUNE_MUS_HLT_CMD) + && (endian_16(spMus[voice3Index-2],spMus[voice3Index+1-2]) == SIDTUNE_MUS_HLT_CMD) + && spMus); +} + +void SidTune::MUS_setPlayerAddress() +{ + if (info.sidChipBase2 == 0) + { + // Player #1. + info.initAddr = 0xec60; + info.playAddr = 0xec80; + } + else + { + // Player #1 + #2. + info.initAddr = 0xfc90; + info.playAddr = 0xfc96; + } +} + +static const char _sidtune_CHRtab[256] = // CHR$ conversion table (0x01 = no output) +{ + 0x0, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xd, 0x1, 0x1, + 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x20,0x21, 0x1,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, + 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, + 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, + 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x24,0x5d,0x20,0x20, + // alternative: CHR$(92=0x5c) => ISO Latin-1(0xa3) + 0x2d,0x23,0x7c,0x2d,0x2d,0x2d,0x2d,0x7c,0x7c,0x5c,0x5c,0x2f,0x5c,0x5c,0x2f,0x2f, + 0x5c,0x23,0x5f,0x23,0x7c,0x2f,0x58,0x4f,0x23,0x7c,0x23,0x2b,0x7c,0x7c,0x26,0x5c, + // 0x80-0xFF + 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, + 0x20,0x7c,0x23,0x2d,0x2d,0x7c,0x23,0x7c,0x23,0x2f,0x7c,0x7c,0x2f,0x5c,0x5c,0x2d, + 0x2f,0x2d,0x2d,0x7c,0x7c,0x7c,0x7c,0x2d,0x2d,0x2d,0x2f,0x5c,0x5c,0x2f,0x2f,0x23, + 0x2d,0x23,0x7c,0x2d,0x2d,0x2d,0x2d,0x7c,0x7c,0x5c,0x5c,0x2f,0x5c,0x5c,0x2f,0x2f, + 0x5c,0x23,0x5f,0x23,0x7c,0x2f,0x58,0x4f,0x23,0x7c,0x23,0x2b,0x7c,0x7c,0x26,0x5c, + 0x20,0x7c,0x23,0x2d,0x2d,0x7c,0x23,0x7c,0x23,0x2f,0x7c,0x7c,0x2f,0x5c,0x5c,0x2d, + 0x2f,0x2d,0x2d,0x7c,0x7c,0x7c,0x7c,0x2d,0x2d,0x2d,0x2f,0x5c,0x5c,0x2f,0x2f,0x23 +}; + +int SidTune::MUS_decodePetLine(SmartPtr_sidtt<const uint8_t>& spPet, char* dest) +{ + int count = 0; + char c; + do + { + c = _sidtune_CHRtab[*spPet]; // ASCII CHR$ conversion + if ((c>=0x20) && (count<=31)) + { + dest[count++] = c; // copy to info string + } + // If character is 0x9d (left arrow key) then move back. + if ((*spPet==0x9d) && (count>=0)) + { + count--; + } + spPet++; + } + while ( !((c==0x0D)||(c==0x00)||spPet.fail()) ); + return count; +} + +static const uint8_t _sidtune_sidplayer1[] = +{ + 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x61, 0xe1, 0x60, 0x01, 0x02, 0x04, 0x00, 0x07, 0x0e, 0x02, 0x02, 0xfe, 0x02, 0x02, 0xfe, + 0xfe, 0x00, 0x01, 0x00, 0xff, 0x00, 0x02, 0x04, 0x05, 0x07, 0x09, 0x0b, 0x1e, 0x18, 0x8b, 0x7e, + 0xfa, 0x06, 0xac, 0xf3, 0xe6, 0x8f, 0xf8, 0x2e, 0x86, 0x8e, 0x96, 0x9f, 0xa8, 0xb3, 0xbd, 0xc8, + 0xd4, 0xe1, 0xee, 0xfd, 0x8c, 0x78, 0x64, 0x50, 0x3c, 0x28, 0x14, 0x00, 0x00, 0x02, 0x03, 0x05, + 0x07, 0x08, 0x0a, 0x0c, 0x0d, 0x0f, 0x11, 0x12, 0x00, 0xe0, 0x00, 0x05, 0x0a, 0x0f, 0xf9, 0x00, + 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x50, 0x00, 0x00, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0x80, 0x00, 0x00, 0x90, 0x00, 0x00, 0xa0, + 0x00, 0xa9, 0x00, 0x8d, 0x00, 0xe0, 0xa2, 0x95, 0xa0, 0x42, 0xad, 0xa6, 0x02, 0xf0, 0x04, 0xa2, + 0x25, 0xa0, 0x40, 0x8e, 0x5b, 0xe1, 0x8c, 0x5c, 0xe1, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0x60, 0xa9, 0x00, 0x8d, 0x00, 0xe0, 0x86, 0x61, 0x84, 0x62, 0xa0, 0xbc, 0x99, 0x00, 0xe0, + 0x88, 0xd0, 0xfa, 0xa0, 0x72, 0x99, 0xbc, 0xe0, 0x88, 0xd0, 0xfa, 0x8d, 0x15, 0xd4, 0x8d, 0x16, + 0xd4, 0xa9, 0x08, 0x8d, 0x25, 0xe0, 0x8d, 0x17, 0xd4, 0x8d, 0x26, 0xe0, 0x8d, 0x18, 0xd4, 0xa9, + 0x90, 0x8d, 0x27, 0xe0, 0xa9, 0x60, 0x8d, 0x28, 0xe0, 0xa9, 0x0c, 0x8d, 0x29, 0xe0, 0xad, 0x5b, + 0xe1, 0x8d, 0x2d, 0xe0, 0xad, 0x5c, 0xe1, 0x8d, 0x2e, 0xe0, 0xa9, 0xff, 0x8d, 0xcc, 0xe0, 0xa9, + 0xd4, 0x85, 0x64, 0xa2, 0x02, 0xa9, 0xff, 0x9d, 0x0b, 0xe0, 0xa9, 0x01, 0x9d, 0x30, 0xe0, 0x9d, + 0x2a, 0xe0, 0x8a, 0x9d, 0x33, 0xe0, 0x9d, 0xae, 0xe0, 0xa9, 0x04, 0x9d, 0x39, 0xe0, 0xbd, 0xa8, + 0xe1, 0x9d, 0xba, 0xe0, 0xa9, 0x5b, 0x9d, 0x7e, 0xe0, 0xbd, 0x65, 0xe1, 0x85, 0x63, 0xa9, 0x00, + 0xa8, 0x91, 0x63, 0xc8, 0x91, 0x63, 0xc8, 0x91, 0x63, 0xa9, 0x08, 0x9d, 0x17, 0xe0, 0x9d, 0x9c, + 0xe0, 0xc8, 0x91, 0x63, 0xc8, 0x91, 0x63, 0xa9, 0x40, 0x9d, 0x1a, 0xe0, 0x91, 0x63, 0xa9, 0x20, + 0x9d, 0x1d, 0xe0, 0xc8, 0x91, 0x63, 0xa9, 0xf5, 0x9d, 0x20, 0xe0, 0xc8, 0x91, 0x63, 0xca, 0x10, + 0xa4, 0x8a, 0xa2, 0x17, 0x9d, 0x3e, 0xe1, 0xca, 0x10, 0xfa, 0xa5, 0x61, 0x18, 0x69, 0x06, 0x85, + 0x63, 0xa9, 0x00, 0xaa, 0xa8, 0x65, 0x62, 0x85, 0x64, 0x9d, 0xab, 0xe0, 0x9d, 0xb4, 0xe0, 0xa5, + 0x63, 0x9d, 0xa8, 0xe0, 0x9d, 0xb1, 0xe0, 0x18, 0x71, 0x61, 0x85, 0x63, 0xa5, 0x64, 0xc8, 0x71, + 0x61, 0xc8, 0xe8, 0xe0, 0x03, 0xd0, 0xe0, 0xa6, 0x63, 0xa8, 0x60, 0xa9, 0x00, 0x8d, 0x04, 0xd4, + 0x8d, 0x0b, 0xd4, 0x8d, 0x12, 0xd4, 0x8d, 0x01, 0xd4, 0x8d, 0x08, 0xd4, 0x8d, 0x0f, 0xd4, 0xa9, + 0x08, 0x8d, 0x17, 0xd4, 0xad, 0x5b, 0xe1, 0x8d, 0x04, 0xdc, 0xad, 0x5c, 0xe1, 0x8d, 0x05, 0xdc, + 0x60, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0x60, + 0xa9, 0x08, 0x8d, 0x00, 0xe0, 0x6c, 0x5d, 0xe1, 0xea, 0xea, 0xea, 0xad, 0x00, 0xe0, 0x30, 0xf0, + 0x09, 0x80, 0xa8, 0x29, 0x07, 0xf0, 0xee, 0xd8, 0x8c, 0x00, 0xe0, 0xea, 0xa5, 0xfb, 0x8d, 0x56, + 0xe1, 0xa5, 0xfc, 0x8d, 0x57, 0xe1, 0xa5, 0xfd, 0x8d, 0x58, 0xe1, 0xa5, 0xfe, 0x8d, 0x59, 0xe1, + 0xa5, 0xff, 0x8d, 0x5a, 0xe1, 0xad, 0x23, 0xe0, 0x18, 0x6d, 0xd9, 0xe0, 0x48, 0x29, 0x07, 0xa8, + 0xad, 0xdc, 0xe0, 0x69, 0x00, 0x85, 0xff, 0x68, 0x46, 0xff, 0x6a, 0x46, 0xff, 0x6a, 0x46, 0xff, + 0x6a, 0x18, 0x6d, 0x24, 0xe0, 0x8c, 0x15, 0xd4, 0x8d, 0x16, 0xd4, 0xad, 0x25, 0xe0, 0x8d, 0x17, + 0xd4, 0xad, 0x26, 0xe0, 0x8d, 0x18, 0xd4, 0xa9, 0xd4, 0x85, 0xfc, 0xa2, 0x00, 0xad, 0x00, 0xe0, + 0x3d, 0x62, 0xe1, 0xf0, 0x51, 0xbd, 0x65, 0xe1, 0x85, 0xfb, 0xbd, 0x0e, 0xe0, 0x18, 0x7d, 0x51, + 0xe0, 0xa8, 0xbd, 0x11, 0xe0, 0x7d, 0x54, 0xe0, 0x48, 0x98, 0x18, 0x7d, 0xcd, 0xe0, 0xa0, 0x00, + 0x91, 0xfb, 0x68, 0x7d, 0xd0, 0xe0, 0xc8, 0x91, 0xfb, 0xbd, 0x14, 0xe0, 0x18, 0x7d, 0x69, 0xe0, + 0x85, 0xff, 0xbd, 0x17, 0xe0, 0x7d, 0x6c, 0xe0, 0x48, 0xa5, 0xff, 0x18, 0x7d, 0xd3, 0xe0, 0xc8, + 0x91, 0xfb, 0x68, 0x7d, 0xd6, 0xe0, 0xc8, 0x91, 0xfb, 0xbd, 0x1d, 0xe0, 0xc8, 0xc8, 0x91, 0xfb, + 0xbd, 0x20, 0xe0, 0xc8, 0x91, 0xfb, 0xe8, 0xe0, 0x03, 0xd0, 0xa2, 0xac, 0x1a, 0xe0, 0xae, 0x1b, + 0xe0, 0xad, 0x1c, 0xe0, 0x8c, 0x04, 0xd4, 0x8e, 0x0b, 0xd4, 0x8d, 0x12, 0xd4, 0xae, 0x2d, 0xe0, + 0xac, 0x2e, 0xe0, 0x8e, 0x04, 0xdc, 0x8c, 0x05, 0xdc, 0xad, 0x1b, 0xd4, 0x8d, 0xbe, 0xe0, 0xad, + 0x1c, 0xd4, 0x8d, 0xbf, 0xe0, 0xa2, 0x00, 0xad, 0x00, 0xe0, 0x3d, 0x62, 0xe1, 0xf0, 0x10, 0x8e, + 0x2f, 0xe0, 0x20, 0x36, 0xe5, 0xad, 0x00, 0xe0, 0x29, 0x78, 0xf0, 0x03, 0x4c, 0x0c, 0xe5, 0xe8, + 0xe0, 0x03, 0xd0, 0xe3, 0xad, 0xc9, 0xe0, 0xd0, 0x52, 0xad, 0xca, 0xe0, 0x0d, 0xcb, 0xe0, 0xf0, + 0x78, 0xad, 0xdf, 0xe0, 0xd0, 0x28, 0xad, 0xca, 0xe0, 0xf0, 0x28, 0x18, 0x6d, 0xbd, 0xe0, 0xb0, + 0x07, 0xcd, 0xcc, 0xe0, 0x90, 0x60, 0xf0, 0x5e, 0xa9, 0x00, 0x8d, 0xdf, 0xe0, 0xad, 0xcb, 0xe0, + 0xf0, 0x54, 0xee, 0xdf, 0xe0, 0xad, 0xbd, 0xe0, 0xed, 0xcb, 0xe0, 0x4c, 0xb4, 0xe4, 0xad, 0xcb, + 0xe0, 0xf0, 0xd3, 0xad, 0xbd, 0xe0, 0x38, 0xed, 0xcb, 0xe0, 0xb0, 0x3a, 0xa9, 0x00, 0x8d, 0xdf, + 0xe0, 0xad, 0xca, 0xe0, 0xd0, 0x30, 0xee, 0xdf, 0xe0, 0xd0, 0x28, 0xce, 0xe0, 0xe0, 0xd0, 0x29, + 0xad, 0xdf, 0xe0, 0xd0, 0x11, 0xee, 0xdf, 0xe0, 0xad, 0xcb, 0xe0, 0xd0, 0x02, 0xa9, 0x20, 0x8d, + 0xe0, 0xe0, 0xa9, 0x00, 0xf0, 0x10, 0xce, 0xdf, 0xe0, 0xad, 0xca, 0xe0, 0xd0, 0x02, 0xa9, 0x20, + 0x8d, 0xe0, 0xe0, 0xad, 0xcc, 0xe0, 0x8d, 0xbd, 0xe0, 0xa2, 0x00, 0xbd, 0xc3, 0xe0, 0xf0, 0x44, + 0xa9, 0x00, 0x85, 0xff, 0xbc, 0xc0, 0xe0, 0xb9, 0xbd, 0xe0, 0xbc, 0xc6, 0xe0, 0xf0, 0x0e, 0x30, + 0x08, 0x0a, 0x26, 0xff, 0x88, 0xd0, 0xfa, 0xf0, 0x04, 0x4a, 0xc8, 0xd0, 0xfc, 0xbc, 0xc3, 0xe0, + 0x88, 0xd0, 0x0b, 0x9d, 0xcd, 0xe0, 0xa5, 0xff, 0x9d, 0xd0, 0xe0, 0x4c, 0x02, 0xe5, 0x88, 0xd0, + 0x0b, 0x9d, 0xd3, 0xe0, 0xa5, 0xff, 0x9d, 0xd6, 0xe0, 0x4c, 0x02, 0xe5, 0x8d, 0xd9, 0xe0, 0xa5, + 0xff, 0x8d, 0xdc, 0xe0, 0xe8, 0xe0, 0x03, 0xd0, 0xb2, 0xad, 0x00, 0xe0, 0x29, 0x7f, 0x8d, 0x00, + 0xe0, 0xad, 0x56, 0xe1, 0x85, 0xfb, 0xad, 0x57, 0xe1, 0x85, 0xfc, 0xad, 0x58, 0xe1, 0x85, 0xfd, + 0xad, 0x59, 0xe1, 0x85, 0xfe, 0xad, 0x5a, 0xe1, 0x85, 0xff, 0x6c, 0x5d, 0xe1, 0xbd, 0x60, 0xe0, + 0xd0, 0x03, 0x4c, 0x9f, 0xe6, 0x4c, 0xba, 0xe5, 0xde, 0x30, 0xe0, 0xd0, 0x03, 0x4c, 0xa0, 0xe6, + 0xbd, 0x36, 0xe0, 0x30, 0xe8, 0xd0, 0x1a, 0xbd, 0x3f, 0xe0, 0xf0, 0x05, 0xde, 0x3f, 0xe0, 0xd0, + 0x10, 0xbd, 0x39, 0xe0, 0xdd, 0x30, 0xe0, 0x90, 0x08, 0xbd, 0x1a, 0xe0, 0x29, 0xfe, 0x9d, 0x1a, + 0xe0, 0xbd, 0x42, 0xe0, 0xf0, 0x56, 0x0a, 0xbd, 0x0e, 0xe0, 0xb0, 0x1d, 0x7d, 0x45, 0xe0, 0x9d, + 0x0e, 0xe0, 0xa8, 0xbd, 0x11, 0xe0, 0x7d, 0x48, 0xe0, 0x9d, 0x11, 0xe0, 0x48, 0x98, 0xdd, 0x8d, + 0xe0, 0x68, 0xfd, 0x90, 0xe0, 0xb0, 0x1f, 0x90, 0x2e, 0xfd, 0x45, 0xe0, 0x9d, 0x0e, 0xe0, 0xbd, + 0x11, 0xe0, 0xfd, 0x48, 0xe0, 0x9d, 0x11, 0xe0, 0xbd, 0x8d, 0xe0, 0xdd, 0x0e, 0xe0, 0xbd, 0x90, + 0xe0, 0xfd, 0x11, 0xe0, 0x90, 0x11, 0xbd, 0x8d, 0xe0, 0x9d, 0x0e, 0xe0, 0xbd, 0x90, 0xe0, 0x9d, + 0x11, 0xe0, 0xa9, 0x00, 0x9d, 0x42, 0xe0, 0xbd, 0x60, 0xe0, 0xf0, 0x55, 0xbd, 0x4b, 0xe0, 0xf0, + 0x4b, 0xa0, 0x00, 0xde, 0x4e, 0xe0, 0xd0, 0x31, 0xbd, 0x51, 0xe0, 0x1d, 0x54, 0xe0, 0xd0, 0x1b, + 0xbd, 0x5d, 0xe0, 0x9d, 0x57, 0xe0, 0x9d, 0x4e, 0xe0, 0xbd, 0x4b, 0xe0, 0x0a, 0xbd, 0x5a, 0xe0, + 0x90, 0x04, 0x49, 0xff, 0x69, 0x00, 0x9d, 0x4b, 0xe0, 0xd0, 0x10, 0xbd, 0x57, 0xe0, 0x9d, 0x4e, + 0xe0, 0x98, 0x38, 0xfd, 0x4b, 0xe0, 0x9d, 0x4b, 0xe0, 0xc9, 0x00, 0x10, 0x01, 0x88, 0x18, 0x7d, + 0x51, 0xe0, 0x9d, 0x51, 0xe0, 0x98, 0x7d, 0x54, 0xe0, 0x9d, 0x54, 0xe0, 0xbd, 0x36, 0xe0, 0x30, + 0x15, 0xbd, 0x93, 0xe0, 0xf0, 0x10, 0x18, 0x7d, 0x14, 0xe0, 0x9d, 0x14, 0xe0, 0xbd, 0x96, 0xe0, + 0x7d, 0x17, 0xe0, 0x9d, 0x17, 0xe0, 0xbd, 0x63, 0xe0, 0xf0, 0x4b, 0xa0, 0x00, 0xde, 0x66, 0xe0, + 0xd0, 0x31, 0xbd, 0x69, 0xe0, 0x1d, 0x6c, 0xe0, 0xd0, 0x1b, 0xbd, 0x72, 0xe0, 0x9d, 0x6f, 0xe0, + 0x9d, 0x66, 0xe0, 0xbd, 0x63, 0xe0, 0x0a, 0xbd, 0x75, 0xe0, 0x90, 0x04, 0x49, 0xff, 0x69, 0x00, + 0x9d, 0x63, 0xe0, 0xd0, 0x10, 0xbd, 0x6f, 0xe0, 0x9d, 0x66, 0xe0, 0x98, 0x38, 0xfd, 0x63, 0xe0, + 0x9d, 0x63, 0xe0, 0xc9, 0x00, 0x10, 0x01, 0x88, 0x18, 0x7d, 0x69, 0xe0, 0x9d, 0x69, 0xe0, 0x98, + 0x7d, 0x6c, 0xe0, 0x9d, 0x6c, 0xe0, 0xbd, 0x36, 0xe0, 0x10, 0x03, 0x4c, 0x9f, 0xe6, 0xa0, 0x00, + 0xbd, 0xa2, 0xe0, 0xf0, 0x1c, 0x10, 0x01, 0xc8, 0x18, 0x6d, 0x23, 0xe0, 0x48, 0x29, 0x07, 0x8d, + 0x23, 0xe0, 0x68, 0x6a, 0x4a, 0x4a, 0x18, 0x79, 0xa6, 0xe1, 0x18, 0x6d, 0x24, 0xe0, 0x8d, 0x24, + 0xe0, 0x60, 0xbd, 0xa8, 0xe0, 0x85, 0xfd, 0xbd, 0xab, 0xe0, 0x85, 0xfe, 0xd0, 0x04, 0x60, 0x20, + 0x98, 0xe8, 0xad, 0x00, 0xe0, 0x3d, 0x62, 0xe1, 0xf0, 0xf4, 0xa0, 0x00, 0xb1, 0xfd, 0x85, 0xff, + 0xc8, 0xb1, 0xfd, 0xa8, 0xa5, 0xfd, 0x18, 0x69, 0x02, 0x85, 0xfd, 0x9d, 0xa8, 0xe0, 0xa5, 0xfe, + 0x69, 0x00, 0x85, 0xfe, 0x9d, 0xab, 0xe0, 0xa5, 0xff, 0x29, 0x03, 0xd0, 0xd2, 0xbd, 0x8d, 0xe0, + 0x9d, 0x0e, 0xe0, 0xbd, 0x90, 0xe0, 0x9d, 0x11, 0xe0, 0xa5, 0xff, 0x9d, 0x05, 0xe0, 0x98, 0x9d, + 0x02, 0xe0, 0x29, 0x07, 0xa8, 0xb9, 0x67, 0xe1, 0x8d, 0x6f, 0xe1, 0xbd, 0x02, 0xe0, 0x29, 0x38, + 0x4a, 0x4a, 0x4a, 0x7d, 0x81, 0xe0, 0x85, 0xfd, 0xbd, 0x02, 0xe0, 0x29, 0xc0, 0x0a, 0x2a, 0x2a, + 0xa8, 0xb9, 0x6f, 0xe1, 0x85, 0xfe, 0xbd, 0x02, 0xe0, 0x29, 0x07, 0xf0, 0x62, 0xa8, 0xb9, 0x72, + 0xe1, 0x65, 0xfe, 0x18, 0x7d, 0x84, 0xe0, 0x10, 0x05, 0x18, 0x69, 0x0c, 0xe6, 0xfd, 0xc9, 0x0c, + 0x90, 0x04, 0xe9, 0x0c, 0xc6, 0xfd, 0x85, 0xfe, 0xa8, 0xb9, 0x86, 0xe1, 0x85, 0xff, 0xb9, 0x7a, + 0xe1, 0xa4, 0xfd, 0x88, 0x30, 0x06, 0x46, 0xff, 0x6a, 0x88, 0x10, 0xfa, 0x18, 0x7d, 0x87, 0xe0, + 0x9d, 0x8d, 0xe0, 0xa5, 0xff, 0x7d, 0x8a, 0xe0, 0x9d, 0x90, 0xe0, 0xbd, 0x05, 0xe0, 0xd0, 0x03, + 0x4c, 0xa0, 0xe6, 0xbd, 0x45, 0xe0, 0x1d, 0x48, 0xe0, 0xf0, 0x16, 0xbd, 0x0e, 0xe0, 0xdd, 0x8d, + 0xe0, 0xbd, 0x11, 0xe0, 0xfd, 0x90, 0xe0, 0xa9, 0xfe, 0x6a, 0x9d, 0x42, 0xe0, 0x90, 0x11, 0xf0, + 0x4a, 0x9d, 0x42, 0xe0, 0xbd, 0x8d, 0xe0, 0x9d, 0x0e, 0xe0, 0xbd, 0x90, 0xe0, 0x9d, 0x11, 0xe0, + 0xbd, 0x36, 0xe0, 0x0a, 0xd0, 0x35, 0xbd, 0x93, 0xe0, 0xf0, 0x0c, 0xbd, 0x99, 0xe0, 0x9d, 0x14, + 0xe0, 0xbd, 0x9c, 0xe0, 0x9d, 0x17, 0xe0, 0xbd, 0x9f, 0xe0, 0xf0, 0x0f, 0xa4, 0xfd, 0x18, 0x79, + 0x92, 0xe1, 0xa4, 0xfe, 0x18, 0x79, 0x9a, 0xe1, 0x18, 0x90, 0x08, 0xbd, 0xa2, 0xe0, 0xf0, 0x0b, + 0xbd, 0xa5, 0xe0, 0x8d, 0x24, 0xe0, 0xa9, 0x00, 0x8d, 0x23, 0xe0, 0xbd, 0x3c, 0xe0, 0x9d, 0x3f, + 0xe0, 0xbd, 0x05, 0xe0, 0x29, 0x40, 0x9d, 0x36, 0xe0, 0xbd, 0x05, 0xe0, 0x4a, 0x4a, 0x29, 0x07, + 0xd0, 0x30, 0xbd, 0x05, 0xe0, 0x30, 0x14, 0xad, 0x27, 0xe0, 0x29, 0x3c, 0xd0, 0x1e, 0xad, 0x27, + 0xe0, 0x0a, 0x2a, 0x2a, 0xd0, 0x02, 0xa9, 0x04, 0x4c, 0x70, 0xe8, 0xad, 0x28, 0xe0, 0xf0, 0x0c, + 0x29, 0x3f, 0xd0, 0x08, 0xad, 0x28, 0xe0, 0x0a, 0x2a, 0x2a, 0xd0, 0x66, 0xa9, 0x10, 0x8d, 0x00, + 0xe0, 0x60, 0xc9, 0x01, 0xd0, 0x13, 0xbd, 0x05, 0xe0, 0x29, 0x20, 0xd0, 0x06, 0xad, 0x29, 0xe0, + 0x4c, 0x70, 0xe8, 0xbd, 0x2a, 0xe0, 0x4c, 0x70, 0xe8, 0xa8, 0xbd, 0x05, 0xe0, 0x29, 0xa0, 0xc9, + 0x80, 0xf0, 0x30, 0x85, 0xff, 0x18, 0xad, 0x27, 0xe0, 0xd0, 0x01, 0x38, 0x88, 0x88, 0xf0, 0x06, + 0x6a, 0xb0, 0x4e, 0x88, 0xd0, 0xfa, 0xa4, 0xff, 0x85, 0xff, 0xf0, 0x26, 0x46, 0xff, 0xb0, 0x41, + 0xf0, 0x42, 0x65, 0xff, 0xb0, 0x3e, 0xc8, 0x10, 0x19, 0x46, 0xff, 0xb0, 0x34, 0x65, 0xff, 0x90, + 0x11, 0xb0, 0x31, 0xad, 0x28, 0xe0, 0xf0, 0x29, 0x88, 0x88, 0xf0, 0x06, 0x4a, 0xb0, 0x22, 0x88, + 0xd0, 0xfa, 0x9d, 0x30, 0xe0, 0xbd, 0x1a, 0xe0, 0x29, 0xf6, 0x9d, 0x1a, 0xe0, 0x38, 0xbd, 0x02, + 0xe0, 0x29, 0x07, 0xd0, 0x03, 0x7e, 0x36, 0xe0, 0xbd, 0x1a, 0xe0, 0x69, 0x00, 0x9d, 0x1a, 0xe0, + 0x60, 0xa9, 0x10, 0x2c, 0xa9, 0x18, 0x8d, 0x00, 0xe0, 0x60, 0x98, 0x48, 0xa5, 0xff, 0x4a, 0x90, + 0x03, 0x4c, 0x42, 0xea, 0x4a, 0x4a, 0xb0, 0x1e, 0x4a, 0xb0, 0x0e, 0x9d, 0x9c, 0xe0, 0x9d, 0x17, + 0xe0, 0x68, 0x9d, 0x99, 0xe0, 0x9d, 0x14, 0xe0, 0x60, 0x4a, 0x90, 0x02, 0x09, 0xf8, 0x9d, 0x8a, + 0xe0, 0x68, 0x9d, 0x87, 0xe0, 0x60, 0x4a, 0xb0, 0x03, 0x4c, 0x4a, 0xe9, 0x4a, 0xb0, 0x61, 0x4a, + 0xb0, 0x0f, 0xd0, 0x08, 0x68, 0x9d, 0xa5, 0xe0, 0x8d, 0x24, 0xe0, 0x60, 0x68, 0x9d, 0x3c, 0xe0, + 0x60, 0xd0, 0x48, 0x68, 0x9d, 0x7e, 0xe0, 0xc9, 0x5b, 0xf0, 0x33, 0xa8, 0x4a, 0x4a, 0x4a, 0x38, + 0xe9, 0x0b, 0x18, 0x7d, 0x84, 0xe0, 0x30, 0x0c, 0xc9, 0x0c, 0x90, 0x11, 0xe9, 0x0c, 0xde, 0x81, + 0xe0, 0x4c, 0x0b, 0xe9, 0xc9, 0xf5, 0xb0, 0x05, 0x69, 0x0c, 0xfe, 0x81, 0xe0, 0x9d, 0x84, 0xe0, + 0x98, 0x29, 0x07, 0x38, 0xe9, 0x03, 0x18, 0x7d, 0x81, 0xe0, 0x9d, 0x81, 0xe0, 0x60, 0xbd, 0x78, + 0xe0, 0x9d, 0x81, 0xe0, 0xbd, 0x7b, 0xe0, 0x9d, 0x84, 0xe0, 0x60, 0x68, 0x9d, 0xc6, 0xe0, 0x60, + 0x4a, 0xb0, 0x08, 0x9d, 0x0b, 0xe0, 0x68, 0x9d, 0x08, 0xe0, 0x60, 0x4a, 0x6a, 0x6a, 0x6d, 0x5b, + 0xe1, 0x8d, 0x2d, 0xe0, 0x68, 0x6d, 0x5c, 0xe1, 0x8d, 0x2e, 0xe0, 0x60, 0x4a, 0x90, 0x03, 0x4c, + 0xd3, 0xe9, 0x4a, 0xb0, 0x40, 0x4a, 0xb0, 0x17, 0x4a, 0xb0, 0x0f, 0x68, 0x8d, 0x27, 0xe0, 0x4a, + 0x4a, 0x4a, 0xa8, 0xb9, 0xaf, 0xe1, 0x8d, 0x28, 0xe0, 0x60, 0x68, 0x9d, 0x5d, 0xe0, 0x60, 0x4a, + 0xb0, 0x05, 0x68, 0x8d, 0x01, 0xe0, 0x60, 0x68, 0xf0, 0x11, 0x9d, 0x75, 0xe0, 0xbc, 0x63, 0xe0, + 0xd0, 0x08, 0x9d, 0x63, 0xe0, 0xa9, 0x01, 0x9d, 0x66, 0xe0, 0x60, 0x9d, 0x63, 0xe0, 0x9d, 0x69, + 0xe0, 0x9d, 0x6c, 0xe0, 0x60, 0x4a, 0xb0, 0x30, 0x4a, 0xb0, 0x05, 0x68, 0x9d, 0x39, 0xe0, 0x60, + 0x68, 0xa0, 0x00, 0x4a, 0x90, 0x02, 0xc8, 0x18, 0x48, 0x29, 0x07, 0x79, 0xac, 0xe1, 0x9d, 0x78, + 0xe0, 0x9d, 0x81, 0xe0, 0x68, 0x4a, 0x4a, 0x4a, 0x18, 0x79, 0xad, 0xe1, 0x9d, 0x7b, 0xe0, 0x9d, + 0x84, 0xe0, 0xa9, 0x5b, 0x9d, 0x7e, 0xe0, 0x60, 0x4a, 0xb0, 0x05, 0x68, 0x9d, 0xa2, 0xe0, 0x60, + 0x68, 0x8d, 0xcc, 0xe0, 0x60, 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x0d, 0x4a, 0xb0, 0x05, 0x68, 0x8d, + 0x29, 0xe0, 0x60, 0x68, 0x9d, 0x9f, 0xe0, 0x60, 0x4a, 0xb0, 0x0f, 0x68, 0x9d, 0x93, 0xe0, 0xa0, + 0x00, 0x0a, 0x90, 0x01, 0x88, 0x98, 0x9d, 0x96, 0xe0, 0x60, 0x68, 0x9d, 0x72, 0xe0, 0x60, 0x4a, + 0xb0, 0x1c, 0x4a, 0xb0, 0x15, 0x68, 0x9d, 0xb7, 0xe0, 0xa5, 0xfd, 0x9d, 0xb1, 0xe0, 0xa5, 0xfe, + 0x9d, 0xb4, 0xe0, 0xbd, 0x33, 0xe0, 0x9d, 0xae, 0xe0, 0x60, 0x68, 0x6c, 0x5f, 0xe1, 0x4a, 0xb0, + 0x1e, 0x68, 0xd0, 0x0a, 0x9d, 0x4b, 0xe0, 0x9d, 0x51, 0xe0, 0x9d, 0x54, 0xe0, 0x60, 0x9d, 0x5a, + 0xe0, 0xbc, 0x4b, 0xe0, 0xd0, 0x08, 0x9d, 0x4b, 0xe0, 0xa9, 0x01, 0x9d, 0x4e, 0xe0, 0x60, 0x68, + 0x9d, 0x2a, 0xe0, 0x60, 0x4a, 0x90, 0x08, 0x9d, 0x48, 0xe0, 0x68, 0x9d, 0x45, 0xe0, 0x60, 0x68, + 0x4a, 0xb0, 0x61, 0x4a, 0xb0, 0x25, 0x4a, 0xb0, 0x05, 0x4a, 0xa0, 0xf0, 0xd0, 0x06, 0x0a, 0x0a, + 0x0a, 0x0a, 0xa0, 0x0f, 0x85, 0xff, 0x98, 0xb0, 0x09, 0x3d, 0x1d, 0xe0, 0x05, 0xff, 0x9d, 0x1d, + 0xe0, 0x60, 0x3d, 0x20, 0xe0, 0x05, 0xff, 0x9d, 0x20, 0xe0, 0x60, 0x4a, 0xb0, 0x38, 0x4a, 0xb0, + 0x64, 0x85, 0xff, 0xbd, 0xba, 0xe0, 0xdd, 0xa9, 0xe1, 0xf0, 0x54, 0xfe, 0xba, 0xe0, 0xa8, 0xa5, + 0xfd, 0x99, 0xe1, 0xe0, 0xa5, 0xfe, 0x99, 0xf0, 0xe0, 0xbd, 0x33, 0xe0, 0x99, 0x2f, 0xe1, 0xa4, + 0xff, 0xb9, 0x17, 0xe1, 0xf0, 0x36, 0x85, 0xfe, 0xb9, 0xff, 0xe0, 0x85, 0xfd, 0xb9, 0x3e, 0xe1, + 0x9d, 0x33, 0xe0, 0x60, 0xb0, 0x4b, 0x4a, 0xb0, 0x3c, 0xa8, 0xa5, 0xfd, 0x99, 0xff, 0xe0, 0xa5, + 0xfe, 0x99, 0x17, 0xe1, 0xbd, 0x33, 0xe0, 0x99, 0x3e, 0xe1, 0xbd, 0xba, 0xe0, 0xdd, 0xa9, 0xe1, + 0xf0, 0x0d, 0xfe, 0xba, 0xe0, 0xa8, 0xa9, 0x00, 0x99, 0xf0, 0xe0, 0x60, 0xa9, 0x30, 0x2c, 0xa9, + 0x28, 0x8d, 0x00, 0xe0, 0x60, 0x0a, 0x0a, 0x0a, 0x0a, 0x4d, 0x25, 0xe0, 0x29, 0xf0, 0x4d, 0x25, + 0xe0, 0x8d, 0x25, 0xe0, 0x60, 0x4d, 0x26, 0xe0, 0x29, 0x0f, 0x4d, 0x26, 0xe0, 0x8d, 0x26, 0xe0, + 0x60, 0x4a, 0xb0, 0x0b, 0x4a, 0xb0, 0x04, 0x8d, 0xca, 0xe0, 0x60, 0x8d, 0xcb, 0xe0, 0x60, 0x4a, + 0x90, 0x03, 0x4c, 0xa5, 0xeb, 0x4a, 0xa8, 0xf0, 0x21, 0x88, 0xf0, 0x34, 0x88, 0xf0, 0x42, 0x88, + 0xf0, 0x4a, 0x88, 0xf0, 0x52, 0x88, 0xf0, 0x5c, 0x88, 0xf0, 0x66, 0x88, 0xf0, 0x73, 0x29, 0x07, + 0x09, 0x10, 0xb0, 0x03, 0x4c, 0xb7, 0xea, 0x4c, 0x7f, 0xea, 0xac, 0x26, 0xe0, 0xb0, 0x07, 0xc8, + 0x98, 0x29, 0x0f, 0xd0, 0x07, 0x60, 0x98, 0x29, 0x0f, 0xf0, 0x04, 0x88, 0x8c, 0x26, 0xe0, 0x60, + 0xbd, 0x62, 0xe1, 0x49, 0xff, 0x2d, 0x25, 0xe0, 0x90, 0x03, 0x1d, 0x62, 0xe1, 0x8d, 0x25, 0xe0, + 0x60, 0xbd, 0x1a, 0xe0, 0x29, 0xfb, 0x90, 0x55, 0x09, 0x04, 0xb0, 0x51, 0xbd, 0x1a, 0xe0, 0x29, + 0xfd, 0x90, 0x4a, 0x09, 0x02, 0xb0, 0x46, 0xad, 0x25, 0xe0, 0x29, 0xf7, 0x90, 0x02, 0x09, 0x08, + 0x8d, 0x25, 0xe0, 0x60, 0xad, 0x26, 0xe0, 0x29, 0x7f, 0x90, 0x02, 0x09, 0x80, 0x8d, 0x26, 0xe0, + 0x60, 0x98, 0x8d, 0xbd, 0xe0, 0x8d, 0xdf, 0xe0, 0xc8, 0x8c, 0xe0, 0xe0, 0x2a, 0x8d, 0xc9, 0xe0, + 0x60, 0x98, 0x2a, 0x9d, 0x60, 0xe0, 0x60, 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x14, 0xd0, 0x02, 0xa9, + 0x08, 0x0a, 0x0a, 0x0a, 0x0a, 0x5d, 0x1a, 0xe0, 0x29, 0xf0, 0x5d, 0x1a, 0xe0, 0x9d, 0x1a, 0xe0, + 0x60, 0x0a, 0x0a, 0x0a, 0x0a, 0x4d, 0x26, 0xe0, 0x29, 0x70, 0x4d, 0x26, 0xe0, 0x8d, 0x26, 0xe0, + 0x60, 0x4a, 0x90, 0x04, 0x9d, 0xc0, 0xe0, 0x60, 0xa8, 0xf0, 0x20, 0x88, 0xf0, 0x40, 0x88, 0xf0, + 0x63, 0x29, 0x03, 0x9d, 0xc3, 0xe0, 0xa9, 0x00, 0x9d, 0xcd, 0xe0, 0x9d, 0xd0, 0xe0, 0x9d, 0xd3, + 0xe0, 0x9d, 0xd6, 0xe0, 0x8d, 0xd9, 0xe0, 0x8d, 0xdc, 0xe0, 0x60, 0xbd, 0xb7, 0xe0, 0xf0, 0x05, + 0xde, 0xb7, 0xe0, 0xf0, 0x12, 0xbd, 0x33, 0xe0, 0xdd, 0xae, 0xe0, 0xd0, 0x0b, 0xbd, 0xb1, 0xe0, + 0x85, 0xfd, 0xbd, 0xb4, 0xe0, 0x85, 0xfe, 0x60, 0xa9, 0x38, 0x8d, 0x00, 0xe0, 0x60, 0xbd, 0xba, + 0xe0, 0xdd, 0xa8, 0xe1, 0xf0, 0x18, 0xde, 0xba, 0xe0, 0xa8, 0x88, 0xb9, 0xf0, 0xe0, 0xf0, 0x0d, + 0x85, 0xfe, 0xb9, 0xe1, 0xe0, 0x85, 0xfd, 0xb9, 0x2f, 0xe1, 0x9d, 0x33, 0xe0, 0x60, 0xa9, 0x20, + 0x8d, 0x00, 0xe0, 0x60, 0xad, 0x00, 0xe0, 0x5d, 0x62, 0xe1, 0x8d, 0x00, 0xe0, 0xa9, 0x01, 0x9d, + 0x30, 0xe0, 0x60, 0xad, 0x00, 0xe0, 0x29, 0x07, 0x8d, 0x81, 0xec, 0xd0, 0x03, 0x20, 0xe9, 0xe2, + 0x60, 0x00, 0xa2, 0x51, 0xa0, 0xec, 0x8e, 0x5d, 0xe1, 0x8c, 0x5e, 0xe1, 0x20, 0xcf, 0xe1, 0xa2, + 0x00, 0xa0, 0x09, 0x20, 0x00, 0xe2, 0xa9, 0x07, 0x8d, 0x00, 0xe0, 0x8d, 0x81, 0xec, 0x60, 0x00, + 0x00, 0x00, 0xa9, 0x00, 0x29, 0xff, 0xf0, 0xf6, 0x4c, 0x29, 0xe3, 0xa9, 0x07, 0x8d, 0x00, 0xe0, + 0x60 +}; + +static const uint8_t _sidtune_sidplayer2[] = +{ + 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x61, 0xf1, 0x60, 0x01, 0x02, 0x04, 0x00, 0x07, 0x0e, 0x02, 0x02, 0xfe, 0x02, 0x02, 0xfe, + 0xfe, 0x00, 0x01, 0x00, 0xff, 0x00, 0x02, 0x04, 0x05, 0x07, 0x09, 0x0b, 0x1e, 0x18, 0x8b, 0x7e, + 0xfa, 0x06, 0xac, 0xf3, 0xe6, 0x8f, 0xf8, 0x2e, 0x86, 0x8e, 0x96, 0x9f, 0xa8, 0xb3, 0xbd, 0xc8, + 0xd4, 0xe1, 0xee, 0xfd, 0x8c, 0x78, 0x64, 0x50, 0x3c, 0x28, 0x14, 0x00, 0x00, 0x02, 0x03, 0x05, + 0x07, 0x08, 0x0a, 0x0c, 0x0d, 0x0f, 0x11, 0x12, 0x00, 0xe0, 0x00, 0x05, 0x0a, 0x0f, 0xf9, 0x00, + 0xf5, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x50, 0x00, 0x00, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0x80, 0x00, 0x00, 0x90, 0x00, 0x00, 0xa0, + 0x00, 0xa9, 0x00, 0x8d, 0x00, 0xf0, 0xa2, 0x95, 0xa0, 0x42, 0xad, 0xa6, 0x02, 0xf0, 0x04, 0xa2, + 0x25, 0xa0, 0x40, 0x8e, 0x5b, 0xf1, 0x8c, 0x5c, 0xf1, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, + 0xea, 0x60, 0xa9, 0x00, 0x8d, 0x00, 0xf0, 0x86, 0x61, 0x84, 0x62, 0xa0, 0xbc, 0x99, 0x00, 0xf0, + 0x88, 0xd0, 0xfa, 0xa0, 0x72, 0x99, 0xbc, 0xf0, 0x88, 0xd0, 0xfa, 0x8d, 0x15, 0xd5, 0x8d, 0x16, + 0xd5, 0xa9, 0x08, 0x8d, 0x25, 0xf0, 0x8d, 0x17, 0xd5, 0x8d, 0x26, 0xf0, 0x8d, 0x18, 0xd5, 0xa9, + 0x90, 0x8d, 0x27, 0xf0, 0xa9, 0x60, 0x8d, 0x28, 0xf0, 0xa9, 0x0c, 0x8d, 0x29, 0xf0, 0xad, 0x5b, + 0xf1, 0x8d, 0x2d, 0xf0, 0xad, 0x5c, 0xf1, 0x8d, 0x2e, 0xf0, 0xa9, 0xff, 0x8d, 0xcc, 0xf0, 0xa9, + 0xd5, 0x85, 0x64, 0xa2, 0x02, 0xa9, 0xff, 0x9d, 0x0b, 0xf0, 0xa9, 0x01, 0x9d, 0x30, 0xf0, 0x9d, + 0x2a, 0xf0, 0x8a, 0x9d, 0x33, 0xf0, 0x9d, 0xae, 0xf0, 0xa9, 0x04, 0x9d, 0x39, 0xf0, 0xbd, 0xa8, + 0xf1, 0x9d, 0xba, 0xf0, 0xa9, 0x5b, 0x9d, 0x7e, 0xf0, 0xbd, 0x65, 0xf1, 0x85, 0x63, 0xa9, 0x00, + 0xa8, 0x91, 0x63, 0xc8, 0x91, 0x63, 0xc8, 0x91, 0x63, 0xa9, 0x08, 0x9d, 0x17, 0xf0, 0x9d, 0x9c, + 0xf0, 0xc8, 0x91, 0x63, 0xc8, 0x91, 0x63, 0xa9, 0x40, 0x9d, 0x1a, 0xf0, 0x91, 0x63, 0xa9, 0x20, + 0x9d, 0x1d, 0xf0, 0xc8, 0x91, 0x63, 0xa9, 0xf5, 0x9d, 0x20, 0xf0, 0xc8, 0x91, 0x63, 0xca, 0x10, + 0xa4, 0x8a, 0xa2, 0x17, 0x9d, 0x3e, 0xf1, 0xca, 0x10, 0xfa, 0xa5, 0x61, 0x18, 0x69, 0x06, 0x85, + 0x63, 0xa9, 0x00, 0xaa, 0xa8, 0x65, 0x62, 0x85, 0x64, 0x9d, 0xab, 0xf0, 0x9d, 0xb4, 0xf0, 0xa5, + 0x63, 0x9d, 0xa8, 0xf0, 0x9d, 0xb1, 0xf0, 0x18, 0x71, 0x61, 0x85, 0x63, 0xa5, 0x64, 0xc8, 0x71, + 0x61, 0xc8, 0xe8, 0xe0, 0x03, 0xd0, 0xe0, 0xa6, 0x63, 0xa8, 0x60, 0xa9, 0x00, 0x8d, 0x04, 0xd5, + 0x8d, 0x0b, 0xd5, 0x8d, 0x12, 0xd5, 0x8d, 0x01, 0xd5, 0x8d, 0x08, 0xd5, 0x8d, 0x0f, 0xd5, 0xa9, + 0x08, 0x8d, 0x17, 0xd5, 0xad, 0x5b, 0xf1, 0x8d, 0x04, 0xdc, 0xad, 0x5c, 0xf1, 0x8d, 0x05, 0xdc, + 0x60, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0xea, 0x60, + 0xa9, 0x08, 0x8d, 0x00, 0xf0, 0x6c, 0x5d, 0xf1, 0xea, 0xea, 0xea, 0xad, 0x00, 0xf0, 0x30, 0xf0, + 0x09, 0x80, 0xa8, 0x29, 0x07, 0xf0, 0xee, 0xd8, 0x8c, 0x00, 0xf0, 0xea, 0xa5, 0xfb, 0x8d, 0x56, + 0xf1, 0xa5, 0xfc, 0x8d, 0x57, 0xf1, 0xa5, 0xfd, 0x8d, 0x58, 0xf1, 0xa5, 0xfe, 0x8d, 0x59, 0xf1, + 0xa5, 0xff, 0x8d, 0x5a, 0xf1, 0xad, 0x23, 0xf0, 0x18, 0x6d, 0xd9, 0xf0, 0x48, 0x29, 0x07, 0xa8, + 0xad, 0xdc, 0xf0, 0x69, 0x00, 0x85, 0xff, 0x68, 0x46, 0xff, 0x6a, 0x46, 0xff, 0x6a, 0x46, 0xff, + 0x6a, 0x18, 0x6d, 0x24, 0xf0, 0x8c, 0x15, 0xd5, 0x8d, 0x16, 0xd5, 0xad, 0x25, 0xf0, 0x8d, 0x17, + 0xd5, 0xad, 0x26, 0xf0, 0x8d, 0x18, 0xd5, 0xa9, 0xd5, 0x85, 0xfc, 0xa2, 0x00, 0xad, 0x00, 0xf0, + 0x3d, 0x62, 0xf1, 0xf0, 0x51, 0xbd, 0x65, 0xf1, 0x85, 0xfb, 0xbd, 0x0e, 0xf0, 0x18, 0x7d, 0x51, + 0xf0, 0xa8, 0xbd, 0x11, 0xf0, 0x7d, 0x54, 0xf0, 0x48, 0x98, 0x18, 0x7d, 0xcd, 0xf0, 0xa0, 0x00, + 0x91, 0xfb, 0x68, 0x7d, 0xd0, 0xf0, 0xc8, 0x91, 0xfb, 0xbd, 0x14, 0xf0, 0x18, 0x7d, 0x69, 0xf0, + 0x85, 0xff, 0xbd, 0x17, 0xf0, 0x7d, 0x6c, 0xf0, 0x48, 0xa5, 0xff, 0x18, 0x7d, 0xd3, 0xf0, 0xc8, + 0x91, 0xfb, 0x68, 0x7d, 0xd6, 0xf0, 0xc8, 0x91, 0xfb, 0xbd, 0x1d, 0xf0, 0xc8, 0xc8, 0x91, 0xfb, + 0xbd, 0x20, 0xf0, 0xc8, 0x91, 0xfb, 0xe8, 0xe0, 0x03, 0xd0, 0xa2, 0xac, 0x1a, 0xf0, 0xae, 0x1b, + 0xf0, 0xad, 0x1c, 0xf0, 0x8c, 0x04, 0xd5, 0x8e, 0x0b, 0xd5, 0x8d, 0x12, 0xd5, 0xae, 0x2d, 0xf0, + 0xac, 0x2e, 0xf0, 0x8e, 0x04, 0xdc, 0x8c, 0x05, 0xdc, 0xad, 0x1b, 0xd5, 0x8d, 0xbe, 0xf0, 0xad, + 0x1c, 0xd5, 0x8d, 0xbf, 0xf0, 0xa2, 0x00, 0xad, 0x00, 0xf0, 0x3d, 0x62, 0xf1, 0xf0, 0x10, 0x8e, + 0x2f, 0xf0, 0x20, 0x36, 0xf5, 0xad, 0x00, 0xf0, 0x29, 0x78, 0xf0, 0x03, 0x4c, 0x0c, 0xf5, 0xe8, + 0xe0, 0x03, 0xd0, 0xe3, 0xad, 0xc9, 0xf0, 0xd0, 0x52, 0xad, 0xca, 0xf0, 0x0d, 0xcb, 0xf0, 0xf0, + 0x78, 0xad, 0xdf, 0xf0, 0xd0, 0x28, 0xad, 0xca, 0xf0, 0xf0, 0x28, 0x18, 0x6d, 0xbd, 0xf0, 0xb0, + 0x07, 0xcd, 0xcc, 0xf0, 0x90, 0x60, 0xf0, 0x5e, 0xa9, 0x00, 0x8d, 0xdf, 0xf0, 0xad, 0xcb, 0xf0, + 0xf0, 0x54, 0xee, 0xdf, 0xf0, 0xad, 0xbd, 0xf0, 0xed, 0xcb, 0xf0, 0x4c, 0xb4, 0xf4, 0xad, 0xcb, + 0xf0, 0xf0, 0xd3, 0xad, 0xbd, 0xf0, 0x38, 0xed, 0xcb, 0xf0, 0xb0, 0x3a, 0xa9, 0x00, 0x8d, 0xdf, + 0xf0, 0xad, 0xca, 0xf0, 0xd0, 0x30, 0xee, 0xdf, 0xf0, 0xd0, 0x28, 0xce, 0xe0, 0xf0, 0xd0, 0x29, + 0xad, 0xdf, 0xf0, 0xd0, 0x11, 0xee, 0xdf, 0xf0, 0xad, 0xcb, 0xf0, 0xd0, 0x02, 0xa9, 0x20, 0x8d, + 0xe0, 0xf0, 0xa9, 0x00, 0xf0, 0x10, 0xce, 0xdf, 0xf0, 0xad, 0xca, 0xf0, 0xd0, 0x02, 0xa9, 0x20, + 0x8d, 0xe0, 0xf0, 0xad, 0xcc, 0xf0, 0x8d, 0xbd, 0xf0, 0xa2, 0x00, 0xbd, 0xc3, 0xf0, 0xf0, 0x44, + 0xa9, 0x00, 0x85, 0xff, 0xbc, 0xc0, 0xf0, 0xb9, 0xbd, 0xf0, 0xbc, 0xc6, 0xf0, 0xf0, 0x0e, 0x30, + 0x08, 0x0a, 0x26, 0xff, 0x88, 0xd0, 0xfa, 0xf0, 0x04, 0x4a, 0xc8, 0xd0, 0xfc, 0xbc, 0xc3, 0xf0, + 0x88, 0xd0, 0x0b, 0x9d, 0xcd, 0xf0, 0xa5, 0xff, 0x9d, 0xd0, 0xf0, 0x4c, 0x02, 0xf5, 0x88, 0xd0, + 0x0b, 0x9d, 0xd3, 0xf0, 0xa5, 0xff, 0x9d, 0xd6, 0xf0, 0x4c, 0x02, 0xf5, 0x8d, 0xd9, 0xf0, 0xa5, + 0xff, 0x8d, 0xdc, 0xf0, 0xe8, 0xe0, 0x03, 0xd0, 0xb2, 0xad, 0x00, 0xf0, 0x29, 0x7f, 0x8d, 0x00, + 0xf0, 0xad, 0x56, 0xf1, 0x85, 0xfb, 0xad, 0x57, 0xf1, 0x85, 0xfc, 0xad, 0x58, 0xf1, 0x85, 0xfd, + 0xad, 0x59, 0xf1, 0x85, 0xfe, 0xad, 0x5a, 0xf1, 0x85, 0xff, 0x6c, 0x5d, 0xf1, 0xbd, 0x60, 0xf0, + 0xd0, 0x03, 0x4c, 0x9f, 0xf6, 0x4c, 0xba, 0xf5, 0xde, 0x30, 0xf0, 0xd0, 0x03, 0x4c, 0xa0, 0xf6, + 0xbd, 0x36, 0xf0, 0x30, 0xe8, 0xd0, 0x1a, 0xbd, 0x3f, 0xf0, 0xf0, 0x05, 0xde, 0x3f, 0xf0, 0xd0, + 0x10, 0xbd, 0x39, 0xf0, 0xdd, 0x30, 0xf0, 0x90, 0x08, 0xbd, 0x1a, 0xf0, 0x29, 0xfe, 0x9d, 0x1a, + 0xf0, 0xbd, 0x42, 0xf0, 0xf0, 0x56, 0x0a, 0xbd, 0x0e, 0xf0, 0xb0, 0x1d, 0x7d, 0x45, 0xf0, 0x9d, + 0x0e, 0xf0, 0xa8, 0xbd, 0x11, 0xf0, 0x7d, 0x48, 0xf0, 0x9d, 0x11, 0xf0, 0x48, 0x98, 0xdd, 0x8d, + 0xf0, 0x68, 0xfd, 0x90, 0xf0, 0xb0, 0x1f, 0x90, 0x2e, 0xfd, 0x45, 0xf0, 0x9d, 0x0e, 0xf0, 0xbd, + 0x11, 0xf0, 0xfd, 0x48, 0xf0, 0x9d, 0x11, 0xf0, 0xbd, 0x8d, 0xf0, 0xdd, 0x0e, 0xf0, 0xbd, 0x90, + 0xf0, 0xfd, 0x11, 0xf0, 0x90, 0x11, 0xbd, 0x8d, 0xf0, 0x9d, 0x0e, 0xf0, 0xbd, 0x90, 0xf0, 0x9d, + 0x11, 0xf0, 0xa9, 0x00, 0x9d, 0x42, 0xf0, 0xbd, 0x60, 0xf0, 0xf0, 0x55, 0xbd, 0x4b, 0xf0, 0xf0, + 0x4b, 0xa0, 0x00, 0xde, 0x4e, 0xf0, 0xd0, 0x31, 0xbd, 0x51, 0xf0, 0x1d, 0x54, 0xf0, 0xd0, 0x1b, + 0xbd, 0x5d, 0xf0, 0x9d, 0x57, 0xf0, 0x9d, 0x4e, 0xf0, 0xbd, 0x4b, 0xf0, 0x0a, 0xbd, 0x5a, 0xf0, + 0x90, 0x04, 0x49, 0xff, 0x69, 0x00, 0x9d, 0x4b, 0xf0, 0xd0, 0x10, 0xbd, 0x57, 0xf0, 0x9d, 0x4e, + 0xf0, 0x98, 0x38, 0xfd, 0x4b, 0xf0, 0x9d, 0x4b, 0xf0, 0xc9, 0x00, 0x10, 0x01, 0x88, 0x18, 0x7d, + 0x51, 0xf0, 0x9d, 0x51, 0xf0, 0x98, 0x7d, 0x54, 0xf0, 0x9d, 0x54, 0xf0, 0xbd, 0x36, 0xf0, 0x30, + 0x15, 0xbd, 0x93, 0xf0, 0xf0, 0x10, 0x18, 0x7d, 0x14, 0xf0, 0x9d, 0x14, 0xf0, 0xbd, 0x96, 0xf0, + 0x7d, 0x17, 0xf0, 0x9d, 0x17, 0xf0, 0xbd, 0x63, 0xf0, 0xf0, 0x4b, 0xa0, 0x00, 0xde, 0x66, 0xf0, + 0xd0, 0x31, 0xbd, 0x69, 0xf0, 0x1d, 0x6c, 0xf0, 0xd0, 0x1b, 0xbd, 0x72, 0xf0, 0x9d, 0x6f, 0xf0, + 0x9d, 0x66, 0xf0, 0xbd, 0x63, 0xf0, 0x0a, 0xbd, 0x75, 0xf0, 0x90, 0x04, 0x49, 0xff, 0x69, 0x00, + 0x9d, 0x63, 0xf0, 0xd0, 0x10, 0xbd, 0x6f, 0xf0, 0x9d, 0x66, 0xf0, 0x98, 0x38, 0xfd, 0x63, 0xf0, + 0x9d, 0x63, 0xf0, 0xc9, 0x00, 0x10, 0x01, 0x88, 0x18, 0x7d, 0x69, 0xf0, 0x9d, 0x69, 0xf0, 0x98, + 0x7d, 0x6c, 0xf0, 0x9d, 0x6c, 0xf0, 0xbd, 0x36, 0xf0, 0x10, 0x03, 0x4c, 0x9f, 0xf6, 0xa0, 0x00, + 0xbd, 0xa2, 0xf0, 0xf0, 0x1c, 0x10, 0x01, 0xc8, 0x18, 0x6d, 0x23, 0xf0, 0x48, 0x29, 0x07, 0x8d, + 0x23, 0xf0, 0x68, 0x6a, 0x4a, 0x4a, 0x18, 0x79, 0xa6, 0xf1, 0x18, 0x6d, 0x24, 0xf0, 0x8d, 0x24, + 0xf0, 0x60, 0xbd, 0xa8, 0xf0, 0x85, 0xfd, 0xbd, 0xab, 0xf0, 0x85, 0xfe, 0xd0, 0x04, 0x60, 0x20, + 0x98, 0xf8, 0xad, 0x00, 0xf0, 0x3d, 0x62, 0xf1, 0xf0, 0xf4, 0xa0, 0x00, 0xb1, 0xfd, 0x85, 0xff, + 0xc8, 0xb1, 0xfd, 0xa8, 0xa5, 0xfd, 0x18, 0x69, 0x02, 0x85, 0xfd, 0x9d, 0xa8, 0xf0, 0xa5, 0xfe, + 0x69, 0x00, 0x85, 0xfe, 0x9d, 0xab, 0xf0, 0xa5, 0xff, 0x29, 0x03, 0xd0, 0xd2, 0xbd, 0x8d, 0xf0, + 0x9d, 0x0e, 0xf0, 0xbd, 0x90, 0xf0, 0x9d, 0x11, 0xf0, 0xa5, 0xff, 0x9d, 0x05, 0xf0, 0x98, 0x9d, + 0x02, 0xf0, 0x29, 0x07, 0xa8, 0xb9, 0x67, 0xf1, 0x8d, 0x6f, 0xf1, 0xbd, 0x02, 0xf0, 0x29, 0x38, + 0x4a, 0x4a, 0x4a, 0x7d, 0x81, 0xf0, 0x85, 0xfd, 0xbd, 0x02, 0xf0, 0x29, 0xc0, 0x0a, 0x2a, 0x2a, + 0xa8, 0xb9, 0x6f, 0xf1, 0x85, 0xfe, 0xbd, 0x02, 0xf0, 0x29, 0x07, 0xf0, 0x62, 0xa8, 0xb9, 0x72, + 0xf1, 0x65, 0xfe, 0x18, 0x7d, 0x84, 0xf0, 0x10, 0x05, 0x18, 0x69, 0x0c, 0xe6, 0xfd, 0xc9, 0x0c, + 0x90, 0x04, 0xe9, 0x0c, 0xc6, 0xfd, 0x85, 0xfe, 0xa8, 0xb9, 0x86, 0xf1, 0x85, 0xff, 0xb9, 0x7a, + 0xf1, 0xa4, 0xfd, 0x88, 0x30, 0x06, 0x46, 0xff, 0x6a, 0x88, 0x10, 0xfa, 0x18, 0x7d, 0x87, 0xf0, + 0x9d, 0x8d, 0xf0, 0xa5, 0xff, 0x7d, 0x8a, 0xf0, 0x9d, 0x90, 0xf0, 0xbd, 0x05, 0xf0, 0xd0, 0x03, + 0x4c, 0xa0, 0xf6, 0xbd, 0x45, 0xf0, 0x1d, 0x48, 0xf0, 0xf0, 0x16, 0xbd, 0x0e, 0xf0, 0xdd, 0x8d, + 0xf0, 0xbd, 0x11, 0xf0, 0xfd, 0x90, 0xf0, 0xa9, 0xfe, 0x6a, 0x9d, 0x42, 0xf0, 0x90, 0x11, 0xf0, + 0x4a, 0x9d, 0x42, 0xf0, 0xbd, 0x8d, 0xf0, 0x9d, 0x0e, 0xf0, 0xbd, 0x90, 0xf0, 0x9d, 0x11, 0xf0, + 0xbd, 0x36, 0xf0, 0x0a, 0xd0, 0x35, 0xbd, 0x93, 0xf0, 0xf0, 0x0c, 0xbd, 0x99, 0xf0, 0x9d, 0x14, + 0xf0, 0xbd, 0x9c, 0xf0, 0x9d, 0x17, 0xf0, 0xbd, 0x9f, 0xf0, 0xf0, 0x0f, 0xa4, 0xfd, 0x18, 0x79, + 0x92, 0xf1, 0xa4, 0xfe, 0x18, 0x79, 0x9a, 0xf1, 0x18, 0x90, 0x08, 0xbd, 0xa2, 0xf0, 0xf0, 0x0b, + 0xbd, 0xa5, 0xf0, 0x8d, 0x24, 0xf0, 0xa9, 0x00, 0x8d, 0x23, 0xf0, 0xbd, 0x3c, 0xf0, 0x9d, 0x3f, + 0xf0, 0xbd, 0x05, 0xf0, 0x29, 0x40, 0x9d, 0x36, 0xf0, 0xbd, 0x05, 0xf0, 0x4a, 0x4a, 0x29, 0x07, + 0xd0, 0x30, 0xbd, 0x05, 0xf0, 0x30, 0x14, 0xad, 0x27, 0xf0, 0x29, 0x3c, 0xd0, 0x1e, 0xad, 0x27, + 0xf0, 0x0a, 0x2a, 0x2a, 0xd0, 0x02, 0xa9, 0x04, 0x4c, 0x70, 0xf8, 0xad, 0x28, 0xf0, 0xf0, 0x0c, + 0x29, 0x3f, 0xd0, 0x08, 0xad, 0x28, 0xf0, 0x0a, 0x2a, 0x2a, 0xd0, 0x66, 0xa9, 0x10, 0x8d, 0x00, + 0xf0, 0x60, 0xc9, 0x01, 0xd0, 0x13, 0xbd, 0x05, 0xf0, 0x29, 0x20, 0xd0, 0x06, 0xad, 0x29, 0xf0, + 0x4c, 0x70, 0xf8, 0xbd, 0x2a, 0xf0, 0x4c, 0x70, 0xf8, 0xa8, 0xbd, 0x05, 0xf0, 0x29, 0xa0, 0xc9, + 0x80, 0xf0, 0x30, 0x85, 0xff, 0x18, 0xad, 0x27, 0xf0, 0xd0, 0x01, 0x38, 0x88, 0x88, 0xf0, 0x06, + 0x6a, 0xb0, 0x4e, 0x88, 0xd0, 0xfa, 0xa4, 0xff, 0x85, 0xff, 0xf0, 0x26, 0x46, 0xff, 0xb0, 0x41, + 0xf0, 0x42, 0x65, 0xff, 0xb0, 0x3e, 0xc8, 0x10, 0x19, 0x46, 0xff, 0xb0, 0x34, 0x65, 0xff, 0x90, + 0x11, 0xb0, 0x31, 0xad, 0x28, 0xf0, 0xf0, 0x29, 0x88, 0x88, 0xf0, 0x06, 0x4a, 0xb0, 0x22, 0x88, + 0xd0, 0xfa, 0x9d, 0x30, 0xf0, 0xbd, 0x1a, 0xf0, 0x29, 0xf6, 0x9d, 0x1a, 0xf0, 0x38, 0xbd, 0x02, + 0xf0, 0x29, 0x07, 0xd0, 0x03, 0x7e, 0x36, 0xf0, 0xbd, 0x1a, 0xf0, 0x69, 0x00, 0x9d, 0x1a, 0xf0, + 0x60, 0xa9, 0x10, 0x2c, 0xa9, 0x18, 0x8d, 0x00, 0xf0, 0x60, 0x98, 0x48, 0xa5, 0xff, 0x4a, 0x90, + 0x03, 0x4c, 0x42, 0xfa, 0x4a, 0x4a, 0xb0, 0x1e, 0x4a, 0xb0, 0x0e, 0x9d, 0x9c, 0xf0, 0x9d, 0x17, + 0xf0, 0x68, 0x9d, 0x99, 0xf0, 0x9d, 0x14, 0xf0, 0x60, 0x4a, 0x90, 0x02, 0x09, 0xf8, 0x9d, 0x8a, + 0xf0, 0x68, 0x9d, 0x87, 0xf0, 0x60, 0x4a, 0xb0, 0x03, 0x4c, 0x4a, 0xf9, 0x4a, 0xb0, 0x61, 0x4a, + 0xb0, 0x0f, 0xd0, 0x08, 0x68, 0x9d, 0xa5, 0xf0, 0x8d, 0x24, 0xf0, 0x60, 0x68, 0x9d, 0x3c, 0xf0, + 0x60, 0xd0, 0x48, 0x68, 0x9d, 0x7e, 0xf0, 0xc9, 0x5b, 0xf0, 0x33, 0xa8, 0x4a, 0x4a, 0x4a, 0x38, + 0xe9, 0x0b, 0x18, 0x7d, 0x84, 0xf0, 0x30, 0x0c, 0xc9, 0x0c, 0x90, 0x11, 0xe9, 0x0c, 0xde, 0x81, + 0xf0, 0x4c, 0x0b, 0xf9, 0xc9, 0xf5, 0xb0, 0x05, 0x69, 0x0c, 0xfe, 0x81, 0xf0, 0x9d, 0x84, 0xf0, + 0x98, 0x29, 0x07, 0x38, 0xe9, 0x03, 0x18, 0x7d, 0x81, 0xf0, 0x9d, 0x81, 0xf0, 0x60, 0xbd, 0x78, + 0xf0, 0x9d, 0x81, 0xf0, 0xbd, 0x7b, 0xf0, 0x9d, 0x84, 0xf0, 0x60, 0x68, 0x9d, 0xc6, 0xf0, 0x60, + 0x4a, 0xb0, 0x08, 0x9d, 0x0b, 0xf0, 0x68, 0x9d, 0x08, 0xf0, 0x60, 0x4a, 0x6a, 0x6a, 0x6d, 0x5b, + 0xf1, 0x8d, 0x2d, 0xf0, 0x68, 0x6d, 0x5c, 0xf1, 0x8d, 0x2e, 0xf0, 0x60, 0x4a, 0x90, 0x03, 0x4c, + 0xd3, 0xf9, 0x4a, 0xb0, 0x40, 0x4a, 0xb0, 0x17, 0x4a, 0xb0, 0x0f, 0x68, 0x8d, 0x27, 0xf0, 0x4a, + 0x4a, 0x4a, 0xa8, 0xb9, 0xaf, 0xf1, 0x8d, 0x28, 0xf0, 0x60, 0x68, 0x9d, 0x5d, 0xf0, 0x60, 0x4a, + 0xb0, 0x05, 0x68, 0x8d, 0x01, 0xf0, 0x60, 0x68, 0xf0, 0x11, 0x9d, 0x75, 0xf0, 0xbc, 0x63, 0xf0, + 0xd0, 0x08, 0x9d, 0x63, 0xf0, 0xa9, 0x01, 0x9d, 0x66, 0xf0, 0x60, 0x9d, 0x63, 0xf0, 0x9d, 0x69, + 0xf0, 0x9d, 0x6c, 0xf0, 0x60, 0x4a, 0xb0, 0x30, 0x4a, 0xb0, 0x05, 0x68, 0x9d, 0x39, 0xf0, 0x60, + 0x68, 0xa0, 0x00, 0x4a, 0x90, 0x02, 0xc8, 0x18, 0x48, 0x29, 0x07, 0x79, 0xac, 0xf1, 0x9d, 0x78, + 0xf0, 0x9d, 0x81, 0xf0, 0x68, 0x4a, 0x4a, 0x4a, 0x18, 0x79, 0xad, 0xf1, 0x9d, 0x7b, 0xf0, 0x9d, + 0x84, 0xf0, 0xa9, 0x5b, 0x9d, 0x7e, 0xf0, 0x60, 0x4a, 0xb0, 0x05, 0x68, 0x9d, 0xa2, 0xf0, 0x60, + 0x68, 0x8d, 0xcc, 0xf0, 0x60, 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x0d, 0x4a, 0xb0, 0x05, 0x68, 0x8d, + 0x29, 0xf0, 0x60, 0x68, 0x9d, 0x9f, 0xf0, 0x60, 0x4a, 0xb0, 0x0f, 0x68, 0x9d, 0x93, 0xf0, 0xa0, + 0x00, 0x0a, 0x90, 0x01, 0x88, 0x98, 0x9d, 0x96, 0xf0, 0x60, 0x68, 0x9d, 0x72, 0xf0, 0x60, 0x4a, + 0xb0, 0x1c, 0x4a, 0xb0, 0x15, 0x68, 0x9d, 0xb7, 0xf0, 0xa5, 0xfd, 0x9d, 0xb1, 0xf0, 0xa5, 0xfe, + 0x9d, 0xb4, 0xf0, 0xbd, 0x33, 0xf0, 0x9d, 0xae, 0xf0, 0x60, 0x68, 0x6c, 0x5f, 0xf1, 0x4a, 0xb0, + 0x1e, 0x68, 0xd0, 0x0a, 0x9d, 0x4b, 0xf0, 0x9d, 0x51, 0xf0, 0x9d, 0x54, 0xf0, 0x60, 0x9d, 0x5a, + 0xf0, 0xbc, 0x4b, 0xf0, 0xd0, 0x08, 0x9d, 0x4b, 0xf0, 0xa9, 0x01, 0x9d, 0x4e, 0xf0, 0x60, 0x68, + 0x9d, 0x2a, 0xf0, 0x60, 0x4a, 0x90, 0x08, 0x9d, 0x48, 0xf0, 0x68, 0x9d, 0x45, 0xf0, 0x60, 0x68, + 0x4a, 0xb0, 0x61, 0x4a, 0xb0, 0x25, 0x4a, 0xb0, 0x05, 0x4a, 0xa0, 0xf0, 0xd0, 0x06, 0x0a, 0x0a, + 0x0a, 0x0a, 0xa0, 0x0f, 0x85, 0xff, 0x98, 0xb0, 0x09, 0x3d, 0x1d, 0xf0, 0x05, 0xff, 0x9d, 0x1d, + 0xf0, 0x60, 0x3d, 0x20, 0xf0, 0x05, 0xff, 0x9d, 0x20, 0xf0, 0x60, 0x4a, 0xb0, 0x38, 0x4a, 0xb0, + 0x64, 0x85, 0xff, 0xbd, 0xba, 0xf0, 0xdd, 0xa9, 0xf1, 0xf0, 0x54, 0xfe, 0xba, 0xf0, 0xa8, 0xa5, + 0xfd, 0x99, 0xe1, 0xf0, 0xa5, 0xfe, 0x99, 0xf0, 0xf0, 0xbd, 0x33, 0xf0, 0x99, 0x2f, 0xf1, 0xa4, + 0xff, 0xb9, 0x17, 0xf1, 0xf0, 0x36, 0x85, 0xfe, 0xb9, 0xff, 0xf0, 0x85, 0xfd, 0xb9, 0x3e, 0xf1, + 0x9d, 0x33, 0xf0, 0x60, 0xb0, 0x4b, 0x4a, 0xb0, 0x3c, 0xa8, 0xa5, 0xfd, 0x99, 0xff, 0xf0, 0xa5, + 0xfe, 0x99, 0x17, 0xf1, 0xbd, 0x33, 0xf0, 0x99, 0x3e, 0xf1, 0xbd, 0xba, 0xf0, 0xdd, 0xa9, 0xf1, + 0xf0, 0x0d, 0xfe, 0xba, 0xf0, 0xa8, 0xa9, 0x00, 0x99, 0xf0, 0xf0, 0x60, 0xa9, 0x30, 0x2c, 0xa9, + 0x28, 0x8d, 0x00, 0xf0, 0x60, 0x0a, 0x0a, 0x0a, 0x0a, 0x4d, 0x25, 0xf0, 0x29, 0xf0, 0x4d, 0x25, + 0xf0, 0x8d, 0x25, 0xf0, 0x60, 0x4d, 0x26, 0xf0, 0x29, 0x0f, 0x4d, 0x26, 0xf0, 0x8d, 0x26, 0xf0, + 0x60, 0x4a, 0xb0, 0x0b, 0x4a, 0xb0, 0x04, 0x8d, 0xca, 0xf0, 0x60, 0x8d, 0xcb, 0xf0, 0x60, 0x4a, + 0x90, 0x03, 0x4c, 0xa5, 0xfb, 0x4a, 0xa8, 0xf0, 0x21, 0x88, 0xf0, 0x34, 0x88, 0xf0, 0x42, 0x88, + 0xf0, 0x4a, 0x88, 0xf0, 0x52, 0x88, 0xf0, 0x5c, 0x88, 0xf0, 0x66, 0x88, 0xf0, 0x73, 0x29, 0x07, + 0x09, 0x10, 0xb0, 0x03, 0x4c, 0xb7, 0xfa, 0x4c, 0x7f, 0xfa, 0xac, 0x26, 0xf0, 0xb0, 0x07, 0xc8, + 0x98, 0x29, 0x0f, 0xd0, 0x07, 0x60, 0x98, 0x29, 0x0f, 0xf0, 0x04, 0x88, 0x8c, 0x26, 0xf0, 0x60, + 0xbd, 0x62, 0xf1, 0x49, 0xff, 0x2d, 0x25, 0xf0, 0x90, 0x03, 0x1d, 0x62, 0xf1, 0x8d, 0x25, 0xf0, + 0x60, 0xbd, 0x1a, 0xf0, 0x29, 0xfb, 0x90, 0x55, 0x09, 0x04, 0xb0, 0x51, 0xbd, 0x1a, 0xf0, 0x29, + 0xfd, 0x90, 0x4a, 0x09, 0x02, 0xb0, 0x46, 0xad, 0x25, 0xf0, 0x29, 0xf7, 0x90, 0x02, 0x09, 0x08, + 0x8d, 0x25, 0xf0, 0x60, 0xad, 0x26, 0xf0, 0x29, 0x7f, 0x90, 0x02, 0x09, 0x80, 0x8d, 0x26, 0xf0, + 0x60, 0x98, 0x8d, 0xbd, 0xf0, 0x8d, 0xdf, 0xf0, 0xc8, 0x8c, 0xe0, 0xf0, 0x2a, 0x8d, 0xc9, 0xf0, + 0x60, 0x98, 0x2a, 0x9d, 0x60, 0xf0, 0x60, 0x4a, 0xb0, 0x27, 0x4a, 0xb0, 0x14, 0xd0, 0x02, 0xa9, + 0x08, 0x0a, 0x0a, 0x0a, 0x0a, 0x5d, 0x1a, 0xf0, 0x29, 0xf0, 0x5d, 0x1a, 0xf0, 0x9d, 0x1a, 0xf0, + 0x60, 0x0a, 0x0a, 0x0a, 0x0a, 0x4d, 0x26, 0xf0, 0x29, 0x70, 0x4d, 0x26, 0xf0, 0x8d, 0x26, 0xf0, + 0x60, 0x4a, 0x90, 0x04, 0x9d, 0xc0, 0xf0, 0x60, 0xa8, 0xf0, 0x20, 0x88, 0xf0, 0x40, 0x88, 0xf0, + 0x63, 0x29, 0x03, 0x9d, 0xc3, 0xf0, 0xa9, 0x00, 0x9d, 0xcd, 0xf0, 0x9d, 0xd0, 0xf0, 0x9d, 0xd3, + 0xf0, 0x9d, 0xd6, 0xf0, 0x8d, 0xd9, 0xf0, 0x8d, 0xdc, 0xf0, 0x60, 0xbd, 0xb7, 0xf0, 0xf0, 0x05, + 0xde, 0xb7, 0xf0, 0xf0, 0x12, 0xbd, 0x33, 0xf0, 0xdd, 0xae, 0xf0, 0xd0, 0x0b, 0xbd, 0xb1, 0xf0, + 0x85, 0xfd, 0xbd, 0xb4, 0xf0, 0x85, 0xfe, 0x60, 0xa9, 0x38, 0x8d, 0x00, 0xf0, 0x60, 0xbd, 0xba, + 0xf0, 0xdd, 0xa8, 0xf1, 0xf0, 0x18, 0xde, 0xba, 0xf0, 0xa8, 0x88, 0xb9, 0xf0, 0xf0, 0xf0, 0x0d, + 0x85, 0xfe, 0xb9, 0xe1, 0xf0, 0x85, 0xfd, 0xb9, 0x2f, 0xf1, 0x9d, 0x33, 0xf0, 0x60, 0xa9, 0x20, + 0x8d, 0x00, 0xf0, 0x60, 0xad, 0x00, 0xf0, 0x5d, 0x62, 0xf1, 0x8d, 0x00, 0xf0, 0xa9, 0x01, 0x9d, + 0x30, 0xf0, 0x60, 0xad, 0x00, 0xf0, 0x29, 0x07, 0x8d, 0x81, 0xfc, 0xd0, 0x03, 0x20, 0xe9, 0xf2, + 0x60, 0x00, 0xa2, 0x51, 0xa0, 0xfc, 0x8e, 0x5d, 0xf1, 0x8c, 0x5e, 0xf1, 0x20, 0xcf, 0xf1, 0xa2, + 0x00, 0xa0, 0x09, 0x20, 0x00, 0xf2, 0xa9, 0x07, 0x8d, 0x00, 0xf0, 0x8d, 0x81, 0xfc, 0x60, 0x00, + 0x00, 0x00, 0xa9, 0x00, 0x29, 0xff, 0xf0, 0xf6, 0x4c, 0x29, 0xf3, 0xa9, 0x07, 0x8d, 0x00, 0xf0, + 0x60, 0x00, 0x20, 0x60, 0xec, 0x4c, 0x60, 0xfc, 0x20, 0x80, 0xec, 0x4c, 0x80, 0xfc +}; + +bool SidTune::MUS_mergeParts(Buffer_sidtt<const uint8_t>& musBuf, + Buffer_sidtt<const uint8_t>& strBuf) +{ + Buffer_sidtt<uint8_t> mergeBuf; + + uint_least32_t mergeLen = musBuf.len()+strBuf.len(); + + musDataLen = musBuf.len()-2; + + // Sanity check. I do not trust those MUS/STR files around. + uint_least32_t freeSpace = endian_16(_sidtune_sidplayer1[1],_sidtune_sidplayer1[0]) + - SIDTUNE_MUS_DATA_ADDR; + if ( (musBuf.len()+strBuf.len()-4) > freeSpace) + { + info.statusString = _sidtune_txt_sizeExceeded; + return false; + } + +#ifdef HAVE_EXCEPTIONS + if ( !mergeBuf.assign(new(std::nothrow) uint8_t[mergeLen],mergeLen) ) +#else + if ( !mergeBuf.assign(new uint8_t[mergeLen],mergeLen) ) +#endif + { + info.statusString = _sidtune_txt_notEnoughMemory; + return false; + } + + // Install MUS data #1 including load address. +#ifndef SID_HAVE_BAD_COMPILER + memcpy(mergeBuf.get(),musBuf.get(),musBuf.len()); +#else + memcpy((void*)mergeBuf.get(),musBuf.get(),musBuf.len()); +#endif + + if ( !strBuf.isEmpty() && info.sidChipBase2!=0 ) + { + // Install MUS data #2 _NOT_ including load address. +#ifndef SID_HAVE_BAD_COMPILER + memcpy(mergeBuf.get()+musBuf.len(),strBuf.get()+2,strBuf.len()-2); +#else + memcpy((void*)(mergeBuf.get()+musBuf.len()),strBuf.get()+2,strBuf.len()-2); +#endif + } + + musBuf.assign(mergeBuf.xferPtr(),mergeBuf.xferLen()); + strBuf.erase(); + + return true; +} + +void SidTune::MUS_installPlayer(uint8_t *c64buf) +{ + if (status && (c64buf != 0)) + { + // Install MUS player #1. + uint_least16_t dest = endian_16(_sidtune_sidplayer1[1], + _sidtune_sidplayer1[0]); + memcpy(c64buf+dest,_sidtune_sidplayer1+2,sizeof(_sidtune_sidplayer1)-2); + // Point player #1 to data #1. + c64buf[dest+0xc6e] = SIDTUNE_MUS_DATA_ADDR&0xFF; + c64buf[dest+0xc70] = SIDTUNE_MUS_DATA_ADDR>>8; + + if (info.sidChipBase2 != 0) + { + // Install MUS player #2. + dest = endian_16(_sidtune_sidplayer2[1], + _sidtune_sidplayer2[0]); + memcpy(c64buf+dest,_sidtune_sidplayer2+2,sizeof(_sidtune_sidplayer2)-2); + // Point player #2 to data #2. + c64buf[dest+0xc6e] = (SIDTUNE_MUS_DATA_ADDR+musDataLen)&0xFF; + c64buf[dest+0xc70] = (SIDTUNE_MUS_DATA_ADDR+musDataLen)>>8; + } + } +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/Makefile.am new file mode 100644 index 00000000..e1c06822 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/Makefile.am @@ -0,0 +1,17 @@ + +noinst_LTLIBRARIES = libsidtune.la + +libsidtune_la_SOURCES = IconInfo.cpp \ +InfoFile.cpp \ +MUS.cpp \ +PP20.cpp \ +PP20.h \ +PP20_Defs.h \ +PSID.cpp \ +SidTune.cpp \ +SidTuneCfg.h \ +SidTuneTools.cpp \ +SidTuneTools.h + +# Remove bad default includes +DEFAULT_INCLUDES= diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/Makefile.in new file mode 100644 index 00000000..bb5a7c27 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/Makefile.in @@ -0,0 +1,446 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +noinst_LTLIBRARIES = libsidtune.la + +libsidtune_la_SOURCES = IconInfo.cpp \ +InfoFile.cpp \ +MUS.cpp \ +PP20.cpp \ +PP20.h \ +PP20_Defs.h \ +PSID.cpp \ +SidTune.cpp \ +SidTuneCfg.h \ +SidTuneTools.cpp \ +SidTuneTools.h + + +# Remove bad default includes +DEFAULT_INCLUDES = +subdir = src/sidtune +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libsidtune_la_LDFLAGS = +libsidtune_la_LIBADD = +am_libsidtune_la_OBJECTS = IconInfo.lo InfoFile.lo MUS.lo PP20.lo \ + PSID.lo SidTune.lo SidTuneTools.lo +libsidtune_la_OBJECTS = $(am_libsidtune_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/unix/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/IconInfo.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/InfoFile.Plo ./$(DEPDIR)/MUS.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/PP20.Plo ./$(DEPDIR)/PSID.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/SidTune.Plo \ +@AMDEP_TRUE@ ./$(DEPDIR)/SidTuneTools.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libsidtune_la_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libsidtune_la_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/sidtune/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libsidtune.la: $(libsidtune_la_OBJECTS) $(libsidtune_la_DEPENDENCIES) + $(CXXLINK) $(libsidtune_la_LDFLAGS) $(libsidtune_la_OBJECTS) $(libsidtune_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IconInfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InfoFile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MUS.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PP20.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PSID.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SidTune.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SidTuneTools.Plo@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20.cpp new file mode 100644 index 00000000..8bec5cfe --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20.cpp @@ -0,0 +1,289 @@ +/* + * /home/ms/files/source/libsidtune/RCS/PP20.cpp,v + * + * PowerPacker (AMIGA) "PP20" format decompressor. + * Copyright (C) Michael Schwendt <mschwendt@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "PP20.h" + +#include <string.h> +#ifdef PP20_HAVE_EXCEPTIONS +#include <new> +#endif + +/* Read a big-endian 32-bit word from four bytes in memory. + No endian-specific optimizations applied. */ +inline udword_ppt readBEdword(const ubyte_ppt ptr[4]) +{ + return ( (((udword_ppt)ptr[0])<<24) + (((udword_ppt)ptr[1])<<16) + + (((udword_ppt)ptr[2])<<8) + ((udword_ppt)ptr[3]) ); +} + +const char _pp20_txt_packeddatacorrupt[] = "PowerPacker: Packed data is corrupt"; +const char _pp20_txt_unrecognized[] = "PowerPacker: Unrecognized compression method"; +const char _pp20_txt_uncompressed[] = "Not compressed with PowerPacker (PP20)"; +const char _pp20_txt_notenoughmemory[] = "Not enough free memory"; +const char _pp20_txt_fast[] = "PowerPacker: fast compression"; +const char _pp20_txt_mediocre[] = "PowerPacker: mediocre compression"; +const char _pp20_txt_good[] = "PowerPacker: good compression"; +const char _pp20_txt_verygood[] = "PowerPacker: very good compression"; +const char _pp20_txt_best[] = "PowerPacker: best compression"; +const char _pp20_txt_na[] = "N/A"; + +const char* PP20::PP_ID = "PP20"; + +PP20::PP20() +{ + statusString = _pp20_txt_uncompressed; +} + +bool PP20::isCompressed(const void* source, const udword_ppt size) +{ + // Check minimum input size, PP20 ID, and efficiency table. + if ( size<8 ) + { + return false; + } + // We hope that every file with a valid signature and a valid + // efficiency table is PP-compressed actually. + const char* idPtr = (const char*)source; + if ( strncmp(idPtr,PP_ID,4) != 0 ) + { + statusString = _pp20_txt_uncompressed; + return false; + } + return checkEfficiency(idPtr+4); +} + +bool PP20::checkEfficiency(const void* source) +{ + const udword_ppt PP_BITS_FAST = 0x09090909; + const udword_ppt PP_BITS_MEDIOCRE = 0x090a0a0a; + const udword_ppt PP_BITS_GOOD = 0x090a0b0b; + const udword_ppt PP_BITS_VERYGOOD = 0x090a0c0c; + const udword_ppt PP_BITS_BEST = 0x090a0c0d; + + // Copy efficiency table. + memcpy(efficiency,(const ubyte_ppt*)source,4); + udword_ppt eff = readBEdword(efficiency); + if (( eff != PP_BITS_FAST ) && + ( eff != PP_BITS_MEDIOCRE ) && + ( eff != PP_BITS_GOOD ) && + ( eff != PP_BITS_VERYGOOD ) && + ( eff != PP_BITS_BEST )) + { + statusString = _pp20_txt_unrecognized; + return false; + } + + // Define string describing compression encoding used. + switch ( eff) + { + case PP_BITS_FAST: + statusString = _pp20_txt_fast; + break; + case PP_BITS_MEDIOCRE: + statusString = _pp20_txt_mediocre; + break; + case PP_BITS_GOOD: + statusString = _pp20_txt_good; + break; + case PP_BITS_VERYGOOD: + statusString = _pp20_txt_verygood; + break; + case PP_BITS_BEST: + statusString = _pp20_txt_best; + break; + } + + return true; +} + +// Move four bytes to Motorola big-endian double-word. +inline void PP20::bytesTOdword() +{ + readPtr -= 4; + if ( readPtr < sourceBeg ) + { + statusString = _pp20_txt_packeddatacorrupt; + globalError = true; + } + else + { + current = readBEdword(readPtr); + } +} + +inline udword_ppt PP20::readBits(int count) +{ + udword_ppt data = 0; + // read 'count' bits of packed data + for (; count > 0; count--) + { + // equal to shift left + data += data; + // merge bit 0 + data |= (current&1); + current >>= 1; + if (--bits == 0) + { + bytesTOdword(); + bits = 32; + } + } + return data; +} + +inline void PP20::bytes() +{ + udword_ppt count, add; + count = (add = readBits(2)); + while (add == 3) + { + add = readBits(2); + count += add; + } + for ( ++count; count > 0 ; count--) + { + if (writePtr > destBeg) + { + *(--writePtr) = (ubyte_ppt)readBits(8); + } + else + { + statusString = _pp20_txt_packeddatacorrupt; + globalError = true; + } + } +} + +inline void PP20::sequence() +{ + udword_ppt offset, add; + udword_ppt length = readBits(2); // is length-2 + int offsetBitLen = (int)efficiency[length]; + length += 2; + if ( length != 5 ) + offset = readBits( offsetBitLen ); + else + { + if ( readBits(1) == 0 ) + offsetBitLen = 7; + offset = readBits( offsetBitLen ); + add = readBits(3); + length += add; + while ( add == 7 ) + { + add = readBits(3); + length += add; + } + } + for ( ; length > 0 ; length-- ) + { + if ( writePtr > destBeg ) + { + --writePtr; + *writePtr = *(writePtr+1+offset); + } + else + { + statusString = _pp20_txt_packeddatacorrupt; + globalError = true; + } + } +} + +udword_ppt PP20::decompress(const void* source, + udword_ppt size, + ubyte_ppt** destRef) +{ + globalError = false; // assume no error + + sourceBeg = (const ubyte_ppt*)source; + readPtr = sourceBeg; + + if ( !isCompressed(readPtr,size) ) + { + return 0; + } + + // Uncompressed size is stored at end of source file. + // Backwards decompression. + readPtr += (size-4); + + udword_ppt lastDword = readBEdword(readPtr); + // Uncompressed length in bits 31-8 of last dword. + udword_ppt outputLen = lastDword>>8; + + // Allocate memory for output data. + ubyte_ppt* dest; +#ifdef PP20_HAVE_EXCEPTIONS + if (( dest = new(std::nothrow) ubyte_ppt[outputLen]) == 0 ) +#else + if (( dest = new ubyte_ppt[outputLen]) == 0 ) +#endif + { + statusString = _pp20_txt_notenoughmemory; + return 0; + } + + // Lowest dest. address for range-checks. + destBeg = dest; + // Put destptr to end of uncompressed data. + writePtr = dest+outputLen; + + // Read number of unused bits in 1st data dword + // from lowest bits 7-0 of last dword. + bits = 32 - (lastDword&0xFF); + + // Main decompression loop. + bytesTOdword(); + if ( bits != 32 ) + current >>= (32-bits); + do + { + if ( readBits(1) == 0 ) + bytes(); + if ( writePtr > dest ) + sequence(); + if ( globalError ) + { + // statusString already set. + outputLen = 0; // unsuccessful decompression + break; + } + } while ( writePtr > dest ); + + // Finished. + + if (outputLen > 0) // successful + { + // Free any previously existing destination buffer. + if ( *destRef != 0 ) + { + delete[] *destRef; + } + *destRef = dest; + } + else + { + delete[] dest; + } + + return outputLen; +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20.h b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20.h new file mode 100644 index 00000000..74e7f5f7 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20.h @@ -0,0 +1,70 @@ +/* + * /home/ms/files/source/libsidtune/RCS/PP20.h,v + * + * PowerPacker (AMIGA) "PP20" format decompressor. + * Copyright (C) Michael Schwendt <mschwendt@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PP_DECOMPRESSOR_H +#define PP_DECOMPRESSOR_H + +#include "PP20_Defs.h" + +class PP20 +{ + public: + + PP20(); + + bool isCompressed(const void* source, const udword_ppt size); + + // If successful, allocates a new buffer containing the + // uncompresse data and returns the uncompressed length. + // Else, returns 0. + udword_ppt decompress(const void* source, + udword_ppt size, + ubyte_ppt** destRef); + + const char* getStatusString() { return statusString; } + + private: + bool checkEfficiency(const void* source); + + void bytesTOdword(); + udword_ppt readBits(int count); + void bytes(); + void sequence(); + + static const char* PP_ID; + + ubyte_ppt efficiency[4]; + + const ubyte_ppt* sourceBeg; + const ubyte_ppt* readPtr; + + const ubyte_ppt* destBeg; + ubyte_ppt* writePtr; + + udword_ppt current; // compressed data longword + int bits; // number of bits in 'current' to evaluate + + bool globalError; // exception-free version of code + + const char* statusString; +}; + +#endif /* PP_DECOMPRESSOR_H */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20_Defs.h b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20_Defs.h new file mode 100644 index 00000000..9e3b345b --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PP20_Defs.h @@ -0,0 +1,39 @@ +/* + * /home/ms/files/source/libsidtune/RCS/PP20_Defs.h,v + * + * PowerPacker (AMIGA) "PP20" format decompressor. + * Copyright (C) Michael Schwendt <mschwendt@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PP_DECOMPRESSOR_DEFS_H +#define PP_DECOMPRESSOR_DEFS_H + +#include "sidtypes.h" + +#ifdef HAVE_EXCEPTIONS + #define PP20_HAVE_EXCEPTIONS +#else + #undef PP20_HAVE_EXCEPTIONS +#endif + +// Wanted: 8-bit unsigned. +typedef uint_least8_t ubyte_ppt; + +// Wanted: 32-bit unsigned. +typedef uint_least32_t udword_ppt; + +#endif /* PP_DECOMPRESSOR_DEFS_H */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PSID.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PSID.cpp new file mode 100644 index 00000000..0cc96969 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/PSID.cpp @@ -0,0 +1,313 @@ +/* + * /home/ms/files/source/libsidtune/RCS/PSID.cpp,v + * + * PlaySID one-file format support. + * + * 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 + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "config.h" +#include "SidTuneCfg.h" +#include "SidTune.h" +#include "sidendian.h" + +#define PSID_ID 0x50534944 +#define RSID_ID 0x52534944 + +// Header has been extended for 'RSID' format +// The following changes are present: +// id = 'RSID' +// version = 2 only +// play, load and speed reserved 0 +// psidspecific flag reserved 0 +// init cannot be under ROMS/IO +// load cannot be less than 0x0801 (start of basic) + +struct psidHeader // all values big-endian +{ + char id[4]; // 'PSID' (ASCII) + uint8_t version[2]; // 0x0001 or 0x0002 + uint8_t data[2]; // 16-bit offset to binary data in file + uint8_t load[2]; // 16-bit C64 address to load file to + uint8_t init[2]; // 16-bit C64 address of init subroutine + uint8_t play[2]; // 16-bit C64 address of play subroutine + uint8_t songs[2]; // number of songs + uint8_t start[2]; // start song out of [1..256] + uint8_t speed[4]; // 32-bit speed info + // bit: 0=50 Hz, 1=CIA 1 Timer A (default: 60 Hz) + char name[32]; // ASCII strings, 31 characters long and + char author[32]; // terminated by a trailing zero + char released[32]; // + uint8_t flags[2]; // only version 0x0002 + uint8_t relocStartPage; // only version 0x0002B + uint8_t relocPages; // only version 0x0002B + uint8_t reserved[2]; // only version 0x0002 +}; + +enum +{ + PSID_MUS = 1 << 0, + PSID_SPECIFIC = 1 << 1, + PSID_CLOCK = 3 << 2, + PSID_SIDMODEL = 3 << 4 +}; + +enum +{ + PSID_CLOCK_UNKNOWN = 0, + PSID_CLOCK_PAL = 1 << 2, + PSID_CLOCK_NTSC = 1 << 3, + PSID_CLOCK_ANY = PSID_CLOCK_PAL | PSID_CLOCK_NTSC +}; + +enum +{ + PSID_SIDMODEL_UNKNOWN = 0, + PSID_SIDMODEL_6581 = 1 << 4, + PSID_SIDMODEL_8580 = 1 << 5, + PSID_SIDMODEL_ANY = PSID_SIDMODEL_6581 | PSID_SIDMODEL_8580 +}; + +static const char _sidtune_format_psid[] = "PlaySID one-file format (PSID)"; +static const char _sidtune_format_rsid[] = "Real C64 one-file format (RSID)"; +static const char _sidtune_unknown_psid[] = "Unsupported PSID version"; +static const char _sidtune_unknown_rsid[] = "Unsupported RSID version"; +static const char _sidtune_truncated[] = "ERROR: File is most likely truncated"; +static const char _sidtune_invalid[] = "ERROR: File contains invalid data"; + +const int _sidtune_psid_maxStrLen = 31; + + +bool SidTune::PSID_fileSupport(const void* buffer, const uint_least32_t bufLen) +{ + int clock, compatibility; + uint_least32_t speed; +#ifdef SIDTUNE_PSID2NG + clock = SIDTUNE_CLOCK_UNKNOWN; +#else + clock = info.clockSpeed; +#endif + compatibility = SIDTUNE_COMPATIBILITY_C64; + + // Require minimum size to allow access to the first few bytes. + // Require a valid ID and version number. + const psidHeader* pHeader = (const psidHeader*)buffer; + + // File format check + if (bufLen<6) + return false; + if (endian_big32((const uint_least8_t*)pHeader->id)==PSID_ID) + { + if (endian_big16(pHeader->version) >= 3) + { + info.formatString = _sidtune_unknown_psid; + return false; + } + info.formatString = _sidtune_format_psid; + } + else if (endian_big32((const uint_least8_t*)pHeader->id)==RSID_ID) + { + if (endian_big16(pHeader->version) != 2) + { + info.formatString = _sidtune_unknown_rsid; + return false; + } + info.formatString = _sidtune_format_rsid; + compatibility = SIDTUNE_COMPATIBILITY_R64; + } + else + { + return false; + } + + // Due to security concerns, input must be at least as long as version 1 + // header plus 16-bit C64 load address. That is the area which will be + // accessed. + if ( bufLen < (sizeof(psidHeader)+2) ) + { + info.formatString = _sidtune_truncated; + return false; + } + + fileOffset = endian_big16(pHeader->data); + info.loadAddr = endian_big16(pHeader->load); + info.initAddr = endian_big16(pHeader->init); + info.playAddr = endian_big16(pHeader->play); + info.songs = endian_big16(pHeader->songs); + info.startSong = endian_big16(pHeader->start); + info.sidChipBase1 = 0xd400; + info.sidChipBase2 = 0; + info.compatibility = compatibility; + speed = endian_big32(pHeader->speed); + + if (info.songs > SIDTUNE_MAX_SONGS) + { + info.songs = SIDTUNE_MAX_SONGS; + } + + info.musPlayer = false; + info.sidModel = SIDTUNE_SIDMODEL_UNKNOWN; + info.relocPages = 0; + info.relocStartPage = 0; + if ( endian_big16(pHeader->version) >= 2 ) + { + uint_least16_t flags = endian_big16(pHeader->flags); + if (flags & PSID_MUS) + { // MUS tunes run at any speed + clock = SIDTUNE_CLOCK_ANY; + info.musPlayer = true; + } + +#ifdef SIDTUNE_PSID2NG + if (flags & PSID_SPECIFIC) + info.compatibility = SIDTUNE_COMPATIBILITY_PSID; + + if (flags & PSID_CLOCK_PAL) + clock |= SIDTUNE_CLOCK_PAL; + if (flags & PSID_CLOCK_NTSC) + clock |= SIDTUNE_CLOCK_NTSC; + info.clockSpeed = clock; + + info.sidModel = SIDTUNE_SIDMODEL_UNKNOWN; + if (flags & PSID_SIDMODEL_6581) + info.sidModel |= SIDTUNE_SIDMODEL_6581; + if (flags & PSID_SIDMODEL_8580) + info.sidModel |= SIDTUNE_SIDMODEL_8580; + + info.relocStartPage = pHeader->relocStartPage; + info.relocPages = pHeader->relocPages; +#endif // SIDTUNE_PSID2NG + } + + // Reserved meaning for possible future use + if ( info.playAddr == 0xffff ) + info.playAddr = 0; + + // Check reserved fields to force real c64 compliance + if (compatibility == SIDTUNE_COMPATIBILITY_R64) + { + if (checkRealC64Info (speed) == false) + { + info.formatString = _sidtune_invalid; + return false; + } + // Real C64 tunes appear as CIA + speed = ~0; + } + // Create the speed/clock setting table. + convertOldStyleSpeedToTables(speed, clock); + + if ( info.loadAddr == 0 ) + { + uint_least8_t* pData = (uint_least8_t*)buffer + fileOffset; + info.loadAddr = endian_16( *(pData+1), *pData ); + fileOffset += 2; + } + + info.c64dataLen = bufLen - fileOffset; + if ( resolveAddrs((uint_least8_t*)buffer + fileOffset) == false ) + return false; + + if ( checkRelocInfo() == false ) + return false; + + // Copy info strings, so they will not get lost. + info.numberOfInfoStrings = 3; + // Name + strncpy(&infoString[0][0],pHeader->name,_sidtune_psid_maxStrLen); + info.infoString[0] = &infoString[0][0]; + // Author + strncpy(&infoString[1][0],pHeader->author,_sidtune_psid_maxStrLen); + info.infoString[1] = &infoString[1][0]; + // Released + strncpy(&infoString[2][0],pHeader->released,_sidtune_psid_maxStrLen); + info.infoString[2] = &infoString[2][0]; + return true; +} + + +bool SidTune::PSID_fileSupportSave(std::ofstream& fMyOut, const uint_least8_t* dataBuffer) +{ + psidHeader myHeader; + endian_big32((uint_least8_t*)myHeader.id,PSID_ID); + endian_big16(myHeader.version,2); + endian_big16(myHeader.data,sizeof(psidHeader)); + endian_big16(myHeader.load,0); + endian_big16(myHeader.init,info.initAddr); + endian_big16(myHeader.play,info.playAddr); + endian_big16(myHeader.songs,info.songs); + endian_big16(myHeader.start,info.startSong); + + uint_least32_t speed = 0, check = 0; + uint_least32_t maxBugSongs = ((info.songs <= 32) ? info.songs : 32); + for (uint_least32_t s = 0; s < maxBugSongs; s++) + { + if (songSpeed[s] == SIDTUNE_SPEED_CIA_1A) + speed |= (1<<s); + check |= (1<<s); + } + endian_big32(myHeader.speed,speed); + + uint_least16_t tmpFlags = 0; + if ( info.musPlayer ) + tmpFlags |= PSID_MUS; + + if (info.compatibility == SIDTUNE_COMPATIBILITY_PSID) + tmpFlags |= PSID_SPECIFIC; + + tmpFlags |= (info.clockSpeed << 2); + tmpFlags |= (info.sidModel << 4); + endian_big16(myHeader.flags,tmpFlags); + endian_big16(myHeader.reserved,0); + myHeader.relocStartPage = info.relocStartPage; + myHeader.relocPages = info.relocPages; + + for ( uint i = 0; i < 32; i++ ) + { + myHeader.name[i] = 0; + myHeader.author[i] = 0; + myHeader.released[i] = 0; + } + strncpy( myHeader.name, info.infoString[0], _sidtune_psid_maxStrLen); + strncpy( myHeader.author, info.infoString[1], _sidtune_psid_maxStrLen); + strncpy( myHeader.released, info.infoString[2], _sidtune_psid_maxStrLen); + + if (info.compatibility == SIDTUNE_COMPATIBILITY_R64) + { + endian_big32((uint_least8_t*)myHeader.id,RSID_ID); + endian_big16(myHeader.play,0); + endian_big32(myHeader.speed,0); + } + + fMyOut.write( (char*)&myHeader, sizeof(psidHeader) ); + + // Save C64 lo/hi load address (little-endian). + uint_least8_t saveAddr[2]; + saveAddr[0] = info.loadAddr & 255; + saveAddr[1] = info.loadAddr >> 8; + fMyOut.write( (char*)saveAddr, 2 ); // !cast! + + // Data starts at: bufferaddr + fileoffset + // Data length: datafilelen - fileoffset + fMyOut.write( (const char*)dataBuffer + fileOffset, info.dataFileLen - fileOffset ); // !cast! + if ( !fMyOut ) + return false; + else + return true; +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTune.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTune.cpp new file mode 100644 index 00000000..29638775 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTune.cpp @@ -0,0 +1,1150 @@ +/* + * /home/ms/files/source/libsidtune/RCS/SidTune.cpp,v + * + * 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 + */ + +#define _SidTune_cpp_ + +#include "config.h" +#include "SidTuneCfg.h" +#include "SidTune.h" +#include "SidTuneTools.h" +#include "sidendian.h" +#include "PP20.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif +#include <iostream> +#include <iomanip> +#include <string.h> +#include <limits.h> + +#if defined(HAVE_IOS_OPENMODE) + typedef std::ios::openmode openmode; +#else + typedef int openmode; +#endif + +// Used in address resolution procedure +#define SIDTUNE_BASIC_START 0x0801 + +const char* SidTune::txt_songNumberExceed = "SIDTUNE WARNING: Selected song number was too high"; +const char* SidTune::txt_empty = "SIDTUNE ERROR: No data to load"; +const char* SidTune::txt_unrecognizedFormat = "SIDTUNE ERROR: Could not determine file format"; +const char* SidTune::txt_noDataFile = "SIDTUNE ERROR: Did not find the corresponding data file"; +const char* SidTune::txt_notEnoughMemory = "SIDTUNE ERROR: Not enough free memory"; +const char* SidTune::txt_cantLoadFile = "SIDTUNE ERROR: Could not load input file"; +const char* SidTune::txt_cantOpenFile = "SIDTUNE ERROR: Could not open file for binary input"; +const char* SidTune::txt_fileTooLong = "SIDTUNE ERROR: Input data too long"; +const char* SidTune::txt_dataTooLong = "SIDTUNE ERROR: Size of music data exceeds C64 memory"; +const char* SidTune::txt_cantCreateFile = "SIDTUNE ERROR: Could not create output file"; +const char* SidTune::txt_fileIoError = "SIDTUNE ERROR: File I/O error"; +const char* SidTune::txt_VBI = "VBI"; +const char* SidTune::txt_CIA = "CIA 1 Timer A"; +const char* SidTune::txt_noErrors = "No errors"; +const char* SidTune::txt_na = "N/A"; +const char* SidTune::txt_badAddr = "SIDTUNE ERROR: Bad address data"; +const char* SidTune::txt_badReloc = "SIDTUNE ERROR: Bad reloc data"; + +// Default sidtune file name extensions. This selection can be overriden +// by specifying a custom list in the constructor. +const char* defaultFileNameExt[] = +{ + // Preferred default file extension for single-file sidtunes + // or sidtune description files in SIDPLAY INFOFILE format. + ".sid", + // Common file extension for single-file sidtunes due to SIDPLAY/DOS + // displaying files *.DAT in its file selector by default. + // Originally this was intended to be the extension of the raw data file + // of two-file sidtunes in SIDPLAY INFOFILE format. + ".dat", + // Extension of Amiga Workbench tooltype icon info files, which + // have been cut to MS-DOS file name length (8.3). + ".inf", + // No extension for the raw data file of two-file sidtunes in + // PlaySID Amiga Workbench tooltype icon info format. + "", + // Common upper-case file extensions from MS-DOS (unconverted). + ".DAT", ".SID", ".INF", + // File extensions used (and created) by various C64 emulators and + // related utilities. These extensions are recommended to be used as + // a replacement for ".dat" in conjunction with two-file sidtunes. + ".c64", ".prg", ".C64", ".PRG", + // Uncut extensions from Amiga. + ".info", ".INFO", ".data", ".DATA", + // Stereo Sidplayer (.mus/.MUS ought not be included because + // these must be loaded first; it sometimes contains the first + // credit lines of a MUS/STR pair). + ".str", ".STR", ".mus", ".MUS", + // End. + 0 +}; + +const char** SidTune::fileNameExtensions = defaultFileNameExt; + +inline void SidTune::setFileNameExtensions(const char **fileNameExt) +{ + fileNameExtensions = ((fileNameExt!=0)?fileNameExt:defaultFileNameExt); +} + +SidTune::SidTune(const char* fileName, const char **fileNameExt, + const bool separatorIsSlash) +{ + init(); + isSlashedFileName = separatorIsSlash; + setFileNameExtensions(fileNameExt); +#if !defined(SIDTUNE_NO_STDIN_LOADER) + // Filename ``-'' is used as a synonym for standard input. + if ( fileName!=0 && (strcmp(fileName,"-")==0) ) + { + getFromStdIn(); + } + else +#endif + if (fileName != 0) + { + getFromFiles(fileName); + } +} + +SidTune::SidTune(const uint_least8_t* data, const uint_least32_t dataLen) +{ + init(); + getFromBuffer(data,dataLen); +} + +SidTune::~SidTune() +{ + cleanup(); +} + +bool SidTune::load(const char* fileName, const bool separatorIsSlash) +{ + cleanup(); + init(); + isSlashedFileName = separatorIsSlash; + getFromFiles(fileName); + return status; +} + +bool SidTune::read(const uint_least8_t* data, uint_least32_t dataLen) +{ + cleanup(); + init(); + getFromBuffer(data,dataLen); + return status; +} + +const SidTuneInfo& SidTune::operator[](const uint_least16_t songNum) +{ + selectSong(songNum); + return info; +} + +void SidTune::getInfo(SidTuneInfo& outInfo) +{ + outInfo = info; // copy +} + +const SidTuneInfo& SidTune::getInfo() +{ + return info; +} + +// First check, whether a song is valid. Then copy any song-specific +// variable information such a speed/clock setting to the info structure. +uint_least16_t SidTune::selectSong(const uint_least16_t selectedSong) +{ + if ( !status ) + return 0; + else + info.statusString = SidTune::txt_noErrors; + + uint_least16_t song = selectedSong; + // Determine and set starting song number. + if (selectedSong == 0) + song = info.startSong; + if (selectedSong>info.songs || selectedSong>SIDTUNE_MAX_SONGS) + { + song = info.startSong; + info.statusString = SidTune::txt_songNumberExceed; + } + info.currentSong = song; + info.songLength = songLength[song-1]; + // Retrieve song speed definition. + info.songSpeed = songSpeed[song-1]; + info.clockSpeed = clockSpeed[song-1]; + // Assign song speed description string depending on clock speed. + // Final speed description is available only after song init. + if (info.songSpeed == SIDTUNE_SPEED_VBI) + info.speedString = txt_VBI; + else + info.speedString = txt_CIA; + return info.currentSong; +} + +void SidTune::fixLoadAddress(bool force, uint_least16_t init, uint_least16_t play) +{ + if (info.fixLoad || force) + { + info.fixLoad = false; + info.loadAddr += 2; + fileOffset += 2; + + if (force) + { + info.initAddr = init; + info.playAddr = play; + } + } +} + +// ------------------------------------------------- private member functions + +bool SidTune::placeSidTuneInC64mem(uint_least8_t* c64buf) +{ + if ( status && c64buf!=0 ) + { + uint_least32_t endPos = info.loadAddr + info.c64dataLen; + if (endPos <= SIDTUNE_MAX_MEMORY) + { + // Copy data from cache to the correct destination. + memcpy(c64buf+info.loadAddr,cache.get()+fileOffset,info.c64dataLen); + info.statusString = SidTune::txt_noErrors; + } + else + { + // Security - cut data which would exceed the end of the C64 + // memory. Memcpy could not detect this. + // + // NOTE: In libsidplay1 the rest gets wrapped to the beginning + // of the C64 memory. It is an undocumented hack most likely not + // used by any sidtune. Here we no longer do it like that, set + // an error message, and hope the modified behaviour will find + // a few badly ripped sids. + memcpy(c64buf+info.loadAddr,cache.get()+fileOffset,info.c64dataLen-(endPos-SIDTUNE_MAX_MEMORY)); + info.statusString = SidTune::txt_dataTooLong; + } + if (info.musPlayer) + { + MUS_installPlayer(c64buf); + } + } + return ( status && c64buf!=0 ); +} + +bool SidTune::loadFile(const char* fileName, Buffer_sidtt<const uint_least8_t>& bufferRef) +{ + Buffer_sidtt<uint_least8_t> fileBuf; + uint_least32_t fileLen = 0; + + // This sucks big time + //openmode createAtrr = std::ios::in; + std::_Ios_Openmode createAtrr = std::ios::in; +#ifdef HAVE_IOS_NOCREATE + createAtrr |= std::ios::nocreate; +#endif + // Open binary input file stream at end of file. +#if defined(HAVE_IOS_BIN) + createAtrr |= std::ios::bin; +#else + createAtrr |= std::ios::binary; +#endif + + std::fstream myIn(fileName,createAtrr); + // As a replacement for !is_open(), bad() and the NOT-operator don't seem + // to work on all systems. +#if defined(DONT_HAVE_IS_OPEN) + if ( !myIn ) +#else + if ( !myIn.is_open() ) +#endif + { + info.statusString = SidTune::txt_cantOpenFile; + return false; + } + else + { +#if defined(HAVE_SEEKG_OFFSET) + fileLen = (myIn.seekg(0,std::ios::end)).offset(); +#else + myIn.seekg(0,std::ios::end); + fileLen = (uint_least32_t)myIn.tellg(); +#endif +#ifdef HAVE_EXCEPTIONS + if ( !fileBuf.assign(new(std::nothrow) uint_least8_t[fileLen],fileLen) ) +#else + if ( !fileBuf.assign(new uint_least8_t[fileLen],fileLen) ) +#endif + { + info.statusString = SidTune::txt_notEnoughMemory; + return false; + } + myIn.seekg(0,std::ios::beg); + uint_least32_t restFileLen = fileLen; + // 16-bit compatible loading. Is this really necessary? + while ( restFileLen > INT_MAX ) + { + myIn.read((char*)fileBuf.get()+(fileLen-restFileLen),INT_MAX); // !cast! + restFileLen -= INT_MAX; + } + if ( restFileLen > 0 ) + { + myIn.read((char*)fileBuf.get()+(fileLen-restFileLen),restFileLen); // !cast! + } + if ( myIn.bad() ) + { + info.statusString = SidTune::txt_cantLoadFile; + return false; + } + else + { + info.statusString = SidTune::txt_noErrors; + } + } + myIn.close(); + if ( fileLen==0 ) + { + info.statusString = SidTune::txt_empty; + return false; + } + + // Check for PowerPacker compression: load and decompress, if PP20 file. + PP20 myPP; + if ( myPP.isCompressed(fileBuf.get(),fileBuf.len()) ) + { + uint_least8_t* destBufRef = 0; + if ( 0 == (fileLen = myPP.decompress(fileBuf.get(),fileBuf.len(), + &destBufRef)) ) + { + info.statusString = myPP.getStatusString(); + return false; + } + else + { + info.statusString = myPP.getStatusString(); + // Replace compressed buffer with uncompressed buffer. + fileBuf.assign(destBufRef,fileLen); + } + } + + bufferRef.assign(fileBuf.xferPtr(),fileBuf.xferLen()); + + return true; +} + +void SidTune::deleteFileNameCopies() +{ + // When will it be fully safe to call delete[](0) on every system? + if ( info.dataFileName != 0 ) + delete[] info.dataFileName; + if ( info.infoFileName != 0 ) + delete[] info.infoFileName; + if ( info.path != 0 ) + delete[] info.path; + info.dataFileName = 0; + info.infoFileName = 0; + info.path = 0; +} + +void SidTune::init() +{ + // Initialize the object with some safe defaults. + status = false; + + info.statusString = SidTune::txt_na; + info.path = info.infoFileName = info.dataFileName = 0; + info.dataFileLen = info.c64dataLen = 0; + info.formatString = SidTune::txt_na; + info.speedString = SidTune::txt_na; + info.loadAddr = ( info.initAddr = ( info.playAddr = 0 )); + info.songs = ( info.startSong = ( info.currentSong = 0 )); + info.sidChipBase1 = 0xd400; + info.sidChipBase2 = 0; + info.musPlayer = false; + info.fixLoad = false; + info.songSpeed = SIDTUNE_SPEED_VBI; +#ifdef SIDTUNE_PSID2NG + info.clockSpeed = SIDTUNE_CLOCK_UNKNOWN; + info.sidModel = SIDTUNE_SIDMODEL_UNKNOWN; +#else + info.clockSpeed = SIDTUNE_CLOCK_PAL; + info.sidModel = SIDTUNE_SIDMODEL_6581; +#endif + info.compatibility = SIDTUNE_COMPATIBILITY_C64; + info.songLength = 0; + info.relocStartPage = 0; + info.relocPages = 0; + + for ( uint_least16_t si = 0; si < SIDTUNE_MAX_SONGS; si++ ) + { + songSpeed[si] = info.songSpeed; + clockSpeed[si] = info.clockSpeed; + songLength[si] = 0; + } + + fileOffset = 0; + musDataLen = 0; + + for ( uint_least16_t sNum = 0; sNum < SIDTUNE_MAX_CREDIT_STRINGS; sNum++ ) + { + for ( uint_least16_t sPos = 0; sPos < SIDTUNE_MAX_CREDIT_STRLEN; sPos++ ) + { + infoString[sNum][sPos] = 0; + } + } + info.numberOfInfoStrings = 0; + + // Not used!!! + info.numberOfCommentStrings = 1; +#ifdef HAVE_EXCEPTIONS + info.commentString = new(std::nothrow) char* [info.numberOfCommentStrings]; +#else + info.commentString = new char* [info.numberOfCommentStrings]; +#endif + if (info.commentString != 0) + info.commentString[0] = SidTuneTools::myStrDup("--- SAVED WITH SIDPLAY ---"); + else + info.commentString[0] = 0; +} + +void SidTune::cleanup() +{ + // Remove copy of comment field. + uint_least32_t strNum = 0; + // Check and remove every available line. + while (info.numberOfCommentStrings-- > 0) + { + if (info.commentString[strNum] != 0) + { + delete[] info.commentString[strNum]; + info.commentString[strNum] = 0; + } + strNum++; // next string + }; + delete[] info.commentString; // free the array pointer + + deleteFileNameCopies(); + + status = false; +} + +#if !defined(SIDTUNE_NO_STDIN_LOADER) + +void SidTune::getFromStdIn() +{ + // Assume a failure, so we can simply return. + status = false; + // Assume the memory allocation to fail. + info.statusString = SidTune::txt_notEnoughMemory; + uint_least8_t* fileBuf; +#ifdef HAVE_EXCEPTIONS + if ( 0 == (fileBuf = new(std::nothrow) uint_least8_t[SIDTUNE_MAX_FILELEN]) ) +#else + if ( 0 == (fileBuf = new uint_least8_t[SIDTUNE_MAX_FILELEN]) ) +#endif + { + return; + } + // We only read as much as fits in the buffer. + // This way we avoid choking on huge data. + uint_least32_t i = 0; + char datb; + while (std::cin.get(datb) && i<SIDTUNE_MAX_FILELEN) + fileBuf[i++] = (uint_least8_t) datb; + info.dataFileLen = i; + getFromBuffer(fileBuf,info.dataFileLen); + delete[] fileBuf; +} + +#endif + +void SidTune::getFromBuffer(const uint_least8_t* const buffer, const uint_least32_t bufferLen) +{ + // Assume a failure, so we can simply return. + status = false; + + if (buffer==0 || bufferLen==0) + { + info.statusString = SidTune::txt_empty; + return; + } + else if (bufferLen > SIDTUNE_MAX_FILELEN) + { + info.statusString = SidTune::txt_fileTooLong; + return; + } + + uint_least8_t* tmpBuf; +#ifdef HAVE_EXCEPTIONS + if ( 0 == (tmpBuf = new(std::nothrow) uint_least8_t[bufferLen]) ) +#else + if ( 0 == (tmpBuf = new uint_least8_t[bufferLen]) ) +#endif + { + info.statusString = SidTune::txt_notEnoughMemory; + return; + } + memcpy(tmpBuf,buffer,bufferLen); + + Buffer_sidtt<const uint_least8_t> buf1(tmpBuf,bufferLen); + Buffer_sidtt<const uint_least8_t> buf2; // empty + + bool foundFormat = false; + // Here test for the possible single file formats. -------------- + if ( PSID_fileSupport( buffer, bufferLen )) + { + foundFormat = true; + } + else if ( MUS_fileSupport(buf1,buf2) ) + { + foundFormat = MUS_mergeParts(buf1,buf2); + } + else + { + // No further single-file-formats available. + info.statusString = SidTune::txt_unrecognizedFormat; + } + if ( foundFormat ) + { + status = acceptSidTune("-","-",buf1); + } +} + +bool SidTune::acceptSidTune(const char* dataFileName, const char* infoFileName, + Buffer_sidtt<const uint_least8_t>& buf) +{ + deleteFileNameCopies(); + // Make a copy of the data file name and path, if available. + if ( dataFileName != 0 ) + { + info.path = SidTuneTools::myStrDup(dataFileName); + if (isSlashedFileName) + { + info.dataFileName = SidTuneTools::myStrDup(SidTuneTools::slashedFileNameWithoutPath(info.path)); + *SidTuneTools::slashedFileNameWithoutPath(info.path) = 0; // path only + } + else + { + info.dataFileName = SidTuneTools::myStrDup(SidTuneTools::fileNameWithoutPath(info.path)); + *SidTuneTools::fileNameWithoutPath(info.path) = 0; // path only + } + if ((info.path==0) || (info.dataFileName==0)) + { + info.statusString = SidTune::txt_notEnoughMemory; + return false; + } + } + else + { + // Provide empty strings. + info.path = SidTuneTools::myStrDup(""); + info.dataFileName = SidTuneTools::myStrDup(""); + } + // Make a copy of the info file name, if available. + if ( infoFileName != 0 ) + { + char* tmp = SidTuneTools::myStrDup(infoFileName); + if (isSlashedFileName) + info.infoFileName = SidTuneTools::myStrDup(SidTuneTools::slashedFileNameWithoutPath(tmp)); + else + info.infoFileName = SidTuneTools::myStrDup(SidTuneTools::fileNameWithoutPath(tmp)); + if ((tmp==0) || (info.infoFileName==0)) + { + info.statusString = SidTune::txt_notEnoughMemory; + return false; + } + delete[] tmp; + } + else + { + // Provide empty string. + info.infoFileName = SidTuneTools::myStrDup(""); + } + // Fix bad sidtune set up. + if (info.songs > SIDTUNE_MAX_SONGS) + info.songs = SIDTUNE_MAX_SONGS; + else if (info.songs == 0) + info.songs++; + if (info.startSong > info.songs) + info.startSong = 1; + else if (info.startSong == 0) + info.startSong++; + + if ( info.musPlayer ) + MUS_setPlayerAddress(); + + info.dataFileLen = buf.len(); + info.c64dataLen = buf.len() - fileOffset; + + if (info.dataFileLen >= 2) + { + // We only detect an offset of two. Some position independent + // sidtunes contain a load address of 0xE000, but are loaded + // to 0x0FFE and call player at 0x1000. + info.fixLoad = (endian_little16(buf.get()+fileOffset)==(info.loadAddr+2)); + } + + // Check the size of the data. + if ( info.c64dataLen > SIDTUNE_MAX_MEMORY ) + { + info.statusString = SidTune::txt_dataTooLong; + return false; + } + else if ( info.c64dataLen == 0 ) + { + info.statusString = SidTune::txt_empty; + return false; + } + + cache.assign(buf.xferPtr(),buf.xferLen()); + + info.statusString = SidTune::txt_noErrors; + return true; +} + +bool SidTune::createNewFileName(Buffer_sidtt<char>& destString, + const char* sourceName, + const char* sourceExt) +{ + Buffer_sidtt<char> newBuf; + uint_least32_t newLen = strlen(sourceName)+strlen(sourceExt)+1; + // Get enough memory, so we can appended the extension. +#ifdef HAVE_EXCEPTIONS + newBuf.assign(new(std::nothrow) char[newLen],newLen); +#else + newBuf.assign(new char[newLen],newLen); +#endif + if ( newBuf.isEmpty() ) + { + info.statusString = SidTune::txt_notEnoughMemory; + return (status = false); + } + strcpy(newBuf.get(),sourceName); + strcpy(SidTuneTools::fileExtOfPath(newBuf.get()),sourceExt); + destString.assign(newBuf.xferPtr(),newBuf.xferLen()); + return true; +} + +// Initializing the object based upon what we find in the specified file. + +void SidTune::getFromFiles(const char* fileName) +{ + // Assume a failure, so we can simply return. + status = false; + + Buffer_sidtt<const uint_least8_t> fileBuf1, fileBuf2; + Buffer_sidtt<char> fileName2; + + // Try to load the single specified file. + if ( loadFile(fileName,fileBuf1) ) + { + // File loaded. Now check if it is in a valid single-file-format. + if ( PSID_fileSupport(fileBuf1.get(),fileBuf1.len()) ) + { + status = acceptSidTune(fileName,0,fileBuf1); + return; + } + else if ( MUS_fileSupport(fileBuf1,fileBuf2) ) + { + // Try to find second file. + int n = 0; + while (fileNameExtensions[n] != 0) + { + if ( !createNewFileName(fileName2,fileName,fileNameExtensions[n]) ) + return; + // 1st data file was loaded into ``fileBuf1'', + // so we load the 2nd one into ``fileBuf2''. + // Do not load the first file again if names are equal. + if ( MYSTRICMP(fileName,fileName2.get())!=0 && + loadFile(fileName2.get(),fileBuf2) ) + { + if ( MUS_fileSupport(fileBuf1,fileBuf2) ) + { + if ( MUS_mergeParts(fileBuf1,fileBuf2) ) + { + status = acceptSidTune(fileName,fileName2.get(), + fileBuf1); + } + return; // in either case + } + } + n++; + }; + // No second file. + status = acceptSidTune(fileName,0,fileBuf1); + return; + } + +// -------------------------------------- Support for multiple-files formats. + else + { +// We cannot simply try to load additional files, if a description file was +// specified. It would work, but is error-prone. Imagine a filename mismatch +// or more than one description file (in another) format. Any other file +// with an appropriate file name can be the C64 data file. + +// First we see if ``fileName'' could be a raw data file. In that case we +// have to find the corresponding description file. + + // Right now we do not have a second file. Hence the (0, 0, ...) + // parameters are set for the data buffer. This will not hurt the + // file support procedures. + + // Make sure that ``fileBuf1'' does not contain a description file. + if ( !SID_fileSupport(0,0,fileBuf1.get(),fileBuf1.len()) && + !INFO_fileSupport(0,0,fileBuf1.get(),fileBuf1.len()) ) + { + // Assuming ``fileName'' to hold the name of the raw data file, + // we now create the name of a description file (=fileName2) by + // appending various filename extensions. + +// ------------------------------------------ Looking for a description file. + + int n = 0; + while (fileNameExtensions[n] != 0) + { + if ( !createNewFileName(fileName2,fileName,fileNameExtensions[n]) ) + return; + // 1st data file was loaded into ``fileBuf1'', + // so we load the 2nd one into ``fileBuf2''. + // Do not load the first file again if names are equal. + if ( MYSTRICMP(fileName,fileName2.get())!=0 && + loadFile(fileName2.get(),fileBuf2) ) + { + if ( SID_fileSupport(fileBuf1.get(),fileBuf1.len(), + fileBuf2.get(),fileBuf2.len()) + || INFO_fileSupport(fileBuf1.get(),fileBuf1.len(), + fileBuf2.get(),fileBuf2.len()) + ) + { + status = acceptSidTune(fileName,fileName2.get(), + fileBuf1); + return; + } + } + n++; + }; + +// --------------------------------------- Could not find a description file. + + info.statusString = SidTune::txt_unrecognizedFormat; + return; + } + +// ------------------------------------------------------------------------- +// Still unsuccessful ? Probably one put a description file name into +// ``fileName''. Assuming ``fileName'' to hold the name of a description +// file, we now create the name of the data file and swap both used memory +// buffers - fileBuf1 and fileBuf2 - when calling the format support. +// If it works, the second file is the data file ! If it is not, but does +// exist, we are out of luck, since we cannot detect data files. + + // Make sure ``fileBuf1'' contains a description file. + else if ( SID_fileSupport(0,0,fileBuf1.get(),fileBuf1.len()) || + INFO_fileSupport(0,0,fileBuf1.get(),fileBuf1.len()) ) + { + +// --------------------- Description file found. --- Looking for a data file. + + int n = 0; + while (fileNameExtensions[n] != 0) + { + if ( !createNewFileName(fileName2,fileName,fileNameExtensions[n]) ) + return; + // 1st info file was loaded into ``fileBuf'', + // so we load the 2nd one into ``fileBuf2''. + // Do not load the first file again if names are equal. + if ( MYSTRICMP(fileName,fileName2.get())!=0 && + + loadFile(fileName2.get(),fileBuf2) ) + { +// -------------- Some data file found, now identifying the description file. + + if ( SID_fileSupport(fileBuf2.get(),fileBuf2.len(), + fileBuf1.get(),fileBuf1.len()) + || INFO_fileSupport(fileBuf2.get(),fileBuf2.len(), + fileBuf1.get(),fileBuf1.len()) + ) + { + status = acceptSidTune(fileName2.get(),fileName, + fileBuf2); + return; + } + } + n++; + }; + +// ---------------------------------------- No corresponding data file found. + + info.statusString = SidTune::txt_noDataFile; + return; + } // end else if ( = is description file ) + +// --------------------------------- Neither description nor data file found. + + else + { + info.statusString = SidTune::txt_unrecognizedFormat; + return; + } + } // end else ( = is no singlefile ) + +// ---------------------------------------------------------- File I/O error. + + } // if loaddatafile + else + { + // returned fileLen was 0 = error. The info.statusString is + // already set then. + return; + } +} + +void SidTune::convertOldStyleSpeedToTables(uint_least32_t speed, int clock) +{ + // Create the speed/clock setting tables. + // + // This does not take into account the PlaySID bug upon evaluating the + // SPEED field. It would most likely break compatibility to lots of + // sidtunes, which have been converted from .SID format and vice versa. + // The .SID format does the bit-wise/song-wise evaluation of the SPEED + // value correctly, like it is described in the PlaySID documentation. + + int toDo = ((info.songs <= SIDTUNE_MAX_SONGS) ? info.songs : SIDTUNE_MAX_SONGS); + for (int s = 0; s < toDo; s++) + { + clockSpeed[s] = clock; + if (( (speed>>(s&31)) & 1 ) == 0 ) + songSpeed[s] = SIDTUNE_SPEED_VBI; + else + songSpeed[s] = SIDTUNE_SPEED_CIA_1A; + } +} + +// +// File format conversion --------------------------------------------------- +// + +bool SidTune::saveToOpenFile(std::ofstream& toFile, const uint_least8_t* buffer, + uint_least32_t bufLen ) +{ + uint_least32_t lenToWrite = bufLen; + while ( lenToWrite > INT_MAX ) + { + toFile.write((char*)buffer+(bufLen-lenToWrite),INT_MAX); + lenToWrite -= INT_MAX; + } + if ( lenToWrite > 0 ) + toFile.write((char*)buffer+(bufLen-lenToWrite),lenToWrite); + if ( toFile.bad() ) + { + info.statusString = SidTune::txt_fileIoError; + return false; + } + else + { + info.statusString = SidTune::txt_noErrors; + return true; + } +} + +bool SidTune::saveC64dataFile( const char* fileName, bool overWriteFlag ) +{ + bool success = false; // assume error + // This prevents saving from a bad object. + if ( status ) + { + // Open binary output file stream. + //openmode createAttr = std::ios::out; + std::_Ios_Openmode createAttr = std::ios::out; +#if defined(HAVE_IOS_BIN) + createAttr |= std::ios::bin; +#else + createAttr |= std::ios::binary; +#endif + if ( overWriteFlag ) + createAttr |= std::ios::trunc; + else + createAttr |= std::ios::app; + std::ofstream fMyOut( fileName, createAttr ); + if ( !fMyOut || fMyOut.tellp()>0 ) + { + info.statusString = SidTune::txt_cantCreateFile; + } + else + { + // Save c64 lo/hi load address. + uint_least8_t saveAddr[2]; + saveAddr[0] = info.loadAddr & 255; + saveAddr[1] = info.loadAddr >> 8; + fMyOut.write((char*)saveAddr,2); + // Data starts at: bufferaddr + fileOffset + // Data length: info.dataFileLen - fileOffset + if ( !saveToOpenFile( fMyOut,cache.get()+fileOffset, info.dataFileLen - fileOffset ) ) + { + info.statusString = SidTune::txt_fileIoError; + } + else + { + info.statusString = SidTune::txt_noErrors; + success = true; + } + fMyOut.close(); + } + } + return success; +} + +bool SidTune::saveSIDfile( const char* fileName, bool overWriteFlag ) +{ + bool success = false; // assume error + // This prevents saving from a bad object. + if ( status ) + { + // Open ASCII output file stream. +// openmode createAttr = std::ios::out; + std::_Ios_Openmode createAttr = std::ios::out; + if ( overWriteFlag ) + createAttr |= std::ios::trunc; + else + createAttr |= std::ios::app; + std::ofstream fMyOut( fileName, createAttr ); + if ( !fMyOut || fMyOut.tellp()>0 ) + { + info.statusString = SidTune::txt_cantCreateFile; + } + else + { + if ( !SID_fileSupportSave( fMyOut ) ) + { + info.statusString = SidTune::txt_fileIoError; + } + else + { + info.statusString = SidTune::txt_noErrors; + success = true; + } + fMyOut.close(); + } + } + return success; +} + +bool SidTune::savePSIDfile( const char* fileName, bool overWriteFlag ) +{ + bool success = false; // assume error + // This prevents saving from a bad object. + if ( status ) + { + // Open binary output file stream. + //openmode createAttr = std::ios::out; + std::_Ios_Openmode createAttr = std::ios::out; +#if defined(HAVE_IOS_BIN) + createAttr |= std::ios::bin; +#else + createAttr |= std::ios::binary; +#endif + if ( overWriteFlag ) + createAttr |= std::ios::trunc; + else + createAttr |= std::ios::app; + std::ofstream fMyOut( fileName, createAttr ); + if ( !fMyOut || fMyOut.tellp()>0 ) + { + info.statusString = SidTune::txt_cantCreateFile; + } + else + { + if ( !PSID_fileSupportSave( fMyOut,cache.get() ) ) + { + info.statusString = SidTune::txt_fileIoError; + } + else + { + info.statusString = SidTune::txt_noErrors; + success = true; + } + fMyOut.close(); + } + } + return success; +} + +bool SidTune::checkRealC64Info (uint_least32_t speed) +{ + if (info.loadAddr != 0) + return false; + if (info.playAddr != 0) + return false; + if (speed != 0) + return false; + if (info.compatibility == SIDTUNE_COMPATIBILITY_PSID) + return false; + return true; +} + +bool SidTune::checkRealC64Init (void) +{ + if (info.initAddr == 0) + info.initAddr = info.loadAddr; + + // Check valid init address + switch (info.initAddr >> 12) + { + case 0x0F: + case 0x0E: + case 0x0D: + case 0x0B: + case 0x0A: + return false; + default: + if ( (info.initAddr < info.loadAddr) || + (info.initAddr > (info.loadAddr + info.c64dataLen - 1)) ) + { + return false; + } + } + return true; +} + +bool SidTune::checkRelocInfo (void) +{ + uint_least8_t startp, endp; + + // Fix relocation information + if (info.relocStartPage == 0xFF) + { + info.relocPages = 0; + return true; + } + else if (info.relocPages == 0) + { + info.relocStartPage = 0; + return true; + } + + // Calculate start/end page + startp = info.relocStartPage; + endp = (startp + info.relocPages - 1) & 0xff; + if (endp < startp) + { + info.formatString = txt_badReloc; + return false; + } + + { // Check against load range + uint_least8_t startlp, endlp; + startlp = (uint_least8_t) (info.loadAddr >> 8); + endlp = startlp; + endlp += (uint_least8_t) ((info.c64dataLen - 1) >> 8); + + if ( ((startp <= startlp) && (endp >= startlp)) || + ((startp <= endlp) && (endp >= endlp)) ) + { + info.formatString = txt_badReloc; + return false; + } + } + + // Check that the relocation information does not use the following + // memory areas: 0x0000-0x03FF, 0xA000-0xBFFF and 0xD000-0xFFFF + if ((startp < 0x04) + || ((0xa0 <= startp) && (startp <= 0xbf)) + || (startp >= 0xd0) + || ((0xa0 <= endp) && (endp <= 0xbf)) + || (endp >= 0xd0)) + { + info.formatString = txt_badReloc; + return false; + } + return true; +} + +bool SidTune::resolveAddrs (const uint_least8_t* c64data) +{ + if ( info.compatibility == SIDTUNE_COMPATIBILITY_R64 ) + { + bool initAddrCheck = true; + + // Check tune is loadable on a real C64 + if ( info.loadAddr < SIDTUNE_R64_MIN_LOAD_ADDR ) + { + info.formatString = txt_badAddr; + return false; + } + + if ( (info.initAddr == 0) && (info.loadAddr == SIDTUNE_BASIC_START) ) + { // Scan basic for a sys call + const uint_least8_t* pData = c64data; + uint_least16_t addr = 0; + uint_least16_t next = endian_little16(pData); + uint_least16_t init = 0; + + while (next) + { // skip addr & line number + const uint_least8_t *p = &pData[addr + 4]; + +SidTune_resolveAddrs_basic: + // Check for SYS + if (*p++ != 0x9e) + { // Check for ':' instruction seperator before + // jumping to next basic line + while (*p != '\0') + { + if (*p++ == ':') + { // Skip spaces + while (*p == ' ') + p++; + // Make sure havent hit end of line + if (*p != '\0') + goto SidTune_resolveAddrs_basic; + } + } + // Not a sys so jump to next intruction + addr = next; + // Get addr of next line of basic + next = endian_little16(&pData[addr]); + continue; + } + // Skip spaces + while (*p == ' ') + p++; + // Found a sys, extract all numbers + while ( (*p >= '0') && (*p <= '9') ) + { + init *= 10; + init += *p++ - '0'; + } + info.initAddr = init; + // Assume address is legal otherwise + // a real c64 would crash + initAddrCheck = false; + break; + } + } + + if ( checkRealC64Init() == false ) + { + info.formatString = txt_badAddr; + return false; + } + } + else if ( info.initAddr == 0 ) + info.initAddr = info.loadAddr; + return true; +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneCfg.h b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneCfg.h new file mode 100644 index 00000000..7b184156 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneCfg.h @@ -0,0 +1,35 @@ +/* SidTuneCfg.h (template) */ + +#ifndef SIDTUNECFG_H +#define SIDTUNECFG_H + +#include "config.h" + +/* Define to add PSID2NG support */ +#define SIDTUNE_PSID2NG + +/* Minimum load address for real c64 only tunes */ +#define SIDTUNE_R64_MIN_LOAD_ADDR 0x07e8 + +/* -------------------------------------------------------------------------- + * Don't touch these! + * -------------------------------------------------------------------------- + */ +#undef SIDTUNE_NO_STDIN_LOADER +#undef SIDTUNE_REJECT_UNKNOWN_FIELDS + + +/* Define the file/path separator(s) that your filesystem uses: + SID_FS_IS_COLON_AND_BACKSLASH, SID_FS_IS_COLON_AND_SLASH, + SID_FS_IS_BACKSLASH, SID_FS_IS_COLON, SID_FS_IS_SLASH */ +#if defined(HAVE_MSWINDOWS) || defined(HAVE_MSDOS) || defined(HAVE_OS2) + #define SID_FS_IS_COLON_AND_BACKSLASH_AND_SLASH +#elif defined(HAVE_MACOS) + #define SID_FS_IS_COLON +#elif defined(HAVE_AMIGAOS) + #define SID_FS_IS_COLON_AND_SLASH +#else + #define SID_FS_IS_SLASH +#endif + +#endif /* SIDTUNECFG_H */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneTools.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneTools.cpp new file mode 100644 index 00000000..79bf1597 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneTools.cpp @@ -0,0 +1,215 @@ +/* + * /home/ms/files/source/libsidtune/RCS/SidTuneTools.cpp,v + * + * Copyright (C) Michael Schwendt <mschwendt@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "SidTuneTools.h" + +#ifdef HAVE_EXCEPTIONS +# include <new> +#endif +#include <ctype.h> +#include <string.h> + +// Own version of strdup, which uses new instead of malloc. +char* SidTuneTools::myStrDup(const char *source) +{ + char *dest; +#ifdef HAVE_EXCEPTIONS + if ( (dest = new(std::nothrow) char[strlen(source)+1]) != 0) +#else + if ( (dest = new char[strlen(source)+1]) != 0) +#endif + { + strcpy(dest,source); + } + return dest; +} + +// Return pointer to file name position in complete path. +char* SidTuneTools::fileNameWithoutPath(char* s) +{ + int last_slash_pos = -1; + for ( uint_least32_t pos = 0; pos < strlen(s); pos++ ) + { +#if defined(SID_FS_IS_COLON_AND_BACKSLASH_AND_SLASH) + if ( s[pos] == ':' || s[pos] == '\\' || + s[pos] == '/' ) +#elif defined(SID_FS_IS_COLON_AND_SLASH) + if ( s[pos] == ':' || s[pos] == '/' ) +#elif defined(SID_FS_IS_SLASH) + if ( s[pos] == '/' ) +#elif defined(SID_FS_IS_BACKSLASH) + if ( s[pos] == '\\' ) +#elif defined(SID_FS_IS_COLON) + if ( s[pos] == ':' ) +#else +#error Missing file/path separator definition. +#endif + { + last_slash_pos = pos; + } + } + return( &s[last_slash_pos +1] ); +} + +// Return pointer to file name position in complete path. +// Special version: file separator = forward slash. +char* SidTuneTools::slashedFileNameWithoutPath(char* s) +{ + int last_slash_pos = -1; + for ( uint_least32_t pos = 0; pos < strlen(s); pos++ ) + { + if ( s[pos] == '/' ) + { + last_slash_pos = pos; + } + } + return( &s[last_slash_pos +1] ); +} + +// Return pointer to file name extension in path. +// The backwards-version. +char* SidTuneTools::fileExtOfPath(char* s) +{ + uint_least32_t last_dot_pos = strlen(s); // assume no dot and append + for ( int pos = last_dot_pos; pos >= 0; --pos ) + { + if ( s[pos] == '.' ) + { + last_dot_pos = pos; + break; + } + } + return( &s[last_dot_pos] ); +} + +// Parse input string stream. Read and convert a hexa-decimal number up +// to a ``,'' or ``:'' or ``\0'' or end of stream. +uint_least32_t SidTuneTools::readHex( std::istrstream& hexin ) +{ + uint_least32_t hexLong = 0; + char c; + do + { + hexin >> c; + if ( !hexin ) + break; + if (( c != ',') && ( c != ':' ) && ( c != 0 )) + { + // machine independed to_upper + c &= 0xdf; + ( c < 0x3a ) ? ( c &= 0x0f ) : ( c -= ( 0x41 - 0x0a )); + hexLong <<= 4; + hexLong |= (uint_least32_t)c; + } + else + { + if ( c == 0 ) + hexin.putback(c); + break; + } + } while ( hexin ); + return hexLong; +} + +// Parse input string stream. Read and convert a decimal number up +// to a ``,'' or ``:'' or ``\0'' or end of stream. +uint_least32_t SidTuneTools::readDec( std::istrstream& decin ) +{ + uint_least32_t hexLong = 0; + char c; + do + { + decin >> c; + if ( !decin ) + break; + if (( c != ',') && ( c != ':' ) && ( c != 0 )) + { + c &= 0x0f; + hexLong *= 10; + hexLong += (uint_least32_t)c; + } + else + { + if ( c == 0 ) + decin.putback(c); + break; + } + } while ( decin ); + return hexLong; +} + +// Search terminated string for next newline sequence. +// Skip it and return pointer to start of next line. +const char* SidTuneTools::returnNextLine(const char* s) +{ + // Unix: LF = 0x0A + // Windows, DOS: CR,LF = 0x0D,0x0A + // Mac: CR = 0x0D + char c; + while ((c = *s) != 0) + { + s++; // skip read character + if (c == 0x0A) + { + break; // LF found + } + else if (c == 0x0D) + { + if (*s == 0x0A) + { + s++; // CR,LF found, skip LF + } + break; // CR or CR,LF found + } + } + if (*s == 0) // end of string ? + { + return 0; // no next line available + } + return s; // next line available +} + +// Skip any characters in an input string stream up to '='. +void SidTuneTools::skipToEqu( std::istrstream& parseStream ) +{ + char c; + do + { + parseStream >> c; + } + while ( c != '=' ); +} + +void SidTuneTools::copyStringValueToEOL(const char* pSourceStr, char* pDestStr, int DestMaxLen ) +{ + // Start at first character behind '='. + while ( *pSourceStr != '=' ) + { + pSourceStr++; + } + pSourceStr++; // Skip '='. + while (( DestMaxLen > 0 ) && ( *pSourceStr != 0 ) + && ( *pSourceStr != '\n' ) && ( *pSourceStr != '\r' )) + { + *pDestStr++ = *pSourceStr++; + DestMaxLen--; + } + *pDestStr++ = 0; +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneTools.h b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneTools.h new file mode 100644 index 00000000..bc67fa93 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/sidtune/SidTuneTools.h @@ -0,0 +1,85 @@ +/* + * /home/ms/files/source/libsidtune/RCS/SidTuneTools.h,v + * + * Copyright (C) Michael Schwendt <mschwendt@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TOOLS_H +#define TOOLS_H + +#include "SidTuneCfg.h" +#include "sidtypes.h" + +#include <string.h> +#include <strstream> + +#define MYSTRICMP stricmp +#if defined(HAVE_STRCASECMP) + #undef MYSTRICMP + #define MYSTRICMP strcasecmp +#endif + +#define MYSTRNICMP strnicmp +#if defined(HAVE_STRNCASECMP) + #undef MYSTRNICMP + #define MYSTRNICMP strncasecmp +#endif + +class SidTuneTools +{ + public: + + // Wrapper for ``strnicmp'' without third argument. + static int myStrNcaseCmp(const char* s1, const char* s2) + { + return MYSTRNICMP(s1,s2,strlen(s2)); + } + + // Own version of strdup, which uses new instead of malloc. + static char* myStrDup(const char *source); + + // Return pointer to file name position in complete path. + static char* fileNameWithoutPath(char* s); + + // Return pointer to file name position in complete path. + // Special version: file separator = forward slash. + static char* slashedFileNameWithoutPath(char* s); + + // Return pointer to file name extension in path. + // Searching backwards until first dot is found. + static char* fileExtOfPath(char* s); + + // Parse input string stream. Read and convert a hexa-decimal number up + // to a ``,'' or ``:'' or ``\0'' or end of stream. + static uint_least32_t readHex(std::istrstream& parseStream); + + // Parse input string stream. Read and convert a decimal number up + // to a ``,'' or ``:'' or ``\0'' or end of stream. + static uint_least32_t readDec(std::istrstream& parseStream); + + // Search terminated string for next newline sequence. + // Skip it and return pointer to start of next line. + static const char* returnNextLine(const char* pBuffer); + + // Skip any characters in an input string stream up to '='. + static void skipToEqu(std::istrstream& parseStream); + + // Start at first character behind '=' and copy rest of string. + static void copyStringValueToEOL(const char* pSourceStr, char* pDestStr, int destMaxLen); +}; + +#endif /* TOOLS_H */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/Makefile.am new file mode 100644 index 00000000..4c7caf6a --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/Makefile.am @@ -0,0 +1,7 @@ + +noinst_LTLIBRARIES = libxsid.la + +libxsid_la_SOURCES = xsid.cpp xsid.h + +# Remove bad default includes +DEFAULT_INCLUDES= diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/Makefile.in new file mode 100644 index 00000000..aafad807 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/Makefile.in @@ -0,0 +1,424 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +noinst_LTLIBRARIES = libxsid.la + +libxsid_la_SOURCES = xsid.cpp xsid.h + +# Remove bad default includes +DEFAULT_INCLUDES = +subdir = src/xsid +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/unix/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + +libxsid_la_LDFLAGS = +libxsid_la_LIBADD = +am_libxsid_la_OBJECTS = xsid.lo +libxsid_la_OBJECTS = $(am_libxsid_la_OBJECTS) +depcomp = $(SHELL) $(top_srcdir)/unix/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/xsid.Plo +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libxsid_la_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libxsid_la_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/xsid/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" = "$$p" && dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libxsid.la: $(libxsid_la_OBJECTS) $(libxsid_la_DEPENDENCIES) + $(CXXLINK) $(libxsid_la_LDFLAGS) $(libxsid_la_OBJECTS) $(libxsid_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsid.Plo@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/xsid.cpp b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/xsid.cpp new file mode 100644 index 00000000..29b5c909 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/xsid.cpp @@ -0,0 +1,598 @@ +/*************************************************************************** + xsid.cpp - Support for Playsids Extended + Registers + ------------------- + begin : Tue Jun 20 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: xsid.cpp,v $ + * Revision 1.20 2002/07/17 21:19:54 s_a_white + * Minor non sid sample mode fixes. + * + * Revision 1.19 2002/02/21 20:26:13 s_a_white + * Nolonger default to Galway Mode when Noise samples init incorrectly. Fixes + * VARIOUS/S-Z/Zyron/Bouncy_Balls.sid (HVSC). + * + * Revision 1.18 2002/02/17 16:34:39 s_a_white + * New reset interface + * + * Revision 1.17 2002/01/28 19:31:42 s_a_white + * PSID sample improvements. + * + * Revision 1.16 2001/10/02 18:03:03 s_a_white + * Support updated sidbuilder class interface. + * + * Revision 1.15 2001/09/17 18:36:41 s_a_white + * Changed object construction to prevent multiple resets. + * + * Revision 1.14 2001/07/14 12:59:53 s_a_white + * XSID effeciency increased. Now uses new component classes and event + * generation. + * + * Revision 1.13 2001/03/25 19:51:23 s_a_white + * Performance update. + * + * Revision 1.12 2001/03/19 23:40:19 s_a_white + * Removed repeat definition of state for debug mode. + * + * Revision 1.11 2001/03/09 22:27:13 s_a_white + * Speed optimisation update. + * + * Revision 1.10 2001/03/01 23:45:58 s_a_white + * Combined both through sid and non-through sid modes. Can be selected + * at runtime now. + * + * Revision 1.9 2001/02/21 21:46:34 s_a_white + * 0x1d = 0 now fixed. Limit checking on sid volume. This helps us determine + * even better what the sample offset should be (fixes Skate and Die). + * + * Revision 1.8 2001/02/07 21:02:30 s_a_white + * Supported for delaying samples for frame simulation. New alogarithm to + * better guess original tunes volume when playing samples. + * + * Revision 1.7 2000/12/12 22:51:01 s_a_white + * Bug Fix #122033. + * + ***************************************************************************/ + +#include <string.h> +#include <stdio.h> +#include "sidendian.h" +#include "xsid.h" + + +// Convert from 4 bit resolution to 8 bits +/* Rev 2.0.5 (saw) - Removed for a more non-linear equivalent + which better models the SIDS master volume register +const int8_t XSID::sampleConvertTable[16] = +{ + '\x80', '\x91', '\xa2', '\xb3', '\xc4', '\xd5', '\xe6', '\xf7', + '\x08', '\x19', '\x2a', '\x3b', '\x4c', '\x5d', '\x6e', '\x7f' +}; +*/ +const int8_t XSID::sampleConvertTable[16] = +{ + '\x80', '\x94', '\xa9', '\xbc', '\xce', '\xe1', '\xf2', '\x03', + '\x1b', '\x2a', '\x3b', '\x49', '\x58', '\x66', '\x73', '\x7f' +}; + +const char *XSID::credit = +{ + "xSID (Extended SID) Engine:\0" + "\tCopyright (C) 2000 Simon White <sidplay2@email.com>\0" +}; + + +channel::channel (const char * const name, EventContext *context, XSID *xsid) +:m_name(name), + m_context(*context), + m_xsid(*xsid), + sampleEvent(this), + galwayEvent(this) +{ + memset (reg, 0, sizeof (reg)); + active = true; + reset (); +} + +void channel::reset () +{ + galVolume = 0; // This is left to free run until reset + mode = FM_NONE; + free (); +} + +void channel::free () +{ + active = false; + cycleCount = 0; + sampleLimit = 0; + // Set XSID to stopped state + reg[convertAddr (0x1d)] = 0; + silence (); +} + +inline int8_t channel::output () +{ + outputs++; + return sample; +} + +void channel::checkForInit () +{ // Check to see mode of operation + // See xsid documentation + switch (reg[convertAddr (0x1d)]) + { + case 0xFF: + case 0xFE: + case 0xFC: + sampleInit (); + break; + case 0xFD: + if (!active) + return; + free (); // Stop + // Calculate the sample offset + m_xsid.sampleOffsetCalc (); + break; + case 0x00: + break; + default: + galwayInit (); + } +} + +void channel::sampleInit () +{ + uint8_t *r; + if (active && (mode == FM_GALWAY)) + return; + +#ifdef XSID_DEBUG + printf ("XSID [%s]: Sample Init\n", m_name); + if (active && (mode == FM_HUELS)) + printf ("XSID [%s]: Stopping Playing Sample\n", m_name); +#endif + + // Check all important parameters are legal + r = ®[convertAddr (0x1d)]; + volShift = (uint_least8_t) (0 - (int8_t) r[0]) >> 1; + r[0] = 0; + // Use endian_16 as can't g + r = ®[convertAddr (0x1e)]; + address = endian_16 (r[1], r[0]); + r = ®[convertAddr (0x3d)]; + samEndAddr = endian_16 (r[1], r[0]); + if (samEndAddr <= address) return; + samScale = reg[convertAddr (0x5f)]; + r = ®[convertAddr (0x5d)]; + samPeriod = endian_16 (r[1], r[0]) >> samScale; + if (!samPeriod) + { // Stop this channel + reg[convertAddr (0x1d)] = 0xfd; + checkForInit (); + return; + } + + // Load the other parameters + samNibble = 0; + samRepeat = reg[convertAddr (0x3f)]; + samOrder = reg[convertAddr (0x7d)]; + r = ®[convertAddr (0x7e)]; + samRepeatAddr = endian_16 (r[1], r[0]); + cycleCount = samPeriod; + + // Support Galway Samples, but that + // mode it setup only when as Galway + // Noise sequence begins + if (mode == FM_NONE) + mode = FM_HUELS; + + active = true; + cycles = 0; + outputs = 0; + + sampleLimit = 8 >> volShift; + sample = sampleCalculate (); + + // Calculate the sample offset + m_xsid.sampleOffsetCalc (); + +#ifdef XSID_DEBUG +# if XSID_DEBUG > 1 + printf ("XSID [%s]: Sample Start Address: 0x%04x\n", m_name, address); + printf ("XSID [%s]: Sample End Address: 0x%04x\n", m_name, samEndAddr); + printf ("XSID [%s]: Sample Repeat Address: 0x%04x\n", m_name, samRepeatAddr); + printf ("XSID [%s]: Sample Period: %u\n", m_name, samPeriod); + printf ("XSID [%s]: Sample Repeat: %u\n", m_name, samRepeat); + printf ("XSID [%s]: Sample Order: %u\n", m_name, samOrder); +# endif + printf ("XSID [%s]: Sample Start\n", m_name); +#endif // XSID_DEBUG + + // Schedule a sample update + m_context.schedule (&m_xsid, 0); + m_context.schedule (&sampleEvent, cycleCount); +} + +void channel::sampleClock () +{ + cycleCount = samPeriod; + if (address >= samEndAddr) + { + if (samRepeat != 0xFF) + { + if (samRepeat) + samRepeat--; + else + samRepeatAddr = address; + } + + address = samRepeatAddr; + if (address >= samEndAddr) + { // The sequence has completed + uint8_t &status = reg[convertAddr (0x1d)]; + if (!status) + status = 0xfd; + if (status != 0xfd) + active = false; +#ifdef XSID_DEBUG + printf ("XSID [%s]: Sample Stop (%lu Cycles, %lu Outputs)\n", + m_name, cycles, outputs); + if (status != 0xfd) + printf ("XSID [%s]: Starting Delayed Sequence\n", m_name); +#endif + checkForInit (); + return; + } + } + + // We have reached the required sample + // So now we need to extract the right nibble + sample = sampleCalculate (); + cycles += cycleCount; + // Schedule a sample update + m_context.schedule (&sampleEvent, cycleCount); + m_context.schedule (&m_xsid, 0); +} + +int8_t channel::sampleCalculate () +{ + uint_least8_t tempSample = m_xsid.readMemByte (address); + if (samOrder == SO_LOWHIGH) + { + if (samScale == 0) + { + if (samNibble != 0) + tempSample >>= 4; + } + // AND 15 further below. + } + else // if (samOrder == SO_HIGHLOW) + { + if (samScale == 0) + { + if (samNibble == 0) + tempSample >>= 4; + } + else // if (samScale != 0) + tempSample >>= 4; + // AND 15 further below. + } + + // Move to next address + address += samNibble; + samNibble ^= 1; + return (int8_t) ((tempSample & 0x0f) - 0x08) >> volShift; +} + +void channel::galwayInit() +{ + uint8_t *r; + if (active) + return; + +#ifdef XSID_DEBUG + printf ("XSID [%s]: Galway Init\n", m_name); +#endif + + // Check all important parameters are legal + r = ®[convertAddr (0x1d)]; + galTones = r[0]; + r[0] = 0; + galInitLength = reg[convertAddr (0x3d)]; + if (!galInitLength) return; + galLoopWait = reg[convertAddr (0x3f)]; + if (!galLoopWait) return; + galNullWait = reg[convertAddr (0x5d)]; + if (!galNullWait) return; + + // Load the other parameters + r = ®[convertAddr(0x1e)]; + address = endian_16 (r[1], r[0]); + volShift = reg[convertAddr (0x3e)] & 0x0f; + mode = FM_GALWAY; + active = true; + cycles = 0; + outputs = 0; + + sampleLimit = 8; + sample = (int8_t) galVolume - 8; + galwayTonePeriod (); + + // Calculate the sample offset + m_xsid.sampleOffsetCalc (); + +#ifdef XSID_DEBUG + printf ("XSID [%s]: Galway Start\n", m_name); +#endif + + // Schedule a sample update + m_context.schedule (&m_xsid, 0); + m_context.schedule (&galwayEvent, cycleCount); +} + +void channel::galwayClock () +{ + if (--galLength) + cycleCount = samPeriod; + else if (galTones == 0xff) + { // The sequence has completed + uint8_t &status = reg[convertAddr (0x1d)]; + if (!status) + status = 0xfd; + if (status != 0xfd) + active = false; +#ifdef XSID_DEBUG + printf ("XSID [%s]: Galway Stop (%lu Cycles, %lu Outputs)\n", + m_name, cycles, outputs); + if (status != 0xfd) + printf ("XSID [%s]: Starting Delayed Sequence\n", m_name); +#endif + checkForInit (); + return; + } + else + galwayTonePeriod (); + + // See Galway Example... + galVolume += volShift; + galVolume &= 0x0f; + sample = (int8_t) galVolume - 8; + cycles += cycleCount; + m_context.schedule (&galwayEvent, cycleCount); + m_context.schedule (&m_xsid, 0); +} + +void channel::galwayTonePeriod () +{ // Calculate the number of cycles over which sample should last + galLength = galInitLength; + samPeriod = m_xsid.readMemByte (address + galTones); + samPeriod *= galLoopWait; + samPeriod += galNullWait; + cycleCount = samPeriod; +#if XSID_DEBUG > 2 + printf ("XSID [%s]: Galway Settings\n", m_name); + printf ("XSID [%s]: Length %u, LoopWait %u, NullWait %u\n", + m_name, galLength, galLoopWait, galNullWait); + printf ("XSID [%s]: Tones %u, Data %u\n", + m_name, galTones, m_xsid.readMemByte (address + galTones)); +#endif + galTones--; +} + +void channel::silence () +{ + sample = 0; + m_context.cancel (&sampleEvent); + m_context.cancel (&galwayEvent); + m_context.schedule (&m_xsid, 0); +} + + +XSID::XSID (EventContext *context) +:sidemu(NULL), + Event("xSID"), + ch4("CH4", context, this), + ch5("CH5", context, this), + muted(false), + suppressed(false), + wasRunning(false) +{ + sidSamples (true); +} + +void XSID::reset (uint8_t) +{ + ch4.reset (); + ch5.reset (); + suppressed = false; + wasRunning = false; +} + +void XSID::event (void) +{ + if (ch4 || ch5) + { + setSidData0x18 (); + wasRunning = true; + } + else if (wasRunning) + { + recallSidData0x18 (); + wasRunning = false; + } +} + +// Use Suppress to delay the samples and start them later +// Effectivly allows running samples in a frame based mode. +void XSID::suppress (bool enable) +{ + // @FIXME@: Mute Temporary Hack + suppressed = enable; + if (!suppressed) + { // Get the channels running +#if XSID_DEBUG + printf ("XSID: Un-suppressing\n"); +#endif + ch4.checkForInit (); + ch5.checkForInit (); + } +#if XSID_DEBUG + else + printf ("XSID: Suppressing\n"); +#endif +} + +// By muting samples they will start and play the at the +// appropriate time but no sound is produced. Un-muting +// will cause sound output from the current play position. +void XSID::mute (bool enable) +{ + if (!muted && enable && wasRunning) + recallSidData0x18 (); + muted = enable; +} + +void XSID::write (uint_least16_t addr, uint8_t data) +{ + channel *ch; + uint8_t tempAddr; + + // Make sure address is legal + if ((addr & 0xfe8c) ^ 0x000c) + return; + + ch = &ch4; + if (addr & 0x0100) + ch = &ch5; + + tempAddr = (uint8_t) addr; + ch->write (tempAddr, data); +#if XSID_DEBUG > 1 + printf ("XSID: Addr 0x%02x, Data 0x%02x\n", tempAddr, data); +#endif + + if (tempAddr == 0x1d) + { + if (suppressed) + { +#if XSID_DEBUG + printf ("XSID: Initialise Suppressed\n"); +#endif + return; + } + ch->checkForInit (); + } +} + +int8_t XSID::sampleOutput (void) +{ + int8_t sample; + sample = ch4.output (); + sample += ch5.output (); + // Automatically compensated for by C64 code + //return (sample >> 1); + return sample; +} + +void XSID::setSidData0x18 (void) +{ + if (!_sidSamples || muted) + return; + + uint8_t data = (sidData0x18 & 0xf0); + data |= ((sampleOffset + sampleOutput ()) & 0x0f); + +#ifdef XSID_DEBUG + if ((sampleOffset + sampleOutput ()) > 0x0f) + { + printf ("XSID: Sample Wrapped [offset %u, sample %d]\n", + sampleOffset, sampleOutput ()); + } +# if XSID_DEBUG > 1 + printf ("XSID: Writing Sample to SID Volume [0x%02x]\n", data); +# endif +#endif // XSID_DEBUG + + writeMemByte (data); +} + +void XSID::recallSidData0x18 (void) +{ // Rev 2.0.5 (saw) - Changed to recall volume differently depending on mode + // Normally after samples volume should be restored to half volume, + // however, Galway Tunes sound horrible and seem to require setting back to + // the original volume. Setting back to the original volume for normal + // samples can have nasty pulsing effects + if (ch4.isGalway ()) + { + if (_sidSamples && !muted) + writeMemByte (sidData0x18); + } + else + setSidData0x18 (); +} + +void XSID::sampleOffsetCalc (void) +{ + // Try to determine a sensible offset between voice + // and sample volumes. + uint_least8_t lower = ch4.limit () + ch5.limit (); + uint_least8_t upper; + + // Both channels seem to be off. Keep current offset! + if (!lower) + return; + + sampleOffset = sidData0x18 & 0x0f; + + // Is possible to compensate for both channels + // set to 4 bits here, but should never happen. + if (lower > 8) + lower >>= 1; + upper = 0x0f - lower + 1; + + // Check against limits + if (sampleOffset < lower) + sampleOffset = lower; + else if (sampleOffset > upper) + sampleOffset = upper; + +#ifdef XSID_DEBUG + printf ("XSID: Sample Offset %d based on channel(s) ", sampleOffset); + if (ch4) + printf ("4 "); + if (ch5) + printf ("5"); + printf ("\n"); +#endif // XSID_DEBUG +} + +bool XSID::storeSidData0x18 (uint8_t data) +{ + sidData0x18 = data; + if (ch4 || ch5) + { // Force volume to be changed at next clock + sampleOffsetCalc (); + if (_sidSamples) + { +#if XSID_DEBUG + printf ("XSID: SID Volume Changed Externally (Corrected).\n"); +#endif + return true; + } + } + writeMemByte (sidData0x18); + return false; +} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/xsid.h b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/xsid.h new file mode 100644 index 00000000..98171d73 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/src/xsid/xsid.h @@ -0,0 +1,288 @@ +/*************************************************************************** + xsid.h - Support for Playsids Extended + Registers + ------------------- + begin : Tue Jun 20 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/*************************************************************************** + * $Log: xsid.h,v $ + * Revision 1.21 2002/09/23 19:42:52 s_a_white + * Fixed intel compiler warnings. + * + * Revision 1.20 2002/07/17 19:18:17 s_a_white + * Changed bad #if to #ifdef + * + * Revision 1.19 2002/02/21 20:26:13 s_a_white + * Nolonger default to Galway Mode when Noise samples init incorrectly. Fixes + * VARIOUS/S-Z/Zyron/Bouncy_Balls.sid (HVSC). + * + * Revision 1.18 2002/02/17 16:34:39 s_a_white + * New reset interface + * + * Revision 1.17 2001/11/16 19:22:04 s_a_white + * Removed compiler warning for unused parameter. + * + * Revision 1.16 2001/10/18 22:36:16 s_a_white + * GCC3 fixes. + * + * Revision 1.15 2001/07/14 16:48:35 s_a_white + * Sync with sidbuilder class project. + * + * Revision 1.14 2001/07/14 12:59:39 s_a_white + * XSID effeciency increased. Now uses new component classes and event + * generation. + * + * Revision 1.13 2001/04/20 22:21:06 s_a_white + * inlined updateSidData0x18. + * + * Revision 1.12 2001/03/25 19:51:23 s_a_white + * Performance update. + * + * Revision 1.11 2001/03/19 23:40:46 s_a_white + * Better support for global debug. + * + * Revision 1.10 2001/03/09 22:27:13 s_a_white + * Speed optimisation update. + * + * Revision 1.9 2001/03/01 23:45:58 s_a_white + * Combined both through sid and non-through sid modes. Can be selected + * at runtime now. + * + * Revision 1.8 2001/02/21 21:46:34 s_a_white + * 0x1d = 0 now fixed. Limit checking on sid volume. This helps us determine + * even better what the sample offset should be (fixes Skate and Die). + * + * Revision 1.7 2001/02/07 21:02:30 s_a_white + * Supported for delaying samples for frame simulation. New alogarithm to + * better guess original tunes volume when playing samples. + * + * Revision 1.6 2000/12/12 22:51:01 s_a_white + * Bug Fix #122033. + * + ***************************************************************************/ + +/* +Effectively there is only 1 channel, which can either perform Galway Noise +or Sampling. However, to achieve all the effects on a C64, 2 sampling +channels are required. No divide by 2 is required and is compensated for +automatically in the C64 machine code. + +Confirmed by Warren Pilkington using the tune Turbo Outrun: +A new sample must interrupt an existing sample running on the same channel. + +Confirmed by Michael Schwendt and Antonia Vera using the tune Game Over: +A Galway Sample or Noise sequence cannot interrupt any other. However +the last of these new requested sequences will be played after the current +sequence ends. + +Lastly playing samples through the SIDs volume is not as clean as playing +them on their own channel. Playing through the SID will effect the volume +of the other channels and this will be most noticable at low frequencies. +These effects are however present in the original SID music. + +Some SIDs put values directly into the volume register. Others play samples +with respect to the current volume. We can't for definate know which the author +has chosen originally. We must just make a guess based on what the volume +is initially at the start of a sample sequence and from the details xSID has been +programmed with. +*/ + +#ifndef _xsid_h_ +#define _xsid_h_ + +#include "config.h" +#include "sidbuilder.h" +#include "event.h" + +// XSID configuration settings +//#define XSID_DEBUG 1 + +// Support global debug option +#ifdef DEBUG +# ifndef XSID_DEBUG +# define XSID_DEBUG DEBUG +# endif +#endif + +#ifdef XSID_DEBUG +# include <stdio.h> +#endif + +class XSID; +class channel +{ +private: + // General + const char * const m_name; + EventContext &m_context; + XSID &m_xsid; + friend class XSID; + + class SampleEvent: public Event + { + private: + channel &m_ch; + void event (void) { m_ch.sampleClock (); } + + public: + SampleEvent (channel *ch) + :Event("xSID Sample"), + m_ch(*ch) {} + } sampleEvent; + friend class SampleEvent; + + class GalwayEvent: public Event + { + private: + channel &m_ch; + void event (void) { m_ch.galwayClock (); } + + public: + GalwayEvent (channel *ch) + :Event("xSID Galway"), + m_ch(*ch) {} + } galwayEvent; + friend class GalwayEvent; + + uint8_t reg[0x10]; + enum {FM_NONE = 0, FM_HUELS, FM_GALWAY} mode; + bool active; + uint_least16_t address; + uint_least16_t cycleCount; // Counts to zero and triggers! + uint_least8_t volShift; + uint_least8_t sampleLimit; + int8_t sample; + + // Sample Section + uint_least8_t samRepeat; + uint_least8_t samScale; + enum {SO_LOWHIGH = 0, SO_HIGHLOW = 1}; + uint_least8_t samOrder; + uint_least8_t samNibble; + uint_least16_t samEndAddr; + uint_least16_t samRepeatAddr; + uint_least16_t samPeriod; + + // Galway Section + uint_least8_t galTones; + uint_least8_t galInitLength; + uint_least8_t galLength; + uint_least8_t galVolume; + uint_least8_t galLoopWait; + uint_least8_t galNullWait; + + // For Debugging + event_clock_t cycles; + event_clock_t outputs; + +private: + channel (const char * const name, EventContext *context, XSID *xsid); + void free (void); + void silence (void); + void sampleInit (void); + void sampleClock (void); + void galwayInit (void); + void galwayClock (void); + + // Compress address to not leave so many spaces + uint_least8_t convertAddr(uint_least8_t addr) + { return (((addr) & 0x3) | ((addr) >> 3) & 0x0c); } + + void reset (void); + uint8_t read (uint_least8_t addr) + { return reg[convertAddr (addr)]; } + void write (uint_least8_t addr, uint8_t data) + { reg[convertAddr (addr)] = data; } + int8_t output (void); + bool isGalway (void) + { return mode == FM_GALWAY; } + + uint_least8_t limit (void) + { return sampleLimit; } + + inline void checkForInit (void); + inline int8_t sampleCalculate (void); + inline void galwayTonePeriod (void); + + // Used to indicate if channel is running + operator bool() const { return (active); } +}; + + +class XSID: public sidemu, private Event +{ + friend class channel; + +private: + channel ch4; + channel ch5; + bool muted; + bool suppressed; + static const char *credit; + + uint8_t sidData0x18; + bool _sidSamples; + int8_t sampleOffset; + static const int8_t sampleConvertTable[16]; + bool wasRunning; + +private: + void event (void); + void checkForInit (channel *ch); + inline void setSidData0x18 (void); + inline void recallSidData0x18 (void); + int8_t sampleOutput (void); + void sampleOffsetCalc (void); + virtual uint8_t readMemByte (uint_least16_t addr) = 0; + virtual void writeMemByte (uint8_t data) = 0; + +public: + XSID (EventContext *context); + + // Standard calls + void reset () { sidemu::reset (); } + void reset (uint8_t); + uint8_t read (uint_least8_t) { return 0; } + void write (uint_least8_t, uint8_t) { ; } + const char *credits (void) {return credit;} + + // Specialist calls + uint8_t read (uint_least16_t) { return 0; } + void write (uint_least16_t addr, uint8_t data); + int_least32_t output (uint_least8_t bits = 16); + void mute (bool enable); + bool isMuted (void) { return muted; } + void suppress (bool enable); + + void sidSamples (bool enable) + { _sidSamples = enable; } + // Return whether we care it was changed. + bool storeSidData0x18 (uint8_t data); +}; + + +/*************************************************************************** + * Inline functions + **************************************************************************/ + +inline int_least32_t XSID::output (uint_least8_t bits) +{ + int_least32_t sample; + if (_sidSamples || muted) + return 0; + sample = sampleConvertTable[sampleOutput () + 8]; + return sample << (bits - 8); +} + +#endif // _xsid_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/Makefile.am b/sid/sidplay-libs-2.1.0/libsidplay/unix/Makefile.am new file mode 100644 index 00000000..804c3d38 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/Makefile.am @@ -0,0 +1,8 @@ +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libsidplay2.pc + +sidplayincludedir = $(includedir)/sidplay +sidplayinclude_HEADERS = sidconfig.h sidint.h + +EXTRA_DIST=libsidplay2.spec ac_compile_check_sizeof.m4 ac_create_stdint_h.m4 \ +my_macros.m4 diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/Makefile.in b/sid/sidplay-libs-2.1.0/libsidplay/unix/Makefile.in new file mode 100644 index 00000000..6102c2f7 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/Makefile.in @@ -0,0 +1,411 @@ +# Makefile.in generated by automake 1.7.1 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +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 = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBVERSION = @LIBVERSION@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SID_HAVE_BOOL = @SID_HAVE_BOOL@ +SID_HAVE_STDBOOL_H = @SID_HAVE_STDBOOL_H@ +SID_SIZEOF_CHAR = @SID_SIZEOF_CHAR@ +SID_SIZEOF_INT = @SID_SIZEOF_INT@ +SID_SIZEOF_LONG_INT = @SID_SIZEOF_LONG_INT@ +SID_SIZEOF_SHORT_INT = @SID_SIZEOF_SHORT_INT@ +SID_WORDS_ENDIANESS = @SID_WORDS_ENDIANESS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builders = @builders@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libsidplay2.pc + +sidplayincludedir = $(includedir)/sidplay +sidplayinclude_HEADERS = sidconfig.h sidint.h + +EXTRA_DIST = libsidplay2.spec ac_compile_check_sizeof.m4 ac_create_stdint_h.m4 \ +my_macros.m4 + +subdir = unix +mkinstalldirs = $(SHELL) $(top_srcdir)/unix/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = libsidplay2.spec libsidplay2.pc sidconfig.h +DIST_SOURCES = +DATA = $(pkgconfig_DATA) + +HEADERS = $(sidplayinclude_HEADERS) + +DIST_COMMON = $(sidplayinclude_HEADERS) Makefile.am Makefile.in \ + config.guess config.h.in config.sub depcomp install-sh \ + libsidplay2.pc.in libsidplay2.spec.in ltmain.sh missing \ + mkinstalldirs sidconfig.h.in +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu unix/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status unix/config.h + +$(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + touch $(srcdir)/config.h.in + +distclean-hdr: + -rm -f config.h stamp-h1 +libsidplay2.spec: $(top_builddir)/config.status libsidplay2.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +libsidplay2.pc: $(top_builddir)/config.status libsidplay2.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +sidconfig.h: $(top_builddir)/config.status sidconfig.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(pkgconfigDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f"; \ + $(pkgconfigDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(pkgconfigdir)/$$f"; \ + rm -f $(DESTDIR)$(pkgconfigdir)/$$f; \ + done +sidplayincludeHEADERS_INSTALL = $(INSTALL_HEADER) +install-sidplayincludeHEADERS: $(sidplayinclude_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sidplayincludedir) + @list='$(sidplayinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(sidplayincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(sidplayincludedir)/$$f"; \ + $(sidplayincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(sidplayincludedir)/$$f; \ + done + +uninstall-sidplayincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(sidplayinclude_HEADERS)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(sidplayincludedir)/$$f"; \ + rm -f $(DESTDIR)$(sidplayincludedir)/$$f; \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) $(HEADERS) config.h + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(sidplayincludedir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-pkgconfigDATA install-sidplayincludeHEADERS + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkgconfigDATA \ + uninstall-sidplayincludeHEADERS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-pkgconfigDATA install-sidplayincludeHEADERS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-pkgconfigDATA uninstall-sidplayincludeHEADERS + +# 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/sid/sidplay-libs-2.1.0/libsidplay/unix/ac_compile_check_sizeof.m4 b/sid/sidplay-libs-2.1.0/libsidplay/unix/ac_compile_check_sizeof.m4 new file mode 100644 index 00000000..8ada30a5 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/ac_compile_check_sizeof.m4 @@ -0,0 +1,76 @@ +dnl @synopsis AC_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]]) +dnl +dnl This macro checks for the size of TYPE using compile checks, not +dnl run checks. You can supply extra HEADERS to look into. the check +dnl will cycle through 1 2 4 8 16 and any EXTRA_SIZES the user +dnl supplies. If a match is found, it will #define SIZEOF_`TYPE' to +dnl that value. Otherwise it will emit a configure time error +dnl indicating the size of the type could not be determined. +dnl +dnl The trick is that C will not allow duplicate case labels. While +dnl this is valid C code: +dnl +dnl switch (0) case 0: case 1:; +dnl +dnl The following is not: +dnl +dnl switch (0) case 0: case 0:; +dnl +dnl Thus, the AC_TRY_COMPILE will fail if the currently tried size +dnl does not match. +dnl +dnl Here is an example skeleton configure.in script, demonstrating the +dnl macro's usage: +dnl +dnl AC_PROG_CC +dnl AC_CHECK_HEADERS(stddef.h unistd.h) +dnl AC_TYPE_SIZE_T +dnl AC_CHECK_TYPE(ssize_t, int) +dnl +dnl headers='#ifdef HAVE_STDDEF_H +dnl #include <stddef.h> +dnl #endif +dnl #ifdef HAVE_UNISTD_H +dnl #include <unistd.h> +dnl #endif +dnl ' +dnl +dnl AC_COMPILE_CHECK_SIZEOF(char) +dnl AC_COMPILE_CHECK_SIZEOF(short) +dnl AC_COMPILE_CHECK_SIZEOF(int) +dnl AC_COMPILE_CHECK_SIZEOF(long) +dnl AC_COMPILE_CHECK_SIZEOF(unsigned char *) +dnl AC_COMPILE_CHECK_SIZEOF(void *) +dnl AC_COMPILE_CHECK_SIZEOF(size_t, $headers) +dnl AC_COMPILE_CHECK_SIZEOF(ssize_t, $headers) +dnl AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers) +dnl AC_COMPILE_CHECK_SIZEOF(off_t, $headers) +dnl +dnl @author Kaveh Ghazi <ghazi@caip.rutgers.edu> +dnl @version $Id: ac_compile_check_sizeof.m4,v 1.1 2002/01/03 20:13:11 s_a_white Exp $ +dnl +AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], +[changequote(<<, >>)dnl +dnl The name to #define. +define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl +changequote([, ])dnl +AC_MSG_CHECKING(size of $1) +AC_CACHE_VAL(AC_CV_NAME, +[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence. + AC_TRY_COMPILE([#include "confdefs.h" +#include <sys/types.h> +$2 +], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) + if test x$AC_CV_NAME != x ; then break; fi +done +]) +if test x$AC_CV_NAME = x ; then + AC_MSG_ERROR([cannot determine a size for $1]) +fi +AC_MSG_RESULT($AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +]) diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/ac_create_stdint_h.m4 b/sid/sidplay-libs-2.1.0/libsidplay/unix/ac_create_stdint_h.m4 new file mode 100644 index 00000000..0e807324 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/ac_create_stdint_h.m4 @@ -0,0 +1,501 @@ +dnl AC_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] -*- sh -*- +dnl +dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the +dnl existence of an include file <stdint.h> that defines a set of +dnl typedefs, especially uint8_t,int32_t,uintptr_t. +dnl Many older installations will not provide this file, but some will +dnl have the very same definitions in <inttypes.h>. In other enviroments +dnl we can use the inet-types in <sys/types.h> which would define the +dnl typedefs int8_t and u_int8_t respectivly. +dnl +dnl This macros will create a local "_stdint.h" or the headerfile given as +dnl an argument. In many cases that file will just have a singular +dnl "#include <stdint.h>" or "#include <inttypes.h>" statement, while +dnl in other environments it will provide the set of basic 'stdint's defined: +dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t +dnl int_least32_t.. int_fast32_t.. intmax_t +dnl which may or may not rely on the definitions of other files, +dnl or using the AC_COMPILE_CHECK_SIZEOF macro to determine the actual +dnl sizeof each type. +dnl +dnl if your header files require the stdint-types you will want to create an +dnl installable file mylib-int.h that all your other installable header +dnl may include. So if you have a library package named "mylib", just use +dnl AC_CREATE_STDINT_H(mylib-int.h) +dnl in configure.in and go to install that very header file in Makefile.am +dnl along with the other headers (mylib.h) - and the mylib-specific headers +dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types. +dnl +dnl Remember, if the system already had a valid <stdint.h>, the generated +dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... +dnl +dnl (this file is part of the http://ac-archive.sf.net/gstdint project) +dnl @version $Id: ac_create_stdint_h.m4,v 1.2 2002/02/17 00:08:45 s_a_white Exp $ +dnl @author Guido Draheim <guidod@gmx.de> STATUS: used on new platforms + +AC_DEFUN([AC_CREATE_STDINT_H], +[# ------ AC CREATE STDINT H ------------------------------------- +AC_MSG_CHECKING([for stdint-types....]) +ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` +if test "$ac_stdint_h" = "stdint.h" ; then + AC_MSG_RESULT("(are you sure you want them in ./stdint.h?)") +elif test "$ac_stdint_h" = "inttypes.h" ; then + AC_MSG_RESULT("(are you sure you want them in ./inttypes.h?)") +else + AC_MSG_RESULT("(putting them into $ac_stdint_h)") +fi + +inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h $2 \ +| sed -e 's/,/ /g'` + + ac_cv_header_stdint_x="no-file" + ac_cv_header_stdint_o="no-file" + ac_cv_header_stdint_u="no-file" + for i in stdint.h $inttype_headers ; do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>]) + AC_MSG_RESULT(... seen our uintptr_t in $i $and64) + break; + done + if test "$ac_cv_header_stdint_x" = "no-file" ; then + for i in stdint.h $inttype_headers ; do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>]) + AC_MSG_RESULT(... seen our uint32_t in $i $and64) + break; + done + if test "$ac_cv_header_stdint_o" = "no-file" ; then + for i in sys/types.h $inttype_headers ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl + continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="(u_int64_t too)"],[and64=""],[#include<$i>]) + AC_MSG_RESULT(... seen our u_int32_t in $i $and64) + break; + done + fi + fi + +# ----------------- DONE inttypes.h checks MAYBE C basic types -------- + +if test "$ac_cv_header_stdint_x" = "no-file" ; then + AC_COMPILE_CHECK_SIZEOF(char) + AC_COMPILE_CHECK_SIZEOF(short) + AC_COMPILE_CHECK_SIZEOF(int) + AC_COMPILE_CHECK_SIZEOF(long) + AC_COMPILE_CHECK_SIZEOF(void*) + ac_cv_header_stdint_test="yes" +else + ac_cv_header_stdint_test="no" +fi + +# ----------------- DONE inttypes.h checks START header ------------- +_ac_stdint_h=AS_TR_CPP(_$ac_stdint_h) +AC_MSG_RESULT(creating $ac_stdint_h : $_ac_stdint_h) +echo "#ifndef" $_ac_stdint_h >$ac_stdint_h +echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h +if test "$GCC" = "yes" ; then + echo "/* generated using a gnu compiler version" `$CC --version` "*/" \ + >>$ac_stdint_h +else + echo "/* generated using $CC */" >>$ac_stdint_h +fi +echo "" >>$ac_stdint_h + +if test "$ac_cv_header_stdint_x" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "$ac_cv_header_stdint_o" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "$ac_cv_header_stdint_u" != "no-file" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +# ----------------- See if int_least and int_fast types are present +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) +AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) + +if test "$ac_cv_header_stdint" != "stddef.h" ; then +if test "$ac_cv_header_stdint" != "stdint.h" ; then +AC_MSG_RESULT(..adding include stddef.h) + echo "#include <stddef.h>" >>$ac_stdint_h +fi ; fi +AC_MSG_RESULT(..adding include $ac_cv_header_stdint) + echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h +echo "" >>$ac_stdint_h + +# ----------------- DONE header START basic int types ------------- +if test "$ac_cv_header_stdint_x" = "no-file" ; then + AC_MSG_RESULT(... need to look at C basic types) +dnl ac_cv_header_stdint_test="yes" # moved up before creating the file +else + AC_MSG_RESULT(... seen good stdint.h inttypes) +dnl ac_cv_header_stdint_test="no" # moved up before creating the file +fi + +if test "$ac_cv_header_stdint_u" != "no-file" ; then + AC_MSG_RESULT(... seen bsd/sysv typedefs) + cat >>$ac_stdint_h <<EOF + +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; +EOF + cat >>$ac_stdint_h <<EOF + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +EOF +fi + +ac_cv_sizeof_x="$ac_cv_sizeof_char:$ac_cv_sizeof_short" +ac_cv_sizeof_X="$ac_cv_sizeof_x:$ac_cv_sizeof_int" +ac_cv_sizeof_X="$ac_cv_sizeof_X:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" +if test "$ac_cv_header_stdint" = "stddef.h" ; then +# we must guess all the basic types. Apart from byte-adressable system, +# there a few 32-bit-only dsp-systems. nibble-addressable systems are way off. + cat >>$ac_stdint_h <<EOF +/* ------------ BITSPECIFIC INTTYPES SECTION --------------- */ +EOF + t="typedefs for a" + case "$ac_cv_sizeof_X" in + 1:2:2:2:4) AC_MSG_RESULT(..adding $t normal 16-bit system) + cat >>$ac_stdint_h <<EOF +/* a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +EOF +;; + 1:2:2:4:4) AC_MSG_RESULT(..adding $t 32-bit system derived from a 16-bit) + cat >>$ac_stdint_h <<EOF +/* a 32-bit system derived from a 16-bit */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:4:4) AC_MSG_RESULT(..adding $t normal 32-bit system) + cat >>$ac_stdint_h <<EOF +/* a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:4:8) AC_MSG_RESULT(..adding $t 32-bit system prepared for 64-bit) + cat >>$ac_stdint_h <<EOF + +/* a 32-bit system prepared for 64-bit */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:8:8) AC_MSG_RESULT(..adding $t normal 64-bit system) + cat >>$ac_stdint_h <<EOF + +/* a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + 1:2:4:8:4) AC_MSG_RESULT(..adding $t 64-bit system derived from a 32-bit) + cat >>$ac_stdint_h <<EOF + +/* a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +EOF +;; + *) + AC_MSG_ERROR([ $ac_cv_sizeof_X dnl + what is that a system? contact the author, quick! http://ac-archive.sf.net]) + exit 1 +;; + esac +fi + +# ------------- DONE basic int types START int64_t types ------------ +if test "$ac_cv_type_uint64_t" = "yes" +then AC_MSG_RESULT(... seen good uint64_t) + cat >>$ac_stdint_h <<EOF + +/* system headers have good uint64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#endif +EOF + +elif test "$ac_cv_type_u_int64_t" = "yes" +then AC_MSG_RESULT(..adding typedef u_int64_t uint64_t) + cat >>$ac_stdint_h <<EOF + +/* system headers have an u_int64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef u_int64_t uint64_t; +#endif +EOF +else AC_MSG_RESULT(..adding generic uint64_t runtime checks) + cat >>$ac_stdint_h <<EOF + +/* -------------------- 64 BIT GENERIC SECTION -------------------- */ +/* here are some common heuristics using compiler runtime specifics */ +#if defined __STDC_VERSION__ && defined __STDC_VERSION__ > 199901L + +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ + +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#endif + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ +dnl /* note: all ELF-systems seem to have loff-support which needs 64-bit */ + +#if !defined _NO_LONGLONG +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) + +#if !defined _NO_LONGLONG +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +#endif + /* compiler/cpu type ... or just ISO C99 */ +#endif +#endif +EOF + +# plus a default 64-bit for systems that are likely to be 64-bit ready + case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in + 1:2:8:8) AC_MSG_RESULT(..adding uint64_t default, normal 64-bit system) +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen normal 64-bit system, CC has sizeof(long and void*) == 8 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +EOF +;; + 1:2:4:8) AC_MSG_RESULT(..adding uint64_t default, typedef to long) +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen 32-bit system prepared for 64-bit, CC has sizeof(long) == 8 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long int64_t; +typedef unsigned long uint64_t; +#endif +EOF +;; + 1:2:8:4) AC_MSG_RESULT(..adding uint64_t default, typedef long long) +cat >>$ac_stdint_h <<EOF +/* DEFAULT: */ +/* seen 64-bit derived from a 32-bit, CC has sizeof(long) == 4 bytes */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif +EOF +;; + *) +cat >>$ac_stdint_h <<EOF +/* NOTE: */ +/* the configure-checks for the basic types did not make us believe */ +/* that we could add a fallback to a 'long long' typedef to int64_t */ +EOF + esac +fi + +# ------------- DONE int64_t types START intptr types ------------ +if test "$ac_cv_header_stdint_x" = "no-file" ; then + cat >>$ac_stdint_h <<EOF + +/* -------------------------- INPTR SECTION --------------------------- */ +EOF + case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp" in + 1:2:2) + a="int16_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 2 chars, hence we declare it 16-bit */ + +typedef uint16_t uintptr_t; +typedef int16_t intptr_t; +EOF +;; + 1:2:4) + a="int32_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 4 chars, hence we declare it 32-bit */ + +typedef uint32_t uintptr_t; +typedef int32_t intptr_t; +EOF +;; + 1:2:8) + a="int64_t" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) to be of 8 chars, hence we declare it 64-bit */ + +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +EOF +;; + *) + a="long" ; cat >>$ac_stdint_h <<EOF +/* we tested sizeof(void*) but got no guess, hence we declare it as if long */ + +typedef unsigned long uintptr_t; +typedef long intptr_t; +EOF +;; + esac +AC_MSG_RESULT(..adding typedef $a intptr_t) +fi + +# ------------- DONE intptr types START int_least types ------------ +if test "$ac_cv_type_int_least32_t" = "no"; then +AC_MSG_RESULT(..adding generic int_least-types) + cat >>$ac_stdint_h <<EOF + +/* --------------GENERIC INT_LEAST ------------------ */ + +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_INT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_INT64_T +typedef uint64_t uint_least64_t; +#endif +EOF +fi + +# ------------- DONE intptr types START int_least types ------------ +if test "$ac_cv_type_int_fast32_t" = "no"; then +AC_MSG_RESULT(..adding generic int_fast-types) + cat >>$ac_stdint_h <<EOF + +/* --------------GENERIC INT_FAST ------------------ */ + +typedef int8_t int_fast8_t; +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_INT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_INT64_T +typedef uint64_t uint_fast64_t; +#endif +EOF +fi + +if test "$ac_cv_header_stdint_x" = "no-file" ; then + cat >>$ac_stdint_h <<EOF + +#ifdef _HAVE_INT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long int intmax_t; +typedef unsigned long uintmax_t; +#endif +EOF +fi + +AC_MSG_RESULT(... DONE $ac_stdint_h) + cat >>$ac_stdint_h <<EOF + + /* once */ +#endif +#endif +EOF +]) + +dnl quote from SunOS-5.8 sys/inttypes.h: +dnl Use at your own risk. As of February 1996, the committee is squarely +dnl behind the fixed sized types; the "least" and "fast" types are still being +dnl discussed. The probability that the "fast" types may be removed before +dnl the standard is finalized is high enough that they are not currently +dnl implemented. + diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/config.guess b/sid/sidplay-libs-2.1.0/libsidplay/unix/config.guess new file mode 100755 index 00000000..f1657bbc --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/config.guess @@ -0,0 +1,1363 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-09-03' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 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. + +# Originally written by Per Bothner <per@bothner.com>. +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # 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. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + 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 ; +unset files' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # 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. + eval $set_cc_for_build + cat <<EOF >$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + 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 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + 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 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + 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 0 ;; + 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 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + 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 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # 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 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + 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 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + 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 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo rs6000-ibm-aix3.2.5 + 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 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + 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 i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + 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 0 ;; + 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 0 ;; + 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 0 ;; + i*86:*:5:[78]*) + 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 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + 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 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*: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) + 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 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *: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 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + 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 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *: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 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *: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 0 ;; + 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 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + ftp://ftp.gnu.org/pub/gnu/config/ + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/config.h.in b/sid/sidplay-libs-2.1.0/libsidplay/unix/config.h.in new file mode 100644 index 00000000..1f42ded5 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/config.h.in @@ -0,0 +1,107 @@ +/* unix/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if the C++ compiler supports BOOL */ +#undef HAVE_BOOL + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define if your C++ compiler implements exception-handling. */ +#undef HAVE_EXCEPTIONS + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define if standard member ``ios::binary'' is called ``ios::bin''. */ +#undef HAVE_IOS_BIN + +/* Define if ``ios::openmode'' is supported. */ +#undef HAVE_IOS_OPENMODE + +/* Define to 1 if you support file names longer than 14 characters. */ +#undef HAVE_LONG_FILE_NAMES + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the <stdbool.h> header file. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define if you have the strncasecmp function. */ +#undef HAVE_STRNCASECMP + +/* Define if you have the <strstrea.h> header file. */ +#undef HAVE_STRSTREA_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of a `char', as computed by sizeof. */ +#undef SIZEOF_CHAR + +/* The size of a `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The number of bytes in type long */ +#undef SIZEOF_LONG + +/* The size of a `long int', as computed by sizeof. */ +#undef SIZEOF_LONG_INT + +/* The number of bytes in type short */ +#undef SIZEOF_SHORT + +/* The size of a `short int', as computed by sizeof. */ +#undef SIZEOF_SHORT_INT + +/* The number of bytes in type void* */ +#undef SIZEOF_VOIDP + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/config.sub b/sid/sidplay-libs-2.1.0/libsidplay/unix/config.sub new file mode 100755 index 00000000..1dea9b79 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/config.sub @@ -0,0 +1,1470 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-09-05' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 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. + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # 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 0;; + + * ) + 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* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -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/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + 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 + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + 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 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-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-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + 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 + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + 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 + ;; + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -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*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -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 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -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 + ;; + -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 + ;; + -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 + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -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 0 + +# 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/sid/sidplay-libs-2.1.0/libsidplay/unix/depcomp b/sid/sidplay-libs-2.1.0/libsidplay/unix/depcomp new file mode 100755 index 00000000..807b991f --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/depcomp @@ -0,0 +1,423 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. + +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 +# `libtool' can also be set to `yes' or `no'. + +if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" +fi + +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. 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. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + tmpdepfile1="$dir.libs/$base.lo.d" + tmpdepfile2="$dir.libs/$base.d" + "$@" -Wc,-MD + else + tmpdepfile1="$dir$base.o.d" + tmpdepfile2="$dir$base.d" + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. We will use -o /dev/null later, + # however we can't do the remplacement now because + # `-o $object' might simply not be used + 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 + "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n '/^# [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 proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/install-sh b/sid/sidplay-libs-2.1.0/libsidplay/unix/install-sh new file mode 100755 index 00000000..11870f1b --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + : +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f "$src" ] || [ -d "$src" ] + then + : + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + : + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + : + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' + ' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + : + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + : + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# 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 $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.pc.in b/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.pc.in new file mode 100644 index 00000000..33596988 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +builders=@builders@ + +Name: @PACKAGE@ +Description: C64 cycle exact stereo sidplayer library. +Version: @VERSION@ +Libs: ${libdir}/libsidplay2.la +Cflags: -DHAVE_UNIX -I${includedir} diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.spec b/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.spec new file mode 100644 index 00000000..7f6859f4 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.spec @@ -0,0 +1,114 @@ +%define major 2 +%define oname libsidplay +%define name %{oname}%{major} +%define version 2.1.0 +%define frelease 1 +%define release %{frelease} +%define resid 0.13 +%define residbld 1.0.0 +%define builders %{_libdir}/sidplay/builders + +Summary: A Commodore 64 music player and SID chip emulator library. +Name: %{name} +Version: %{version} +Release: %{release} +Source: %{oname}-%{version}-%{frelease}.tar.bz2 +Source1: resid-%{resid}.tar.bz2 +Source2: resid-builder-%{residbld}-1.tar.bz2 +Patch: resid-%{resid}-p1.patch.bz2 +Copyright: GPL +Group: System/Libraries +URL: http://sidplay2.sourceforge.net/ +BuildRoot: %{_tmppath}/%{name}-buildroot +Prefix: %{_prefix} + +%description +This is a cycle-based version of a C64 music playing library +developed by Simon White. This library provides no internal +SID emulation. Instead a means to drive any external SID hardware or +emulation has been provided using the SID Builder Classes. + +An ReSID Builder Class using a modified version of ReSID %{resid} +is included in this package. Alternative/updated classes can be +obtained from the SIDPlay2 homepage. + +%package devel +Summary: Development headers and libraries for %{name} +Group: Development/C++ +Requires: %{name} = %{version} +Provides: %{oname}-devel = %{version} + +%description devel +This package includes the header and library files necessary +for developing applications to use %{name}. + +%prep +%setup -q -n %{oname}-%{version} -a 1 -a 2 +%patch -p0 +touch resid-%{resid}/* + +%build +%configure --with-sidbuilders=%{builders} +%make +cd resid-%{resid} +%configure --libdir=%{builders} --disable-shared +%make +cd .. +cd resid-builder-%{residbld} +%configure --with-resid=$PWD/../resid-%{resid} --libdir=%{builders} --with-sidplay2=$PWD/.. +%make +cd .. + +%install +rm -rf $RPM_BUILD_ROOT +%makeinstall +cd resid-builder-%{residbld} +%makeinstall libdir=$RPM_BUILD_ROOT%{builders} + +%clean +rm -rf $RPM_BUILD_ROOT + +%postun -p /sbin/ldconfig + +%post -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc AUTHORS COPYING ChangeLog README TODO +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root) +%doc COPYING +%{_includedir}/sidplay/* +%{_libdir}/*.la +%{_libdir}/*.a +%{_libdir}/*.so +%{_libdir}/pkgconfig/* +%{builders}/*.la +%{builders}/*.a + +%changelog +* Fri Nov 23 2001 Simon White <s_a_white@email.com> 2.1.0-1 +- New interface using sidbuilder classes. GCC3 and PSID 2NG + support. +- Merged in Mandrake spec file changes. Just set the release + define accordingly. + +* Wed Nov 7 2001 Simon White <s_a_white@email.com> 2.0.7-5 +- Performance fix. + +* Mon May 7 2001 Simon White <s_a_white@email.com> 2.0.7-4 +- Fix for endian functions under gcc 2.96. + +* Wed Apr 10 2001 Simon White <s_a_white@email.com> 2.0.7-3 +- Use non Mandrake specific release number. + +* Wed Apr 4 2001 Simon White <s_a_white@email.com> 2.0.7-2mdk +- Updated --prefix and make install so la file does not end up with + a bad install path. + +* Sun Apr 1 2001 Simon White <s_a_white@email.com> 2.0.7-1mdk +- First spec file. + +# end of file diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.spec.in b/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.spec.in new file mode 100644 index 00000000..518c9973 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/libsidplay2.spec.in @@ -0,0 +1,114 @@ +%define major 2 +%define oname @PACKAGE@ +%define name %{oname}%{major} +%define version @VERSION@ +%define frelease 1 +%define release %{frelease} +%define resid 0.13 +%define residbld 1.0.0 +%define builders %{_libdir}/sidplay/builders + +Summary: A Commodore 64 music player and SID chip emulator library. +Name: %{name} +Version: %{version} +Release: %{release} +Source: %{oname}-%{version}-%{frelease}.tar.bz2 +Source1: resid-%{resid}.tar.bz2 +Source2: resid-builder-%{residbld}-1.tar.bz2 +Patch: resid-%{resid}-p1.patch.bz2 +Copyright: GPL +Group: System/Libraries +URL: http://sidplay2.sourceforge.net/ +BuildRoot: %{_tmppath}/%{name}-buildroot +Prefix: %{_prefix} + +%description +This is a cycle-based version of a C64 music playing library +developed by Simon White. This library provides no internal +SID emulation. Instead a means to drive any external SID hardware or +emulation has been provided using the SID Builder Classes. + +An ReSID Builder Class using a modified version of ReSID %{resid} +is included in this package. Alternative/updated classes can be +obtained from the SIDPlay2 homepage. + +%package devel +Summary: Development headers and libraries for %{name} +Group: Development/C++ +Requires: %{name} = %{version} +Provides: %{oname}-devel = %{version} + +%description devel +This package includes the header and library files necessary +for developing applications to use %{name}. + +%prep +%setup -q -n %{oname}-%{version} -a 1 -a 2 +%patch -p0 +touch resid-%{resid}/* + +%build +%configure --with-sidbuilders=%{builders} +%make +cd resid-%{resid} +%configure --libdir=%{builders} --disable-shared +%make +cd .. +cd resid-builder-%{residbld} +%configure --with-resid=$PWD/../resid-%{resid} --libdir=%{builders} --with-sidplay2=$PWD/.. +%make +cd .. + +%install +rm -rf $RPM_BUILD_ROOT +%makeinstall +cd resid-builder-%{residbld} +%makeinstall libdir=$RPM_BUILD_ROOT%{builders} + +%clean +rm -rf $RPM_BUILD_ROOT + +%postun -p /sbin/ldconfig + +%post -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc AUTHORS COPYING ChangeLog README TODO +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root) +%doc COPYING +%{_includedir}/sidplay/* +%{_libdir}/*.la +%{_libdir}/*.a +%{_libdir}/*.so +%{_libdir}/pkgconfig/* +%{builders}/*.la +%{builders}/*.a + +%changelog +* Fri Nov 23 2001 Simon White <s_a_white@email.com> 2.1.0-1 +- New interface using sidbuilder classes. GCC3 and PSID 2NG + support. +- Merged in Mandrake spec file changes. Just set the release + define accordingly. + +* Wed Nov 7 2001 Simon White <s_a_white@email.com> 2.0.7-5 +- Performance fix. + +* Mon May 7 2001 Simon White <s_a_white@email.com> 2.0.7-4 +- Fix for endian functions under gcc 2.96. + +* Wed Apr 10 2001 Simon White <s_a_white@email.com> 2.0.7-3 +- Use non Mandrake specific release number. + +* Wed Apr 4 2001 Simon White <s_a_white@email.com> 2.0.7-2mdk +- Updated --prefix and make install so la file does not end up with + a bad install path. + +* Sun Apr 1 2001 Simon White <s_a_white@email.com> 2.0.7-1mdk +- First spec file. + +# end of file diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/ltmain.sh b/sid/sidplay-libs-2.1.0/libsidplay/unix/ltmain.sh new file mode 100755 index 00000000..c4538260 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/ltmain.sh @@ -0,0 +1,5482 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<EOF +$* +EOF + exit 0 +fi + +# The name of this program. +progname=`$echo "$0" | sed 's%^.*/%%'` +modename="$progname" + +# Constants. +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.4b +TIMESTAMP=" (1.970 2001/07/09 21:36:00)" + +default_mode= +help="Try \`$progname --help' for more information." +magic="%%%MAGIC variable%%%" +mkdir="mkdir" +mv="mv -f" +rm="rm -f" + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' +SP2NL='tr \040 \012' +NL2SP='tr \015\012 \040\040' + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +# We save the old values to restore during execute mode. +if test "${LC_ALL+set}" = set; then + save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL +fi +if test "${LANG+set}" = set; then + save_LANG="$LANG"; LANG=C; export LANG +fi + +if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + echo "$modename: not configured to build any kind of library" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +# Parse our command line options once, thoroughly. +while test $# -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + echo "$progname: invalid tag name: $tagname" 1>&2 + exit 1 + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" + else + echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + echo + echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001" + echo "Free Software Foundation, Inc." + echo "This is free software; see the source for copying conditions. There is NO" + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit 0 + ;; + + --config) + sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 + # Now print the configurations for the tags. + for tagname in $taglist; do + sed -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" + done + exit 0 + ;; + + --debug) + echo "$progname: enabling shell trace mode" + set -x + ;; + + --dry-run | -n) + run=: + ;; + + --features) + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + exit 0 + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --quiet | --silent) + show=: + ;; + + --tag) prevopt="--tag" prev=tag ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 +fi + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + case $nonopt in + *cc | *++ | gcc* | *-gcc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + prev= + lastarg= + srcfile="$nonopt" + suppress_output= + + user_target=no + for arg + do + case $prev in + "") ;; + xcompiler) + # Aesthetically quote the previous argument. + prev= + lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + + case $arg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + + # Accept any command-line options. + case $arg in + -o) + if test "$user_target" != "no"; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit 1 + fi + user_target=next + ;; + + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + + case $user_target in + next) + # The next one is the -o target name + user_target=yes + continue + ;; + yes) + # We got the output file + user_target=set + libobj="$arg" + continue + ;; + esac + + # Accept the current argument as the source file. + lastarg="$srcfile" + srcfile="$arg" + + # Aesthetically quote the previous argument. + + # Backslashify any backslashes, double quotes, and dollar signs. + # These are the only characters that are still specially + # interpreted inside of double-quoted scrings. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $lastarg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + done + + case $user_target in + set) + ;; + no) + # Get the name of the library object. + libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + *) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit 1 + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSfmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit 1 + ;; + esac + + # 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. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + "$CC "*) ;; + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when ltconfig was run. + "`$echo $CC` "*) ;; + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case $base_compile in + "$CC "*) + # 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 + ;; + "`$echo $CC` "*) + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + echo "$modename: unable to infer tagged configuration" + echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 +# else +# echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit 1" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit 1" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$0" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + echo $srcfile > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T <<EOF +# $libobj - a libtool object file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +EOF + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $srcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $srcfile" + fi + + if test ! -d ${xdir}$objdir; then + $show "$mkdir ${xdir}$objdir" + $run $mkdir ${xdir}$objdir + status=$? + if test $status -ne 0 && test ! -d ${xdir}$objdir; then + exit $status + fi + fi + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + $run $rm "$lobj" "$output_obj" + + $show "$command" + if $run eval "$command"; then : + else + test -n "$output_obj" && $run $rm $removelist + exit 1 + fi + + if test "$need_locks" = warn && + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <<EOF +pic_object='$objdir/$objname' + +EOF + + # Allow error messages only from the first compilation. + suppress_output=' >/dev/null 2>&1' + else + # No PIC object so indicate it doesn't exist in the libtool + # object file. + test -z "$run" && cat >> ${libobj}T <<EOF +pic_object=none + +EOF + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $srcfile" + else + command="$base_compile $srcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + $run $rm "$obj" "$output_obj" + $show "$command" + if $run eval "$command"; then : + else + $run $rm $removelist + exit 1 + fi + + if test "$need_locks" = warn && + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed + if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <<EOF +# Name of the non-PIC object. +non_pic_object='$objname' + +EOF + else + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <<EOF +# Name of the non-PIC object. +non_pic_object=none + +EOF + fi + + $run $mv "${libobj}T" "${libobj}" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + $run $rm "$lockfile" + fi + + exit 0 + ;; + + # libtool link mode + link | relink) + modename="$modename: link" + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invokation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args="$nonopt" + base_compile="$nonopt" + compile_command="$nonopt" + finalize_command="$nonopt" + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -all-static | -static) + if test "X$arg" = "X-all-static"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_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" + base_compile="$base_compile $arg" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit 1 + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit 1 + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n $prev + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit 1 + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + 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*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit 1 + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd*) + # OpenBSD uses either libc or libc_r. + continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + esac + fi + if test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # 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 + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # 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 link + # command doesn't match the default compiler. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + "$CC "*) ;; + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when ltconfig was run. + "`$echo $CC` "*) ;; + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case $base_compile in + "$CC "*) + # The compiler in $compile_command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + "`$echo $CC` "*) + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + echo "$modename: unable to infer tagged configuration" + echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 +# else +# echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d $output_objdir; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $output_objdir; then + exit $status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + *.$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 + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + libs="$libs $deplib" + done + + if test $linkmode = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + 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 link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit 1 + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test $linkmode = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test $pass = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -l*) + if test $linkmode != lib && test $linkmode != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + # Search the libtool library + lib="$searchdir/lib${name}.la" + if test -f "$lib"; then + found=yes + break + fi + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test $pass = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test $pass = scan; then + deplibs="$deplib $deplibs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test $pass = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test $pass = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + if test "$deplibs_check_method" != pass_all; then + echo + echo "*** Warning: This library needs some functionality provided by $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." + else + echo + echo "*** Warning: Linking the shared library $output against the" + echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test $pass != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test $pass = conv; then + deplibs="$deplib $deplibs" + elif test $linkmode = prog; then + if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test $found = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit 1 + fi + + # Check to see that this really is a libtool archive. + if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variable installed. + installed=yes + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test $linkmode != prog && test $linkmode != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test $pass = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + elif test $linkmode != prog && test $linkmode != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit 1 + fi + continue + fi # $pass = conv + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + + # This library was specified with -dlopen. + if test $pass = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test $pass = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test $linkmode = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + if test $linkmode = prog && test $pass != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test $linkalldeplibs = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + if test $linkmode = lib && + test $hardcode_into_libs = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`echo $soroot | sed -e 's/^.*\///'` + newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + eval cmds=\"$extract_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + eval cmds=\"$old_archive_from_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n $old_archive_from_expsyms_cmds + + if test $linkmode = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test $linkmode = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test $linkmode = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + add="-l$name" + fi + + if test $linkmode = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test $linkmode = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + echo "*** Warning: This library needs some functionality provided by $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** Therefore, libtool will create a static module, that should work " + echo "*** as long as the dlopening application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test $linkmode = lib; then + if test -n "$dependency_libs" && + { test $hardcode_into_libs != yes || test $build_old_libs = yes || + test $link_static = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + + if test $link_all_deplibs != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="-L$absdir/$objdir" + else + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="-L$absdir" + fi + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$deplibs $path" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test $pass = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test $pass != dlopen; then + if test $pass != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + done # for pass + if test $linkmode = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit 1 + else + echo + echo "*** Warning: Linking the shared library $output against the non-libtool" + echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test $# -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + current="$2" + revision="$3" + age="$4" + + # 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]) ;; + *) + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $revision in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $age in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + if test $age -gt $current; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix) + major=`expr $current - $age + 1` + verstring="sgi$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test $loop != 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="sgi$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test $loop != 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + verstring="0.0" + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` + deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` + dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test $hardcode_into_libs != yes || test $build_old_libs = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd*) + # OpenBSD uses either libc or libc_r. + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test $build_libtool_need_lc = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behaviour. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c <<EOF + int main() { return 0; } +EOF + $rm conftest + $LTCC -o conftest conftest.c $deplibs + if test $? -eq 0 ; then + ldd_output=`ldd conftest` + for i in $deplibs; do + name="`expr $i : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test "$name" != "" -a "$name" != "0"; then + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + newdeplibs="$newdeplibs $i" + fi + done + else + # Error occured in the first compile. Let's try to salvage the situation: + # Compile a seperate program for each library. + for i in $deplibs; do + name="`expr $i : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test "$name" != "" -a "$name" != "0"; then + $rm conftest + $LTCC -o conftest conftest.c $i + # Did it work? + if test $? -eq 0 ; then + ldd_output=`ldd conftest` + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + droppeddeps=yes + echo + echo "*** Warning! Library $i is needed by this library but I was not able to" + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." + fi + else + newdeplibs="$newdeplibs $i" + fi + done + fi + ;; + file_magic*) + set dummy $deplibs_check_method + file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test "$name" != "" -a "$name" != "0"; 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 + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | sed 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | sed 10q \ + | egrep "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $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." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + 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 + if eval echo \"$potent_lib\" 2>/dev/null \ + | sed 10q \ + | egrep "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $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." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | + grep . >/dev/null; then + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + echo "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test $allow_undefined = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test $hardcode_into_libs = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + 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 + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test x$dlname = x; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + eval cmds=\"$export_symbols_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + + if len=`expr "X$cmds" : ".*"` && + test $len -le $max_cmd_len || test $max_cmd_len -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$save_output-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*"` && + test $len -le $max_cmd_len; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test $k -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$save_output-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$save_output-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + # Set up a command to remove the reloadale object files + # after they are used. + i=0 + while test $i -lt $k + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~$rm $delfiles\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit 0 + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit 1 + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit 0 + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + ;; + + prog) + case $host in + *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$output.exp" + $run $rm $export_symbols + $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`echo "$arg" | sed -e 's%^.*/%%'` + $run eval 'echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit 1 + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test $need_relink = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit 0 + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="cd `pwd`; $relink_command" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $0 --fallback-echo"; then + case $0 in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; + *) qecho="$SHELL `pwd`/$0 --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`echo $output|sed 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) exeext=.exe ;; + *) exeext= ;; + esac + $rm $output + trap "$rm $output; exit 1" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit 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 >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # win32 systems need to use the prog path for dll + # lookup to work + *-*-cygwin* | *-*-pw32*) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + # Export the path to the program. + PATH=\"\$progdir:\$PATH\" + export PATH + + exec \$program \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit 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\ +" + chmod +x $output + fi + exit 0 + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$objs$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + eval cmds=\"$old_archive_from_new_cmds\" + else + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test $len -le $max_cmd_len || test $max_cmd_len -le -1; then + : + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*"` && + test $len -le $max_cmd_len; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + eval cmds=\"\$concat_cmds~$old_archive_cmds\" + fi + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test $need_relink = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit 0 + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit 1 + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test $# -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + continue + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test $# -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + eval cmds=\"$postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit 0 + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 + exit 1 + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`echo $destfile | sed -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + eval cmds=\"$old_postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $0 --finish$current_libdirs' + else + exit 0 + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + eval cmds=\"$finish_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit 0 + + 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" + echo "more information, such as the ld(1) and ld.so(8) manual pages." + echo "----------------------------------------------------------------------" + exit 0 + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit 1 + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit 1 + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved enviroment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd='"$cmd"$args' + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit 0 + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + rmdirs= + + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$objdir" + else + objdir="$dir/$objdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test $mode = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test $mode = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + + if test $mode = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + eval cmds=\"$postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + eval cmds=\"$old_postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + fi + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + # Do a test to see if this is a libtool program. + if test $mode = clean && + (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$file + + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $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 + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit 1 +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE." + exit 0 + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; +esac + +echo +$echo "Try \`$modename --help' for more information about other modes." + +exit 0 + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/missing b/sid/sidplay-libs-2.1.0/libsidplay/unix/missing new file mode 100755 index 00000000..6a37006e --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/missing @@ -0,0 +1,336 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 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. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.4 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1Help2man' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/mkinstalldirs b/sid/sidplay-libs-2.1.0/libsidplay/unix/mkinstalldirs new file mode 100755 index 00000000..e6826388 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.3 2001/09/18 18:54:01 s_a_white Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/my_macros.m4 b/sid/sidplay-libs-2.1.0/libsidplay/unix/my_macros.m4 new file mode 100644 index 00000000..bd607f73 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/my_macros.m4 @@ -0,0 +1,550 @@ +dnl ------------------------------------------------------------------------- +dnl Try to find a file (or one of more files in a list of dirs). +dnl $1=files +dnl $2=dirs to search +dnl $3=found dir +dnl [$4=found file] +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_FIND_FILE, +[ + $3=NO + for i in $2; do + for j in $1; do + if test -r "$i/$j"; then + $3=$i + if test "$4" != ""; then + $4=$j + fi + break 2 + fi + done + done +]) + + +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_SUBST_DEF, +[ + eval "$1=\"#define $1\"" + AC_SUBST($1) +]) + +AC_DEFUN(MY_SUBST_UNDEF, +[ + eval "$1=\"#undef $1\"" + AC_SUBST($1) +]) + +AC_DEFUN(MY_SUBST, +[ + eval "$1=$2" + AC_SUBST($1) +]) + + + + + +dnl ------------------------------------------------------------------------- +dnl Check whether compiler has a working ``bool'' type. +dnl Will substitute @HAVE_BOOL@ with either a def or undef line. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_BOOL, +[ + AC_MSG_CHECKING([for bool]) + AC_CACHE_VAL(test_cv_have_bool, + [ + AC_TRY_COMPILE( + [], + [bool aBool = true;], + [test_cv_have_bool=yes], + [test_cv_have_bool=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_bool) + if test "$test_cv_have_bool" = yes; then + AC_DEFINE(HAVE_BOOL,,[Define if the C++ compiler supports BOOL]) + fi +]) + +dnl ------------------------------------------------------------------------- +dnl Check whether C++ library has member ios::bin instead of ios::binary. +dnl Will substitute @HAVE_IOS_BIN@ with either a def or undef line. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_IOS_BIN, +[ + AC_MSG_CHECKING([whether standard member ios::binary is available]) + AC_CACHE_VAL(test_cv_have_ios_binary, + [ + AC_TRY_COMPILE( + [#include <fstream.h>], + [ifstream myTest(ios::in|ios::binary);], + [test_cv_have_ios_binary=yes], + [test_cv_have_ios_binary=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_ios_binary) + if test "$test_cv_have_ios_binary" = yes; then + AC_DEFINE(HAVE_IOS_BIN,, + [Define if standard member ``ios::binary'' is called ``ios::bin''.] + ) + fi +]) + +dnl ------------------------------------------------------------------------- +dnl Check whether C++ library has member ios::bin instead of ios::binary. +dnl Will substitute @HAVE_IOS_OPENMODE@ with either a def or undef line. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_IOS_OPENMODE, +[ + AC_MSG_CHECKING([whether standard member ios::openmode is available]) + AC_CACHE_VAL(test_cv_have_ios_openmode, + [ + AC_TRY_COMPILE( + [#include <fstream.h> + #include <iomanip.h>], + [ios::openmode myTest = ios::in;], + [test_cv_have_ios_openmode=yes], + [test_cv_have_ios_openmode=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_ios_openmode) + if test "$test_cv_have_ios_openmode" = yes; then + AC_DEFINE(HAVE_IOS_OPENMODE,, + [Define if ``ios::openmode'' is supported.] + ) + fi +]) + +dnl ------------------------------------------------------------------------- +dnl Check whether C++ environment provides the "nothrow allocator". +dnl Will substitute @HAVE_EXCEPTIONS@ if test code compiles. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CHECK_EXCEPTIONS, +[ + AC_MSG_CHECKING([whether exceptions are available]) + AC_CACHE_VAL(test_cv_have_exceptions, + [ + AC_TRY_COMPILE( + [#include <new.h>], + [char* buf = new(nothrow) char[1024];], + [test_cv_have_exceptions=yes], + [test_cv_have_exceptions=no] + ) + ]) + AC_MSG_RESULT($test_cv_have_exceptions) + if test "$test_cv_have_exceptions" = yes; then + AC_DEFINE(HAVE_EXCEPTIONS,, + [Define if your C++ compiler implements exception-handling.] + ) + fi +]) + + +dnl ------------------------------------------------------------------------- +dnl Pass C++ compiler options to libtool which supports C only. +dnl ------------------------------------------------------------------------- + +AC_DEFUN(MY_CONFIG_LIBTOOL, +[ + my_save_cc=$CC + my_save_cflags=$CFLAGS + CC=$CXX + CFLAGS=$CXXFLAGS + AM_PROG_LIBTOOL + CC=$my_save_cc + CFLAGS=$my_save_cflags +]) + + +dnl ------------------------------------------------------------------------- +dnl Library compile test using libtool +dnl $1 = CXXFLAGS +dnl $2 = LDFLAGS +dnl $3 = include header +dnl $4 = program to compile +dnl $5 = variable name to store result +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_TRY_COMPILE, +[ + my_save_cxxflags=$CXXFLAGS + my_save_ldflags=$LDFLAGS + my_save_cxx=$CXX + + CXXFLAGS="$CXXFLAGS $1" + LDFLAGS="$LDFLAGS $2" + CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX" + + AC_TRY_LINK( + [#include <$3>], + [$4;], + [$5=YES], + [$5=NO] + ) + + CXXFLAGS=$my_save_cxxflags + LDFLAGS=$my_save_ldflags + CXX=$my_save_cxx +]) + + +dnl ------------------------------------------------------------------------- +dnl Expand prefix variable and others relying on it +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_EXPAND_PREFIX, +[ + # Expand prefix/exec_prefix + my_save_prefix="$prefix" + my_save_exec_prefix="$exec_prefix" + test "x$prefix" = xNONE && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix=$prefix + my_def_prefix=$prefix + my_def_exec_prefix=$exec_prefix + eval my_def_includedir=$includedir + eval my_def_libdir=$libdir + # Restore old prefix + prefix="$my_save_prefix" + exec_prefix="$my_save_exec_prefix" +]) + + +dnl ------------------------------------------------------------------------- +dnl Find pkg-config on the system +dnl Returns path to program in variable PKG_CONFIG +dnl Modifies PKG_CONFIG_PATH to contain default install prefix +dnl $1 - Version +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_CONFIG_PKG_CONFIG, +[ + dnl Find pkg-config + AC_PATH_PROG(PKG_CONFIG, pkg-config, NO) + if test "$PKG_CONFIG" = NO; then + AC_MSG_ERROR([ +pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/ + ]) + fi + + if ! pkg-config --atleast-pkgconfig-version $1 ; then + AC_MSG_ERROR([ +pkg-config too old; version $1 or better required + ]) + fi + + if test "$my_def_prefix" = ""; then + MY_EXPAND_PREFIX + fi + + # Now add libdir to the pkgconfig search path using + # expanded prefix + PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$my_def_libdir/pkgconfig" + export PKG_CONFIG_PATH + my_save_pkg_config_path="$PKG_CONFIG_PATH" +]) + + +dnl ------------------------------------------------------------------------- +dnl Find library on the system using pkgconfig. You will automatically +dnl get LDFLAGS & CXXFLAGS using modified include and library paths if +dnl necessary. Other variables will be obtained with the original intended +dnl install paths. Results in uppercase output variables $library_$variable. +dnl $1 - library +dnl $2 - version +dnl $3 - variables +dnl $4 - library header +dnl $5 - program body +dnl [$6 - used header] +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_FIND_PKG_CONFIG_LIB, +[ + dnl Check if pkg-config is configured + if test "$PKG_CONFIG" = ""; then + MY_CONFIG_PKG_CONFIG(0.5) + fi + + AC_MSG_CHECKING([for working $1 library and headers]) + + dnl Be pessimistic. + my_includedir=NO + my_libdir=NO + my_uname=LIB`echo $1 | tr [a-z] [A-Z]` + + AC_ARG_WITH($1, + [ --with-$1=DIR + where the $1 is located], + [my_includedir="$withval" + my_libdir="$withval"] + ) + + AC_ARG_WITH($1-includes, + [ --with-$1-includes=DIR + where the $1 includes are located], + [my_includedir="$withval"] + ) + + AC_ARG_WITH($1-library, + [ --with-$1-library=DIR + where the $1 library is installed], + [my_libdir="$withval"] + ) + + # Find paths to headers & package config. + if test "$my_includedir" != NO; then + my_dirs="$my_includedir $my_includedir/include" + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + else + my_dirs=`$PKG_CONFIG --variable=includedir lib$1` + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + fi + + dnl find libs + if test "$my_libdir" != NO; then + my_dirs="$my_libdir $my_libdir/lib $my_libdir/src" + MY_FIND_FILE(lib$1.la,$my_dirs,my_libdir) + if test "$my_libdir" = NO; then + AC_MSG_ERROR([ +Unable to locate lib$1 library in: + $my_dirs +Please check your installation! + ]) + fi + PKG_CONFIG_PATH="$my_libdir:$my_libdir/pkgconfig:$my_libdir/../unix" + export PKG_CONFIG_PATH + else + my_libdir=`$PKG_CONFIG --variable=libdir lib$1` + fi + + dnl See if pkg-config locates the library + if $PKG_CONFIG --atleast-version=$2 lib$1; then + : + else + AC_MSG_ERROR([ +pkg-config couldn't locate lib$1 $2 in: + $PKG_CONFIG_PATH +Please check your installation! + ]) + fi + + dnl Get cflags and ldflags seperatly + my_cxxflags=`$PKG_CONFIG --define-variable=includedir=$my_includedir --cflags lib$1` + my_ldflags=`$PKG_CONFIG --define-variable=libdir=$my_libdir --libs lib$1` + eval ${my_uname}_CXXFLAGS=\"$my_cxxflags\" + eval ${my_uname}_LDFLAGS=\"$my_ldflags\" + + if test "$3" != ""; then + my_vars="$3" + for my_var in $my_vars; do + my_out=${my_uname}_`echo $my_var | tr [a-z] [A-Z]` + eval $my_out=\`$PKG_CONFIG --variable=$my_var lib$1\` + done + fi + + AC_MSG_RESULT([$my_libdir, $my_includedir]) + + dnl Check if found library works + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$my_header,$5,my_works) + if test "$my_works" = NO; then + AC_MSG_ERROR([ +$1 build test failed with found library and header files. +Please check your installation! + ]) + fi + + dnl Optional parameter - return used header + if test "$6" != ""; then + $6=$my_header + fi + + dnl Restore path for next library + PKG_CONFIG_PATH=$my_save_pkg_config_path + export PKG_CONFIG_PATH +]) + + +dnl ------------------------------------------------------------------------- +dnl Find library on the system. You will automatically LDFLAGS & CXXFLAGS. +dnl Results in uppercase output variables $library_$variable. +dnl $1 - library +dnl $2 - additional include paths +dnl $3 - additional library paths +dnl $4 - library header +dnl $5 - program body +dnl [$6 - used header] +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_FIND_LIB, +[ + AC_MSG_CHECKING([for working $1 library and headers]) + + if test "$my_def_prefix" = ""; then + MY_EXPAND_PREFIX + fi + + dnl Be pessimistic. + my_libdir="" + my_includedir="" + my_uname=LIB`echo $1 | tr [a-z] [A-Z]` + + AC_ARG_WITH($1, + [ --with-$1=DIR + where the $1 is located], + [my_includedir="$withval" + my_libdir="$withval" + ] + ) + + AC_ARG_WITH($1-includes, + [ --with-$1-includes=DIR + where the $1 includes are located], + [my_includedir="$withval"] + ) + + AC_ARG_WITH($1-library, + [ --with-$1-library=DIR + where the $1 library is installed], + [my_libdir="$withval"] + ) + + # Test compilation with library and headers in standard path. + my_ldflags="-l$1" + my_cxxflags="" + my_works=NO + + # Use library path given by user (if any). + if test "$my_libdir" != ""; then + my_dirs="$my_libdir $my_libdir/lib $my_libdir/src" + MY_FIND_FILE(lib$1.la,$my_dirs,my_libdir) + my_ldflags="$my_libdir/lib$1.la" + fi + + if test "$my_libdir" != NO; then + # Use include path given by user (if any). + if test "$my_includedir" != ""; then + my_dirs="$my_includedir $my_includedir/include" + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + if test "$my_includedir" != NO; then + my_cxxflags="-I$my_includedir" + # Run test compilation. + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$my_header,$5,my_works) + fi + else + # Header files are on the system so run compile tests until + # we find the correct one + for i in $4; do + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$i,$5,my_works) + if test "$my_works" != NO; then + my_header="$i" + break + fi + done + fi + fi + + if test "$my_works" = NO; then + # Test compilation failed. + # Need to search for library and headers + # Search common locations where header files might be stored. + my_dirs="$2 $my_def_includedir $my_def_prefix/include \ + /usr/include /usr/local/include /usr/lib/$1/include \ + /usr/local/lib/$1/include" + MY_FIND_FILE($4,$my_dirs,my_includedir,my_header) + my_cxxflags="-I$my_includedir" + + # Search common locations where library might be stored. + my_dirs="$3 $my_def_libdir $my_def_prefix/lib \ + /usr/lib /usr/local/lib /usr/lib/$1/lib /usr/local/lib/$1/lib" + MY_FIND_FILE(lib$1.la,$my_dirs,my_libdir) + my_ldflags="$my_libdir/lib$1.la" + + if test "$my_includedir" != NO && test "$my_libdir" != NO; then + # Test compilation with found paths. + MY_TRY_COMPILE($my_cxxflags,$my_ldflags,$my_header,$5,my_works) + fi + + AC_MSG_RESULT([library $my_libdir, headers $my_includedir]) + if test "$my_works" = NO; then + AC_MSG_ERROR([ +$1 build test failed with found library and header files. +Please check your installation! + ]) + fi + else + AC_MSG_RESULT(yes) + fi + + eval ${my_uname}_CXXFLAGS=\"$my_cxxflags\" + eval ${my_uname}_LDFLAGS=\"$my_ldflags\" + + dnl Optional parameter - return used header + if test "$6" != ""; then + $6=$my_header + fi +]) + + +dnl ------------------------------------------------------------------------- +dnl Find library on the system. This is used to find libraries that are not +dnl built/installed. The include, lib path must be provided individually and it +dnl is not possible to validate the library path. +dnl $1 - library +dnl $2 - library header +dnl [$3 - used header] +dnl ------------------------------------------------------------------------- +AC_DEFUN(MY_FIND_LIB_NO_CHECK, +[ + AC_MSG_CHECKING([for $1 library and headers]) + + my_libdir="" + my_includedir="" + my_uname=LIB`echo $1 | tr [a-z] [A-Z]` + + AC_ARG_WITH($1-includes, + [ --with-$1-includes=DIR + where the $1 includes are located], + [my_includedir="$withval"] + ) + + AC_ARG_WITH($1-library, + [ --with-$1-library=DIR + where the $1 library is installed], + [my_libdir="$withval"] + ) + + dnl Both paths must be provided + if test "$my_libdir" = ""; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ +$1 library path not supplied! + ]) + fi + + if test "$my_includedir" = ""; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ +$1 include path not supplied! + ]) + fi + + dnl Check the include path + my_dirs="$my_includedir" + MY_FIND_FILE($2,$my_dirs,my_includedir,my_header) + + if test "$my_includedir" = NO; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([ +$1 headers not found! + ]) + fi + + AC_MSG_RESULT(yes) + eval ${my_uname}_CXXFLAGS=\"-I$my_includedir\" + eval ${my_uname}_LDFLAGS=\"$my_libdir/lib$1.la\" + + dnl Optional parameter - return used header + if test "$3" != ""; then + $3=$my_header + fi +]) diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/sidconfig.h b/sid/sidplay-libs-2.1.0/libsidplay/unix/sidconfig.h new file mode 100644 index 00000000..6a111853 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/sidconfig.h @@ -0,0 +1,51 @@ +/* sidconfig.h (template) */ +#ifndef _sidconfig_h_ +#define _sidconfig_h_ + +/* Define the sizeof of types in bytes */ +#define SID_SIZEOF_CHAR 1 +#define SID_SIZEOF_SHORT_INT 2 +#define SID_SIZEOF_INT 4 +#define SID_SIZEOF_LONG_INT 4 + +/* Define SID_WORDS_BIGENDIAN if your processor stores words + with the most significant byte first (like Motorola and SPARC, + unlike Intel and VAX). */ +/* Define SID_WORDS_LITTLEENDIAN if your processor stores words + with the least significant byte first (like Intel and VAX). */ +#define SID_WORDS_LITTLEENDIAN + +/* Define if your compiler supports type "bool". + If not, a user-defined signed integral type will be used. */ +#undef SID_HAVE_BOOL + +/* Define if your compiler supports AC99 header "stdbool.h" */ +#define SID_HAVE_STDBOOL_H + +/* DLL building support on win32 hosts */ +#ifndef SID_EXTERN +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define SID_EXTERN __declspec(dllexport) +# endif +# ifdef SID_DLL_IMPORT /* define if linking with this dll */ +# define SID_EXTERN __declspec(dllimport) +# endif +# ifndef SID_EXTERN /* static linking or !_WIN32 */ +# define SID_EXTERN +# endif +#endif + +/* Namespace support */ +#define SIDPLAY2_NAMESPACE __sidplay2__ +#ifdef SIDPLAY2_NAMESPACE +# define SIDPLAY2_NAMESPACE_START \ + namespace SIDPLAY2_NAMESPACE \ + { +# define SIDPLAY2_NAMESPACE_STOP \ + } +#else +# define SIDPLAY2_NAMESPACE_START +# define SIDPLAY2_NAMESPACE_STOP +#endif + +#endif /* _sidconfig_h_ */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/sidconfig.h.in b/sid/sidplay-libs-2.1.0/libsidplay/unix/sidconfig.h.in new file mode 100644 index 00000000..b9c82441 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/sidconfig.h.in @@ -0,0 +1,51 @@ +/* sidconfig.h (template) */ +#ifndef _sidconfig_h_ +#define _sidconfig_h_ + +/* Define the sizeof of types in bytes */ +#define SID_SIZEOF_CHAR @SID_SIZEOF_CHAR@ +#define SID_SIZEOF_SHORT_INT @SID_SIZEOF_SHORT_INT@ +#define SID_SIZEOF_INT @SID_SIZEOF_INT@ +#define SID_SIZEOF_LONG_INT @SID_SIZEOF_LONG_INT@ + +/* Define SID_WORDS_BIGENDIAN if your processor stores words + with the most significant byte first (like Motorola and SPARC, + unlike Intel and VAX). */ +/* Define SID_WORDS_LITTLEENDIAN if your processor stores words + with the least significant byte first (like Intel and VAX). */ +#define @SID_WORDS_ENDIANESS@ + +/* Define if your compiler supports type "bool". + If not, a user-defined signed integral type will be used. */ +@SID_HAVE_BOOL@ + +/* Define if your compiler supports AC99 header "stdbool.h" */ +@SID_HAVE_STDBOOL_H@ + +/* DLL building support on win32 hosts */ +#ifndef SID_EXTERN +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define SID_EXTERN __declspec(dllexport) +# endif +# ifdef SID_DLL_IMPORT /* define if linking with this dll */ +# define SID_EXTERN __declspec(dllimport) +# endif +# ifndef SID_EXTERN /* static linking or !_WIN32 */ +# define SID_EXTERN +# endif +#endif + +/* Namespace support */ +#define SIDPLAY2_NAMESPACE __sidplay2__ +#ifdef SIDPLAY2_NAMESPACE +# define SIDPLAY2_NAMESPACE_START \ + namespace SIDPLAY2_NAMESPACE \ + { +# define SIDPLAY2_NAMESPACE_STOP \ + } +#else +# define SIDPLAY2_NAMESPACE_START +# define SIDPLAY2_NAMESPACE_STOP +#endif + +#endif /* _sidconfig_h_ */ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/unix/sidint.h b/sid/sidplay-libs-2.1.0/libsidplay/unix/sidint.h new file mode 100644 index 00000000..9110ca49 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/unix/sidint.h @@ -0,0 +1,17 @@ +#ifndef _UNIX_SIDINT_H +#define _UNIX_SIDINT_H 1 +#ifndef _GENERATED_STDINT_H +#define _GENERATED_STDINT_H "libsidplay 2.1.0" +/* generated using a gnu compiler version 2.96 */ + +#include <stdint.h> + + +/* system headers have good uint64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#endif + + /* once */ +#endif +#endif diff --git a/sid/sidplay-libs-2.1.0/libsidplay/win/VC/config.h b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/config.h new file mode 100644 index 00000000..553737ed --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/config.h @@ -0,0 +1,20 @@ +/* Setup for Microsoft Visual C++ Version 5 */ +#ifndef _config_h_ +#define _config_h_ + +#define PACKAGE "libsidplay" +#define VERSION "2.1.0a3" + +/* Define if your C++ compiler implements exception-handling. */ +#define HAVE_EXCEPTIONS + +/* Define if you support file names longer than 14 characters. */ +#define HAVE_LONG_FILE_NAMES + +/* Define if you have the <strstrea.h> header file. */ +#define HAVE_STRSTREA_H + +/* Define if ``ios::nocreate'' is supported. */ +//#define HAVE_IOS_NOCREATE + +#endif // _config_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/win/VC/libsidplay.dsp b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/libsidplay.dsp new file mode 100644 index 00000000..7722eb4c --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/libsidplay.dsp @@ -0,0 +1,365 @@ +# Microsoft Developer Studio Project File - Name="libsidplay" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libsidplay - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libsidplay.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libsidplay.mak" CFG="libsidplay - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libsidplay - Win32 Release" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libsidplay - Win32 Debug" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libsidplay - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../include/sidplay" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DLL_EXPORT" /D "HAVE_MSWINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"../../../binaries/Release/libsidplay2.dll" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "libsidplay - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../include" /I "../../include/sidplay" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DLL_EXPORT" /D "HAVE_MSWINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"../../../binaries/Debug/libsidplay2.dll" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "libsidplay - Win32 Release" +# Name "libsidplay - Win32 Debug" +# Begin Group "Components" + +# PROP Default_Filter "" +# Begin Group "MOS6510" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\src\mos6510\conf6510.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6510\mos6510.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6510\mos6510.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6510\cycle_based\mos6510c.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6510\cycle_based\mos6510c.i +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6510\opcodes.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6510\cycle_based\sid6510c.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6510\cycle_based\sid6510c.i +# End Source File +# End Group +# Begin Group "MOS6526" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\src\mos6526\mos6526.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos6526\mos6526.h +# End Source File +# End Group +# Begin Group "MOS656X" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\src\mos656x\mos656x.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\mos656x\mos656x.h +# End Source File +# End Group +# Begin Group "SID6526" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\src\sid6526\sid6526.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sid6526\sid6526.h +# End Source File +# End Group +# Begin Group "SidTune" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\include\sidplay\Buffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\IconInfo.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\InfoFile.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\MUS.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\PP20.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\PP20.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\PP20_Defs.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\PSID.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\SidTune.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\SidTune.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\SidTuneCfg.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\SidTuneTools.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidtune\SidTuneTools.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\SmartPtr.h +# End Source File +# End Group +# Begin Group "xSID" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\src\xsid\xsid.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\xsid\xsid.h +# End Source File +# End Group +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h" +# Begin Source File + +SOURCE=..\..\src\c64\c64cia.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\c64\c64vic.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\c64\c64xsid.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\config.h +# End Source File +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\nullsid.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\player.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\sidconfig.h +# End Source File +# End Group +# Begin Group "Header Files (Public)" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\include\sidplay\c64env.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\component.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\event.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\sid2types.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\sidbuilder.h +# End Source File +# Begin Source File + +SOURCE=.\sidconfig.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\sidendian.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidenv.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\sidplay.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\sidplay2.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\sidplay\sidtypes.h +# End Source File +# End Group +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;cc;cxx;c;i" +# Begin Source File + +SOURCE=..\..\src\config.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\event.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\mixer.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\player.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\psiddrv.a65 +# End Source File +# Begin Source File + +SOURCE=..\..\src\psiddrv.bin +# End Source File +# Begin Source File + +SOURCE=..\..\src\psiddrv.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\reloc65.c +# End Source File +# Begin Source File + +SOURCE=..\..\src\sidplay2.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/sid/sidplay-libs-2.1.0/libsidplay/win/VC/sidconfig.h b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/sidconfig.h new file mode 100644 index 00000000..024aeeac --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/sidconfig.h @@ -0,0 +1,56 @@ +/* Setup for Microsoft Visual C++ Version 5 */ +#ifndef _sidconfig_h_ +#define _sidconfig_h_ + +/* Define the sizeof of types in bytes */ +#define SID_SIZEOF_CHAR 1 +#define SID_SIZEOF_SHORT_INT 2 +#define SID_SIZEOF_INT 4 +#define SID_SIZEOF_LONG_INT 4 + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#define SID_WORDS_LITTLEENDIAN + +/* Define if your compiler supports type "bool". + If not, a user-defined signed integral type will be used. */ +#define SID_HAVE_BOOL + +/* Define if your compiler supports AC99 header "stdint.h" */ +//#define SID_HAVE_STDINT_H + +/* Define if your compiler supports AC99 header "stdbool.h" */ +//#define SID_HAVE_STDBOOL_H + +#ifdef _MSC_VER + /* Microsoft specific compiler problem */ +# define SID_HAVE_BAD_COMPILER +#endif + +/* DLL building support on win32 hosts */ +#ifndef SID_EXTERN +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define SID_EXTERN __declspec(dllexport) +# endif +# ifdef SID_DLL_IMPORT /* define if linking with this dll */ +# define SID_EXTERN __declspec(dllimport) +# endif +# ifndef SID_EXTERN /* static linking or !_WIN32 */ +# define SID_EXTERN +# endif +#endif + +/* Namespace support */ +#define SIDPLAY2_NAMESPACE __sidplay2__ +#ifdef SIDPLAY2_NAMESPACE +# define SIDPLAY2_NAMESPACE_START \ + namespace SIDPLAY2_NAMESPACE \ + { +# define SIDPLAY2_NAMESPACE_STOP \ + } +#else +# define SIDPLAY2_NAMESPACE_START +# define SIDPLAY2_NAMESPACE_STOP +#endif + +#endif // _sidconfig_h_ diff --git a/sid/sidplay-libs-2.1.0/libsidplay/win/VC/sidint.h b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/sidint.h new file mode 100644 index 00000000..b0776d16 --- /dev/null +++ b/sid/sidplay-libs-2.1.0/libsidplay/win/VC/sidint.h @@ -0,0 +1,57 @@ +/*************************************************************************** + sidint.h - AC99 types + ------------------- + begin : Mon Jul 3 2000 + copyright : (C) 2000 by Simon White + email : s_a_white@email.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +/* Setup for Microsoft Visual C++ Version 5 */ +#ifndef _sidint_h_ +#define _sidint_h_ + +#include "sidconfig.h" + +/* Wanted: Exactly 8-bit unsigned/signed (1 byte). */ +typedef signed char int8_t; +typedef unsigned char uint8_t; + +/* Small types. */ +/* Wanted: Atleast 8-bit unsigned/signed (1 byte). */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; + +/* Wanted: Atleast 16-bit unsigned/signed (2 bytes). */ +#if SID_SIZEOF_SHORT_INT >= 2 +typedef short int int_least16_t; +typedef unsigned short int uint_least16_t; +#else +typedef int int_least16_t; +typedef unsigned int uint_least16_t; +#endif /* SID_SIZEOF_SHORT_INT */ + +/* Wanted: Atleast 32-bit unsigned/signed (4 bytes). */ +#if SID_SIZEOF_INT >= 4 +typedef int int_least32_t; +typedef unsigned int uint_least32_t; +#else +typedef long int uint_least32_t; +typedef unsigned long int uint_least32_t; +#endif /* SID_SIZEOF_INT */ + +/* Wanted: Atleast 32-bits but final size is determined + * on which register size will provide best program + * performance + */ +typedef uint_least32_t uint_fast32_t; + +#endif /* _sidint_h_ */ |