commit e607c9c2ee2a1c0653f7082137d0fc712bae5b3b Author: kichikuou Date: Sat Apr 26 18:40:24 2014 +0900 Import xsystem35-1.7.3-pre5 diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..d528f9c --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,435 @@ +Notes on the Free Translation Project +************************************* + + Free software is going international! The Free Translation Project +is a way to get maintainers of free software, translators, and users all +together, so that will gradually become able to speak many languages. +A few packages already provide translations for their messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work at translations should contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +Quick configuration advice +========================== + + If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +INSTALL Matters +=============== + + Some packages are "localizable" when properly installed; the +programs they contain can be made to speak your own native language. +Most such packages use GNU `gettext'. Other packages have their own +ways to internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the GNU `gettext' own +library will be used. This library is wholly contained within this +package, usually in the `intl/' subdirectory, so prior installation of +the GNU `gettext' package is _not_ required. Installers may use +special options at configuration time for changing the default +behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will respectively bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might be not what is desirable. You +should use the more recent version of the GNU `gettext' library. I.e. +if the file `intl/VERSION' shows that the library which comes with this +package is more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages have usually many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +Using This Package +================== + + As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your country by running the command +`locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +Translating Teams +================= + + For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skill are praised more than +programming skill, here. + +Available Packages +================== + + Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of August +2002. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files be bg ca cs da de el en eo es et fi fr + +----------------------------------------+ + a2ps | [] [] [] [] | + ap-utils | | + bash | [] [] [] [] | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] [] | + clisp | | + clisp | [] [] [] [] | + clisplow | | + cpio | [] [] [] [] | + darkstat | () | + diffutils | [] [] [] [] [] [] | + enscript | [] [] | + error | [] [] [] | + fetchmail | [] () [] [] [] () | + fileutils | [] [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] [] [] | + gas | [] [] | + gawk | [] [] [] | + gcal | [] [] | + gcc | [] [] | + gettext | [] [] [] [] [] | + gnupg | [] [] [] [] [] [] [] | + gprof | [] [] | + gpsdrive | () () () () () | + grep | [] [] [] [] [] [] [] [] | + gretl | [] | + gthumb | () () () | + hello | [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] | + indent | [] [] [] [] [] | + jpilot | () [] [] [] | + jwhois | [] [] | + kbd | [] [] [] | + ld | [] [] | + libc | [] [] [] [] [] [] [] [] | + libiconv | [] [] [] [] | + lifelines | () () | + lilypond | [] [] | + lingoteach | [] [] | + lingoteach_lessons| () () | + lynx | [] [] [] [] [] | + m4 | [] [] [] [] [] | + make | [] [] [] [] | + man-db | [] () () [] () () | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] [] | + nano_1_0 | [] () [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + recode | [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] [] | + sharutils | [] [] [] [] [] [] [] | + sketch | () [] () | + soundtracker | [] [] [] | + sp | [] | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] [] [] | + textutils | [] [] [] [] [] | + util-linux | [] [] [] [] [] [] | + vorbis-tools | [] | + wastesedge | | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] [] [] | + +----------------------------------------+ + be bg ca cs da de el en eo es et fi fr + 0 2 19 10 30 44 9 1 12 44 17 6 53 + + gl he hr hu id it ja ko lv nb nl nn + +-------------------------------------+ + a2ps | () () [] | + ap-utils | | + bash | [] | + bfd | [] | + binutils | [] | + bison | [] [] [] [] | + clisp | | + clisp | [] | + clisplow | | + cpio | [] [] [] [] | + darkstat | | + diffutils | [] [] [] [] [] | + enscript | [] [] | + error | [] | + fetchmail | [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] [] [] [] | + flex | [] | + gas | | + gawk | [] | + gcal | | + gcc | [] | + gettext | [] [] | + gnupg | [] [] [] [] | + gprof | [] | + gpsdrive | [] () () | + grep | [] [] [] [] [] [] [] | + gretl | | + gthumb | () () | + hello | [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] | + indent | [] [] [] [] | + jpilot | () () | + jwhois | [] [] | + kbd | | + ld | | + libc | [] [] [] [] | + libiconv | [] [] [] | + lifelines | | + lilypond | [] | + lingoteach | [] | + lingoteach_lessons| | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + make | [] [] [] [] [] [] | + man-db | () () | + mysecretdiary | [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] | + ptx | [] [] [] [] [] | + python | | + recode | [] [] [] | + sed | [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] | + sharutils | [] [] [] | + sketch | () | + soundtracker | [] [] | + sp | | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] [] | + util-linux | () [] | + vorbis-tools | [] | + wastesedge | | + wdiff | [] [] [] | + wget | [] [] [] [] [] [] | + +-------------------------------------+ + gl he hr hu id it ja ko lv nb nl nn + 23 9 12 19 16 13 26 9 1 7 19 3 + + no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW + +----------------------------------------------+ + a2ps | () () () [] [] [] [] [] | 10 + ap-utils | () | 0 + bash | [] | 6 + bfd | [] [] | 5 + binutils | [] [] | 5 + bison | [] [] [] [] | 12 + clisp | | 0 + clisp | | 5 + clisplow | | 0 + cpio | [] [] [] [] | 12 + darkstat | [] [] () () | 2 + diffutils | [] [] [] [] [] [] | 17 + enscript | [] [] [] [] | 8 + error | [] [] [] | 7 + fetchmail | () () [] | 6 + fileutils | [] [] [] [] [] [] | 14 + findutils | [] [] [] [] [] [] [] | 21 + flex | [] [] [] | 9 + gas | [] | 3 + gawk | [] [] | 6 + gcal | [] [] | 4 + gcc | [] | 4 + gettext | [] [] [] [] [] [] | 13 + gnupg | [] [] [] | 14 + gprof | [] [] | 5 + gpsdrive | [] [] | 3 + grep | [] [] [] [] [] | 20 + gretl | | 1 + gthumb | () () [] | 1 + hello | [] [] [] [] [] [] [] | 28 + id-utils | [] [] [] [] | 9 + indent | [] [] [] [] [] | 14 + jpilot | () () [] [] | 5 + jwhois | [] () () [] [] | 7 + kbd | [] [] | 5 + ld | [] [] | 4 + libc | [] [] [] [] [] [] | 18 + libiconv | [] [] [] [] [] | 12 + lifelines | [] | 1 + lilypond | [] | 4 + lingoteach | [] [] | 5 + lingoteach_lessons| () | 0 + lynx | [] [] [] [] | 13 + m4 | [] [] [] [] | 13 + make | [] [] [] [] [] | 15 + man-db | | 3 + mysecretdiary | [] [] [] | 7 + nano | [] [] [] [] | 13 + nano_1_0 | [] [] [] [] | 14 + opcodes | [] [] [] | 8 + parted | [] [] [] [] | 12 + ptx | [] [] [] [] [] [] [] | 19 + python | | 0 + recode | [] [] [] [] [] [] | 15 + sed | [] [] [] [] [] [] | 24 + sh-utils | [] [] | 9 + sharutils | [] [] [] [] | 14 + sketch | [] () [] | 4 + soundtracker | [] | 6 + sp | | 1 + tar | [] [] [] [] [] [] [] | 19 + texinfo | [] [] | 10 + textutils | [] [] [] [] [] | 14 + util-linux | [] [] [] | 10 + vorbis-tools | [] | 3 + wastesedge | | 0 + wdiff | [] [] [] [] [] | 14 + wget | [] [] [] [] [] [] [] [] | 24 + +----------------------------------------------+ + 37 teams no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW + 68 domains 4 15 2 28 28 12 10 49 43 4 1 9 609 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If August 2002 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +Using `gettext' in new packages +=============================== + + If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +to use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..60549be --- /dev/null +++ b/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. + + + Copyright (C) 19yy + + 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. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..9b3f228 --- /dev/null +++ b/INSTALL @@ -0,0 +1,196 @@ + + System 3.5 for X Window System Version 1.7 (開発版) + + インストールドキュメント + + +0. 目次 + + 1. 必要環境と対応機能 + 2. コンパイルとインストール + 3. コンパイル時のオプション + 4. サポート + + +1. 必要環境と対応機能 + + 1.1 必要環境 + * X11R6 + * gtk+ 1.0.6 以上 + * SYSV IPC in kernel + * zlib + * Ogg Vorbis library (libvorbis) + + 1.2 推奨環境 + * スケーラブルフォント(例えば X-TT など) + (http://X-TT.dsl.gr.jp/index-ja.html) + * MIT-SHM extension をサポートした X Server。次のようにチェックします。 + $ xdpyinfo | grep MIT-SHM + * MMX Pentinum 以降 (for IA32 platform) + + 1.3 対応機能 + * ALSA (for Linux) 0.5.x 以上 + (http://www.alsa-project.org/) + * ESD (Esound) 0.2.8 以上 + (http://www.tux.org/~ricdude/EsounD.html) + (ftp://ftp.gnome.org/pub/GNOME/stable/sources/esound/ or mirrors) + * Joystick (for Linux kernel 2.2.x) + * SDL(Simple DirectMedia Layer) 1.0.x 以上 + (http://www.devolution.com/~slouken/SDL) + * FreeType Library 1.1 以上 + (http://www.freetype.org/) + (http://freetype.sourceforge.net/index.html) + * midi デバイス(OSS /dev/midi, /dev/sequencer)を介した外部/仮想MIDI音源 + + 1.4 注意点 + * コンパイルには GNU Make (gmake) と gtk-config と nasm (assembler) + が必要です。(nasm は IA-32 platform のみ) + * また gcc 以外でのコンパイルは多分出来ないと思います。標準 cc でコンパイル + を通すためのパッチは大歓迎です。 + + +2. コンパイルとインストール + + 2.1 プログラムのコンパイルとインストール + + $ tar xvfz xsystem35-(version).tar.gz # ソースコードの展開 + $ cd xsystem35-(version) # xsystem35 のトップディレクトリに移動 + $ cp src/xsys35rc.sample ~/.xsys35rc # 設定ファイルのコピー + $ ./configure # `configure' スクリプトの実行 + $ make # xsystem35 のコンパイル + [必要なら root になる] + # make install # xsystem35 のインストール + + default では make install で /usr/local/bin にインストールされます。 + + 2.2 ゲームデータのインストール + + contrib ディレクトリにゲームデータをインストールするプログラムが入っています。 + /cdromにCD-ROMをマウントした後、 + + $ cd ./contrib + $ ./instgame kichiku.inf + + のようにしてインストールします。 詳しくは contrib/README.TXTを御覧下さい。 + + +3. コンパイル時のオプション + + $ ./configure --help + で使用可能なオプションの一覧がでます。 + + * audio 関連 + + --enable-audio=xxx + オーディオデバイスのうち xxx を有効にしてコンパイルします。xxx には今の所 + oss, alsa, esd が使えます。カンマで区切って並べて指定する事で複数のデバイ + スをゲーム起動時に選択できます。(ex. --enable-audio=oss,alsa,esd) + このオプションを指定しない時は OS ごとに適切なデバイスが組み込まれます。 + + --with-default-output=xxx + --enable-audioで複数のデバイスを選択した時、デフォルトのデバイスをこの + オプションで指定できます。指定しない場合は使用可能なデバイスのうち任意の + デバイスを使用します。 + + --with-oss-audiodev=xxx + OSS での DSP デバイスのデバイスファイルを xxx で指定します。デフォルトは + /dev/dsp です。(*1) + + --with-oss-mixerdev=xxx + OSS での MIXER デバイスのデバイスファイルを xxx で指定します。デフォルトは + /dev/mixer です。(*1) + + --enable-cdrom=xxx + CD-ROM デバイスのうち xxx を有効にしてコンパイルします。CD-DA の代わりに + MP3などを外部プレイヤを使って演奏することも出来ます。xxx には linux,bsd, + irix,mp3 が使えます。 + カンマで区切って並べて指定することで複数のデバイスをゲーム起動時に選択 + できます。(ex. --enable-cdrom=linux,mp3) + CD-DA を使うか MP3 を使うかの指定については README.music を御覧下さい。 + このオプションを指定しない時は OS ごとに適切なデバイスが組み込まれます。 + + --with-cdromdev=xxx + CD-ROM デバイスのデバイスファイルを xxx で指定します。デフォルトは + /dev/cdrom です。(*1) + + --enable-midi=xxx + MIDI デバイスのうち xxx を有効にしてコンパイルします。xxx にはいまのところ + extp,raw,seq が使えます。extp は外部プレイヤを使って MIDI を演奏します。 + raw は Raw midi デバイス (/dev/midiなど)を通して外部MIDI機器を接続している + 場合に使います。seq は OSS sequencer device (/dev/sequencer) を通して MIDI + 機器を接続している場合に使います。カンマで区切って並べて指定することで複数 + のデバイスをゲーム起動時に選択できます。(ex. --enable-midi=extp,raw,seq) + + --with-mididev=xxx + Raw MIDI デバイスのデバイスファイルを xxx で指定します。デフォルトは + /dev/midi です。(*1) + + --with-seqdev=xxx + Sequencer MIDI デバイスのデバイスファイルを xxx で指定します。デフォルトは + /dev/sequencer です。(*1) + + --with-midiplayer=xxx + 外部 MIDI プレイヤを指定します。デフォルトは midiplay -4 です。(*1) + + --enable-qmidi + 外部 MIDI プレイヤを実行する際に、プレイヤーの実行時メッセージを抑止 + します。 + + + * graphics 関連 + + --enable-sdl + SDL を有効にしてコンパイルします。 + + --enable-bgr + X server の color order が BGR の時指定します。SunとSGIのプラットフォーム + ではデフォルトでこの指定が有効になっています。それ以外のプラットフォーム + では不要です。ただし、sgi O2 および、Sun sparc のマシンの中には RGB の + 並びのものもあるので、その場合は --enable-bgr=no あるいは --disable-bgr + としてください。詳しくは doc/README.color を御覧下さい。 + + + * その他 + + --enable-joy + Joystic support を有効にしてコンパイルします。Linux kernel 2.2 以降に + 対応しています。 + + --with-joydev=xxx + Joystick デバイスのデバイスファイルを xxx で指定します。デフォルトは + /dev/js0 です。(*1) + + --with-locale=xxxx + X の locale 機構を使う場合に指定します。Linux libc5 System 等では通常 + 使用している locale を指定して下さい。(ex. --with-locale=ja_JP.ujis) + それ以外では必要無いと思います。 + + --with-cachesize=xxxx + データキャッシュの大きさを指定します。単位は MB で、デフォルトは 20MB + です。データのほとんどは展開済み CG のキャッシュに使われます。シナリオ + などのデータは mmap を使っていますので、キャッシングは xsystem35 の管理 + 外です。 + + --enable-mmx + IA32 プラットフォームで MMX を使うようにします。nasm というアセンブラが + 必要になります。IA32 ではデフォルトで有効にします。無効にする場合は =no + を指定して下さい。実行時に MMX 命令が使用可能かどうかチェックしますので、 + MMX 命令を持たないCPUでも有効のままでかまいません。 + + --enable-debug + debuging を有効にします。 + 有効にしてコンパイルすると -debuglv # オプションが使えるようになります。 + debug level に関しては src/xsystem35.h を参照して下さい。 + +## (*1) 実行時に読み込む設定ファイル ~/.xsys35rc でも指定できます。 + + + 参考: 私の開発時の configure オプション(実際には1行です) + + ./configure --enable-midi=extp,raw,seq --enable-audio=oss,alsa,esd + --enable-cdrom=linux,mp3 --enable-debug + +4. サポート + + http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/index.html + または READMEの 8. サポートの項を御覧下さい。 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..79dee6c --- /dev/null +++ b/Makefile.am @@ -0,0 +1,8 @@ +## Makefile.am for xsystem35 + +#SUBDIRS = m4 po libltdl macros modules src +SUBDIRS = po libltdl macros modules src + +ACLOCAL_AMFLAGS = -I macros + +EXTRA_DIST = xsystem35.spec diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..91ec56a --- /dev/null +++ b/Makefile.in @@ -0,0 +1,717 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/xsystem35.spec.in $(top_srcdir)/configure ABOUT-NLS \ + AUTHORS COPYING ChangeLog INSTALL NEWS config.guess config.sub \ + depcomp install-sh ltmain.sh missing mkinstalldirs +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = xsystem35.spec +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ + +#SUBDIRS = m4 po libltdl macros modules src +SUBDIRS = po libltdl macros modules src +ACLOCAL_AMFLAGS = -I macros +EXTRA_DIST = xsystem35.spec +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +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 config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +xsystem35.spec: $(top_builddir)/config.status $(srcdir)/xsystem35.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +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): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + 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: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + 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 + +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 + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + 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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(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 + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/. $(distdir)/macros $(distdir)/po + @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"; \ + $(mkdir_p) "$(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='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done + -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 + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | 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 + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + 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 | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && 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 ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${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 config.h +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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +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 $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-libtool clean-recursive \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-recursive distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-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 \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive 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/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..e873514 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,911 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 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. + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# 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.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + 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])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# 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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --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 (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_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 + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -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"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_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 -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# 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. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# 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_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# 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 +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [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], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# 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 +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# 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 +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_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. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# 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)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([macros/aclocal-include.m4]) +m4_include([macros/alsa.m4]) +m4_include([macros/esd.m4]) +m4_include([macros/freetype.m4]) +m4_include([macros/freetype2.m4]) +m4_include([macros/gettext.m4]) +m4_include([macros/glib-2.0.m4]) +m4_include([macros/glib.m4]) +m4_include([macros/gtk-2.0.m4]) +m4_include([macros/gtk.m4]) +m4_include([macros/iconv.m4]) +m4_include([macros/lib-ld.m4]) +m4_include([macros/lib-link.m4]) +m4_include([macros/lib-prefix.m4]) +m4_include([macros/libtool.m4]) +m4_include([macros/ltdl.m4]) +m4_include([macros/ogg.m4]) +m4_include([macros/progtest.m4]) +m4_include([macros/sdl.m4]) +m4_include([macros/vorbis.m4]) diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..1cb8b0a --- /dev/null +++ b/bootstrap @@ -0,0 +1,15 @@ +#!/bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME="the package." + +(test -f $srcdir/configure.ac) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level directory" + exit 1 +} + +. $srcdir/macros/autogen.sh + diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..917bbc5 --- /dev/null +++ b/config.guess @@ -0,0 +1,1463 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . 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 ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[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 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #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 + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +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 < +# include +#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 + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..151c31a --- /dev/null +++ b/config.h.in @@ -0,0 +1,250 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* alsa card no */ +#undef ALSACARD + +/* aduio device */ +#undef AUDIODEV_ALSA + +/* aduio device */ +#undef AUDIODEV_OSS + +/* Define this if X11 Pixmap color order is BGR */ +#undef BGR_ORDER + +/* General Cache size (MB) */ +#undef CACHE_TOTALSIZE + +/* cdrom device */ +#undef CDROM_DEVICE + +/* Define this if you want to Debug */ +#undef DEBUG + +/* default audio mode */ +#undef DEFAULT_AUDIO_MODE + +/* Define this if you have Alsa (libasound) installed */ +#undef ENABLE_ALSA + +/* Define this if you have 0.5.x <= alsa < 0.9.0 installed */ +#undef ENABLE_ALSA05 + +/* Define this if you have alsa 0.9.x and more installed */ +#undef ENABLE_ALSA09 + +/* Define this if you use cdrom iotctl in *BSD */ +#undef ENABLE_CDROM_BSD + +/* Define this if you use cdrom ctrl library in IRX */ +#undef ENABLE_CDROM_IRIX + +/* Define this if your use cdrom ioctl in linux or Solaris */ +#undef ENABLE_CDROM_LINUX + +/* Define this if you use external player for cdrom audio */ +#undef ENABLE_CDROM_MP3 + +/* Define this if you have ESD (libesd) installed */ +#undef ENABLE_ESD + +/* Define this if you have freetype2 installed */ +#undef ENABLE_FT2 + +/* Define this if you have glib >= 1.2.0 */ +#undef ENABLE_GLIB + +/* Define this if you have gtk+ >= 1.0.0 */ +#undef ENABLE_GTK + +/* define this if you use gtk(gdk) font interface */ +#undef ENABLE_GTKFONT + +/* define this if you use external midi player */ +#undef ENABLE_MIDI_EXTPLAYER + +/* define this if you use oss raw midi interface */ +#undef ENABLE_MIDI_RAWMIDI + +/* define thsi if you use oss sequencer interface */ +#undef ENABLE_MIDI_SEQMIDI + +/* define this if you want to use MMX instructions */ +#undef ENABLE_MMX + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* define this if you use OSS audio interface */ +#undef ENABLE_OSS + +/* define this if you use SDL */ +#undef ENABLE_SDL + +/* define this if you use sun stlye audio interface */ +#undef ENABLE_SUNAUDIO + +/* Define this if you have old(1.x) freetype installed */ +#undef ENABLE_TTF + +/* define this if you use X11 font interface */ +#undef ENABLE_X11FONT + +/* define this if you use X11 render etension */ +#undef ENABLE_XRENDER + +/* define this if you have freetype/freetype.h */ +#undef FREETYPE_HAVE_DIR + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if the C complier supports __func__ */ +#undef HAVE_FUNC + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `asound' library (-lasound). */ +#undef HAVE_LIBASOUND + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_JOYSTICK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkdtemp' function. */ +#undef HAVE_MKDTEMP + +/* define this if you use SDL joystick interface */ +#undef HAVE_SDLJOY + +/* define this if you have SDLRALPHA */ +#undef HAVE_SDLRALPHA + +/* define this if you have SDLRLE */ +#undef HAVE_SDLRLE + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define this if you have libXxf86vm installed */ +#undef HAVE_XF86VMODE + +/* joystick device */ +#undef JOY_DEVICE + +/* midi device */ +#undef MIDI_DEVICE + +/* midi player */ +#undef MIDI_PLAYER + +/* mixer device */ +#undef MIXERDEV_ALSA + +/* mixer device */ +#undef MIXERDEV_OSS + +/* 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 + +/* define this if you stop midi stdout */ +#undef QUITE_MIDI + +/* Define this if X11 Pixmap color order is RGB */ +#undef RGB_ORDER + +/* sequencer device */ +#undef SEQ_DEVICE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* 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 + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..1c366df --- /dev/null +++ b/config.sub @@ -0,0 +1,1579 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . 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 ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -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] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ms1 \ + | msp430 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + 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-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | 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-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | ms1-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + 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 + ;; + 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 + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + 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 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + 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 + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..3fc34de --- /dev/null +++ b/configure @@ -0,0 +1,32941 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59. +# +# Copyright (C) 2003 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 +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/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_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(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" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +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 + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# 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 </dev/null 2>&1 && unset CDPATH + +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. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + 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="$lt_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 + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +# 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="configure.ac" +ac_subdirs_all="$ac_subdirs_all libltdl" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os VERSION_MA VERSION_MI INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSIDE_GNOME_COMMON_TRUE INSIDE_GNOME_COMMON_FALSE 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 subdirs CPP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LTDLINCL LIBLTDL MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE USE_NLS LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS ZLIB_LIBS GLIB_CONFIG GLIB_CFLAGS GLIB_LIBS PKG_CONFIG GLIB_GENMARSHAL GOBJECT_QUERY GLIB_MKENUMS GTK_CONFIG GTK_CFLAGS GTK_LIBS HAVE_GTK_TRUE HAVE_GTK_FALSE SRC_MENU ALSA_CFLAGS ALSA_LIBS ESD_CONFIG ESD_CFLAGS ESD_LIBS SRC_AUDIO SRC_CDROM ALSAMIX_H SRC_MIDI SDL_CONFIG SDL_CFLAGS SDL_LIBS SDL SRC_GRAPHDEV JOY_S FT2_CONFIG FT2_CFLAGS FT2_LIBS FREETYPE_LIBS FREETYPE_INCLUDES SRC_FONT HAVE_NASM SRC_ABLEND VORBIS_CFLAGS VORBIS_LIBS VORBISFILE_LIBS VORBISENC_LIBS OGG_CFLAGS OGG_LIBS HAVE_VORBIS_TRUE HAVE_VORBIS_FALSE ENABLE_JPEG_TRUE ENABLE_JPEG_FALSE JPEG_CFLAGS JPEG_LIBS DEBUG_CFLAGS EXTRACFLAGS EXTRALIBS EXTRALDFLAGS 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_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +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_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# 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 + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_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] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-ltdl-install install libltdl + --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) + --disable-rpath do not hardcode runtime library paths + --disable-nls do not use Native Language Support + --disable-glibtest Do not try to compile and run a test GLIB program + --disable-glibtest do not try to compile and run a test GLIB program + --enable-gtk Enable gtk-based widget default=yes + --disable-gtktest Do not try to compile and run a test GTK program + --disable-gtktest do not try to compile and run a test GTK+ program + --enable-audio=mode_list Enable audio (Specify comma separated mode list): + default: Automatically select audio device. + oss: OSS (Open Sound System) device + sun: sun style interface + alsa: ALSA pcm device + esd: EsounD + --disable-alsatest Do not try to compile and run a test Alsa program + --disable-esdtest Do not try to compile and run a test ESD program + --enable-cdrom=mode_list Enable CD-adio (Specify comma separated mode list): + (default: Automatically select cdrom device) + linux: linux API (Linux/Solaris) + bsd: BSD API (FreeBSD/NetBSD/OpenBSD) + irix: IRIX API + mp3: play mp3 file using external/piped player + --enable-bgr Color order is BGR default is no for most arch + You should check whether your X server is RGB or + BGR order, especially in sparc architecture. + --enable-midi=mode_list Enable midi (Specify comma separated mode list): + extp: External midi player(default) + raw: Raw midi interface + seq: Sequencer interface + --enable-qmidi No display midi stdout + --enable-sdl SDL default=no + --disable-sdltest Do not try to compile and run a test SDL program + --enable-joy Use joystick (only linux and SDL) default=no + --disable-freetypetest Do not try to compile and run a test FreeType + program + --enable-xrender Use XRender extension (future work) default=disable + --enable-mmx MMX support default=yes + --disable-oggtest Do not try to compile and run a test Ogg program + --disable-vorbistest Do not try to compile and run a test Vorbis program + --enable-debug Turn on debugging default=no + +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-tags[=TAGS] + include additional configurations [automatic] + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-libintl-prefix=DIR search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + --with-x use the X Window System + --with-glib-prefix=PFX Prefix where GLIB is installed (optional) + --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional) + --with-gtk-prefix=PFX Prefix where GTK is installed (optional) + --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional) + --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) + --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) + --with-esd-prefix=PFX Prefix where ESD is installed (optional) + --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional) + --with-default-output= Specify default output mode (optional): + default|oss|alsa|esd|sun + --with-cdromdev=# CDROM Device Name. [default=/dev/cdrom] + --with-locale=LOCALE locale name you want to use(ex. ja_JP.ujis) + --with-alsa-card=# ALSA Card No. + --with-alsa-pcmdev=# ALSA PCM device No. + --with-alsa-mixerdev=# ALSA Mixer device No. + --with-oss-audiodev=DEVFILE DSP DEVICE + --with-oss-mixerdev=DEVFILE MIXER DEVICE + --with-midi-player=xxx External Midi Player default=playmidi -4 + --with-mididev=# MIDI Raw Device Name. [default=/dev/midi] + --with-seqdev=# MIDI Sequencer Device Name. [default=/dev/sequencer] + --with-cachesize=# General Cache size (MB) + --with-sdl-prefix=PFX Prefix where SDL is installed (optional) + --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional) + --with-joydev=# Joystick Device Name. [default=/dev/js0] + --with-ft-prefix=PREFIX Prefix where FreeType is installed (optional) + --with-ft-exec-prefix=PREFIX + Exec prefix where FreeType is installed (optional) + --with-freetype-prefix=PFX Prefix for Freetype (optional) + --with-ogg-prefix=PFX Prefix where libogg is installed (optional) + --with-vorbis-prefix=PFX Prefix where libvorbis is installed (optional) + --with-libjpeg-prefix=PFX Prefix where libjpeg is install(optional) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +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 + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + 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 (C) 2003 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.59. 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. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: 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 && + 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 $srcdir $srcdir/.. $srcdir/../..; 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 $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&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. + +# 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/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + + +EXTRACFLAGS= +EXTRALIBS= +EXTRALDFLAGS="-rdynamic" + +XSYS35_MAJOR=1 +XSYS35_MINOR=7 +XSYS35_MICRO=3 +XSYS35_EXTRA=pre5 + +XSYS35_VERSION=$XSYS35_MAJOR.$XSYS35_MINOR.$XSYS35_MICRO$XSYS35_EXTRA +VERSION_MA=$XSYS35_MAJOR.$XSYS35_MINOR.$XSYS35_MICRO +VERSION_MI=$XSYS35_EXTRA + + + +VERSION=$XSYS35_VERSION +PACKAGE=xsystem35 + +am__api_version="1.9" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +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/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_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 + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +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 + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# 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=$PACKAGE + VERSION=$VERSION + + +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"} + +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. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + ac_config_headers="$ac_config_headers config.h" + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + + + +if test x = y; then + INSIDE_GNOME_COMMON_TRUE= + INSIDE_GNOME_COMMON_FALSE='#' +else + INSIDE_GNOME_COMMON_TRUE='#' + INSIDE_GNOME_COMMON_FALSE= +fi + + + test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" + + for k in macros ; do ACLOCAL="$ACLOCAL -I $k" ; done + + + +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 +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&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 &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $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= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].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, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more 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'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&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 b.out +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 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 \ + '' \ + '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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +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 + + + + + +subdirs="$subdirs libltdl" + + + + case $enable_ltdl_convenience in + no) { { echo "$as_me:$LINENO: error: this package needs a convenience libltdl" >&5 +echo "$as_me: error: this package needs a convenience libltdl" >&2;} + { (exit 1); exit 1; }; } ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'libltdl/libltdlc.la + LTDLINCL='-I${top_srcdir}/'libltdl + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" + + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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 +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f 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 + + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err 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_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +else + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + +# Check whether --enable-ltdl-install or --disable-ltdl-install was given. +if test "${enable_ltdl_install+set}" = set; then + enableval="$enable_ltdl_install" + +fi; + + + +if test x"${enable_ltdl_install-no}" != xno; then + INSTALL_LTDL_TRUE= + INSTALL_LTDL_FALSE='#' +else + INSTALL_LTDL_TRUE='#' + INSTALL_LTDL_FALSE= +fi + + + +if test x"${enable_ltdl_convenience-no}" != xno; then + CONVENIENCE_LTDL_TRUE= + CONVENIENCE_LTDL_FALSE='#' +else + CONVENIENCE_LTDL_TRUE='#' + CONVENIENCE_LTDL_FALSE= +fi + + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 4785 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + + +echo "$as_me:$LINENO: checking which extension is used for loadable modules" >&5 +echo $ECHO_N "checking which extension is used for loadable modules... $ECHO_C" >&6 +if test "${libltdl_cv_shlibext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5 +echo "${ECHO_T}$libltdl_cv_shlibext" >&6 +if test -n "$libltdl_cv_shlibext"; then + +cat >>confdefs.h <<_ACEOF +#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext" +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking which variable specifies run-time library path" >&5 +echo $ECHO_N "checking which variable specifies run-time library path... $ECHO_C" >&6 +if test "${libltdl_cv_shlibpath_var+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_shlibpath_var="$shlibpath_var" +fi +echo "$as_me:$LINENO: result: $libltdl_cv_shlibpath_var" >&5 +echo "${ECHO_T}$libltdl_cv_shlibpath_var" >&6 +if test -n "$libltdl_cv_shlibpath_var"; then + +cat >>confdefs.h <<_ACEOF +#define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var" +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking for the default library search path" >&5 +echo $ECHO_N "checking for the default library search path... $ECHO_C" >&6 +if test "${libltdl_cv_sys_search_path+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec" +fi +echo "$as_me:$LINENO: result: $libltdl_cv_sys_search_path" >&5 +echo "${ECHO_T}$libltdl_cv_sys_search_path" >&6 +if test -n "$libltdl_cv_sys_search_path"; then + sys_search_path= + for dir in $libltdl_cv_sys_search_path; do + if test -z "$sys_search_path"; then + sys_search_path="$dir" + else + sys_search_path="$sys_search_path$PATH_SEPARATOR$dir" + fi + done + +cat >>confdefs.h <<_ACEOF +#define LTDL_SYSSEARCHPATH "$sys_search_path" +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${libltdl_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_objdir="$objdir" + if test -n "$objdir"; then + : + else + rm -f .libs 2>/dev/null + mkdir .libs 2>/dev/null + if test -d .libs; then + libltdl_cv_objdir=.libs + else + # MS-DOS does not allow filenames that begin with a dot. + libltdl_cv_objdir=_libs + fi + rmdir .libs 2>/dev/null + fi + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_objdir" >&5 +echo "${ECHO_T}$libltdl_cv_objdir" >&6 + +cat >>confdefs.h <<_ACEOF +#define LTDL_OBJDIR "$libltdl_cv_objdir/" +_ACEOF + + +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 + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + + + + + +# 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 from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $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 an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (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 + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 <&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 grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_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${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_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 + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + 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 + + +echo "$as_me:$LINENO: checking whether libtool supports -dlopen/-dlpreopen" >&5 +echo $ECHO_N "checking whether libtool supports -dlopen/-dlpreopen... $ECHO_C" >&6 +if test "${libltdl_cv_preloaded_symbols+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$lt_cv_sys_global_symbol_pipe"; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_preloaded_symbols" >&5 +echo "${ECHO_T}$libltdl_cv_preloaded_symbols" >&6 +if test x"$libltdl_cv_preloaded_symbols" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PRELOADED_SYMBOLS 1 +_ACEOF + +fi + +LIBADD_DL= + +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 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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 +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SHL_LOAD 1 +_ACEOF + +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SHL_LOAD 1 +_ACEOF + + LIBADD_DL="$LIBADD_DL -ldld" +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if HAVE_DLFCN_H +# include +#endif + +int +main () +{ +dlopen(0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + libltdl_cv_func_dlopen="yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes" +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DLD 1 +_ACEOF + + LIBADD_DL="$LIBADD_DL -ldld" +else + echo "$as_me:$LINENO: checking for _dyld_func_lookup" >&5 +echo $ECHO_N "checking for _dyld_func_lookup... $ECHO_C" >&6 +if test "${ac_cv_func__dyld_func_lookup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _dyld_func_lookup to an innocuous variant, in case declares _dyld_func_lookup. + For example, HP-UX 11i declares gettimeofday. */ +#define _dyld_func_lookup innocuous__dyld_func_lookup + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _dyld_func_lookup (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _dyld_func_lookup + +/* 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 _dyld_func_lookup (); +/* 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__dyld_func_lookup) || defined (__stub____dyld_func_lookup) +choke me +#else +char (*f) () = _dyld_func_lookup; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != _dyld_func_lookup; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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__dyld_func_lookup=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func__dyld_func_lookup=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func__dyld_func_lookup" >&5 +echo "${ECHO_T}$ac_cv_func__dyld_func_lookup" >&6 +if test $ac_cv_func__dyld_func_lookup = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DYLD 1 +_ACEOF + +fi + + +fi + + +fi + + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi + + +fi + + +fi + + +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + +for ac_func in dlerror +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + LIBS="$lt_save_LIBS" +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 _ prefix in compiled symbols" >&5 +echo $ECHO_N "checking for _ prefix in compiled symbols... $ECHO_C" >&6 +if test "${ac_cv_sys_symbol_underscore+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <&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. + ac_nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + ac_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&5 + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + fi + rm -rf conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_symbol_underscore" >&5 +echo "${ECHO_T}$ac_cv_sys_symbol_underscore" >&6 + + +if test x"$ac_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + echo "$as_me:$LINENO: checking whether we have to add an underscore for dlsym" >&5 +echo $ECHO_N "checking whether we have to add an underscore for dlsym... $ECHO_C" >&6 +if test "${libltdl_cv_need_uscore+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + if test "$cross_compiling" = yes; then : + libltdl_cv_need_uscore=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + 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; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; + x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; + x$lt_dlunknown|x*) ;; + esac + else : + # compilation failed + + fi +fi +rm -fr conftest* + + LIBS="$save_LIBS" + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_need_uscore" >&5 +echo "${ECHO_T}$libltdl_cv_need_uscore" >&6 + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_USCORE 1 +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking whether deplibs are loaded by dlopen" >&5 +echo $ECHO_N "checking whether deplibs are loaded by dlopen... $ECHO_C" >&6 +if test "${libltdl_cv_sys_dlopen_deplibs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + libltdl_cv_sys_dlopen_deplibs=unknown + case "$host_os" in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + aix[45]*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + libltdl_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + interix*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + irix[12345]*|irix6.[01]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + osf[1234]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explictly say `no'. + libltdl_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_sys_dlopen_deplibs" >&5 +echo "${ECHO_T}$libltdl_cv_sys_dlopen_deplibs" >&6 +if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then + +cat >>confdefs.h <<\_ACEOF +#define LTDL_DLOPEN_DEPLIBS 1 +_ACEOF + +fi + + +for ac_header in argz.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + + +echo "$as_me:$LINENO: checking for error_t" >&5 +echo $ECHO_N "checking for error_t... $ECHO_C" >&6 +if test "${ac_cv_type_error_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if HAVE_ARGZ_H +# include +#endif + +int +main () +{ +if ((error_t *) 0) + return 0; +if (sizeof (error_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_error_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_error_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_error_t" >&5 +echo "${ECHO_T}$ac_cv_type_error_t" >&6 +if test $ac_cv_type_error_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_ERROR_T 1 +_ACEOF + + +else + +cat >>confdefs.h <<\_ACEOF +#define error_t int +_ACEOF + +fi + + + + + + + +for ac_func in argz_append argz_create_sep argz_insert argz_next argz_stringify +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ + stdio.h unistd.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + + + + + +for ac_header in dl.h sys/dl.h dld.h mach-o/dyld.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + + + +for ac_header in string.h strings.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + break +fi + +done + + + + +for ac_func in strchr index +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi +done + + + +for ac_func in strrchr rindex +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi +done + + + +for ac_func in memcpy bcopy +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi +done + + + +for ac_func in memmove strcmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +for ac_func in closedir opendir readdir +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# 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. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + +# Check whether --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. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=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. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + + +# 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 $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $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. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + 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 + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +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 lds only accept -v. +case `$LD -v 2>&1 &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 +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +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 dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent 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 extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + 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=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +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 +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Check 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 +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > 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 + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 8155 "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 + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > 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.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > 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.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + +esac + +need_locks="$enable_libtool_lock" + + +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 &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err 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 \ + '' \ + '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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err 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=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 + +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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_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 + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + 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 + + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + 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 how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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 \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + 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_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # 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_F77="$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 +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +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_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:9131:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +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 + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# 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 from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $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 an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (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 + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 <&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 grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_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${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_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 + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + 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 + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +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 + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_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 MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + 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_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +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 + + +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 "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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 "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# 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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# 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_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&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="$lt_save_ifs" + MAGIC_CMD="$lt_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_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&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="$lt_save_ifs" + MAGIC_CMD="$lt_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 + +enable_dlopen=yes +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 + + +# 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 + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +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 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:10198: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:10202: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +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 "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + 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_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:10466: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:10470: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +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_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:10570: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:10574: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + 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_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + 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 extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # 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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&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 + 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 + + # Samuel A. Falvo II 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't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(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=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $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' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&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 | grep ': 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 + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $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" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; 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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|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. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_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' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + 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 + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `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"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + 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* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$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' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + 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 $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + 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 $compiler_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 "%s %s\\n" -exported_symbol "\$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 ${output_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=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$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 + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 12039 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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" || \ + test "X$hardcode_automatic" = "Xyes" ; 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 "$_LT_AC_TAGVAR(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 + +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 + +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 +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + 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 + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +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 + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err 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 + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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 +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* 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 (); +/* 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 +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err 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" + wl=$lt_prog_compiler_wl 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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + 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; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + 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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + 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; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +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 + + +# Report which library types will actually be built +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* | aix5*) + 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 + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | 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, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### 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=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# 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=$lt_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_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_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 used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# 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 >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +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" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + 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 + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# 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 $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $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. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + 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 + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +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 lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + 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 + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=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_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=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_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +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 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15380: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15384: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +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_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15484: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15488: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = 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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX 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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 16020 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = 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 + + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# 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=$lt_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_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# 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_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# 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_CXX +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_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# 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_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_CXX + +# 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_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# 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_CXX + +# 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_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# 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_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +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* | aix5*) + 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 + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +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 "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + 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_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17075: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:17079: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +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_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17179: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:17183: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = 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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$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_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&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 + fi + ;; + + amigaos*) + archive_cmds_F77='$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_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II 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't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&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 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$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_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|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. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=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_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=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_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$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_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + 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_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$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_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$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_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$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_F77=' -expect_unresolved \*' + archive_cmds_F77='$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_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$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_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$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_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$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' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 18628 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = 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 + + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# 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=$lt_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_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# 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_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# 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_F77 +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_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# 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_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_F77 + +# 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_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# 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_F77 + +# 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_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# 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_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +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 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:19407: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:19411: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +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 "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + 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_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:19675: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:19679: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +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_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:19779: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:19783: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = 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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$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_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&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 + fi + ;; + + amigaos*) + archive_cmds_GCJ='$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_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II 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't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&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 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$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_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|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. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=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_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=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_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$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_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + 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_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$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_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$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_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$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_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$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_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$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_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$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_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$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' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ 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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 21248 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = 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 + + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# 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=$lt_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_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# 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_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# 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_GCJ +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_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# 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_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_GCJ + +# 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_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# 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_GCJ + +# 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_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# 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_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# 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=$lt_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_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# 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_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# 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_RC +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_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# 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_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_RC + +# 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_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# 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_RC + +# 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_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# 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_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# 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 + + + + + + + + + + + + + + + + + + + + + + + + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; 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_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; 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_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT + +if test -n "$GMSGFMT"; then + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; 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_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + rm -f messages.po + + # Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; 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_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + /*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT=":" + fi + rm -f messages.po + fi + + ac_config_commands="$ac_config_commands default-1" + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# 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 "${acl_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="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_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 + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_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 "${acl_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 &5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no +fi +fi +echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi; + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 + + + + LIBINTL= + LTLIBINTL= + POSUB= + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + + + + + echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 +echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 +if test "${gt_cv_func_gnugettext1_libc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + gt_cv_func_gnugettext1_libc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gnugettext1_libc=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 + + if test "$gt_cv_func_gnugettext1_libc" != "yes"; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6 +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6 + if test "$am_cv_func_iconv" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + fi + if test "$am_cv_lib_iconv" = yes; then + echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix or --without-libintl-prefix was given. +if test "${with_libintl_prefix+set}" = set; then + withval="$with_libintl_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi; + LIBINTL= + LTLIBINTL= + INCINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 +echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 +if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + gt_cv_func_gnugettext1_libintl=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gnugettext1_libintl=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext1_libintl=yes + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 + fi + + if test "$gt_cv_func_gnugettext1_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + else + USE_NLS=no + fi + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + echo "$as_me:$LINENO: checking how to link with libintl" >&5 +echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBINTL" >&5 +echo "${ECHO_T}$LIBINTL" >&6 + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETTEXT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DCGETTEXT 1 +_ACEOF + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + + +echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + +fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'_ACEOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 +fi + + +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err 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 + + +for ac_header in libgen.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +cat >>confdefs.h <<\_ACEOF +#define X_DISPLAY_MISSING 1 +_ACEOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_R_nospace=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_nospace=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_nospace = yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_R_space=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_space=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_space = yes; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6 + fi + fi + LIBS=$ac_xsave_LIBS + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 XOpenDisplay (); +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_dnet_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_dnet_stub_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* 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 gethostbyname (); +/* 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_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 + + if test $ac_cv_func_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_bsd_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 +if test $ac_cv_lib_bsd_gethostbyname = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* 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 connect (); +/* 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_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 + + if test $ac_cv_func_connect = no; then + echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 connect (); +int +main () +{ +connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_socket_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 +if test $ac_cv_lib_socket_connect = yes; then + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + echo "$as_me:$LINENO: checking for remove" >&5 +echo $ECHO_N "checking for remove... $ECHO_C" >&6 +if test "${ac_cv_func_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define remove to an innocuous variant, in case declares remove. + For example, HP-UX 11i declares gettimeofday. */ +#define remove innocuous_remove + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef remove + +/* 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 remove (); +/* 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_remove) || defined (__stub___remove) +choke me +#else +char (*f) () = remove; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != remove; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_remove=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_remove=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +echo "${ECHO_T}$ac_cv_func_remove" >&6 + + if test $ac_cv_func_remove = no; then + echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 +if test "${ac_cv_lib_posix_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 remove (); +int +main () +{ +remove (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_posix_remove=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_posix_remove=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 +if test $ac_cv_lib_posix_remove = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo "$as_me:$LINENO: checking for shmat" >&5 +echo $ECHO_N "checking for shmat... $ECHO_C" >&6 +if test "${ac_cv_func_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shmat to an innocuous variant, in case declares shmat. + For example, HP-UX 11i declares gettimeofday. */ +#define shmat innocuous_shmat + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shmat + +/* 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 shmat (); +/* 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_shmat) || defined (__stub___shmat) +choke me +#else +char (*f) () = shmat; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shmat; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_shmat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shmat=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +echo "${ECHO_T}$ac_cv_func_shmat" >&6 + + if test $ac_cv_func_shmat = no; then + echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 +if test "${ac_cv_lib_ipc_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 shmat (); +int +main () +{ +shmat (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_ipc_shmat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ipc_shmat=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 +if test $ac_cv_lib_ipc_shmat = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 IceConnectionNumber (); +int +main () +{ +IceConnectionNumber (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_ICE_IceConnectionNumber=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 +if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + + + + + + +for ac_func in gettimeofday mkdtemp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 +echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 zlibVersion (); +int +main () +{ +zlibVersion (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_z_zlibVersion=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_z_zlibVersion=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_z_zlibVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6 +if test $ac_cv_lib_z_zlibVersion = yes; then + if test "${ac_cv_header_zlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 zlib.h presence" >&5 +echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 + +fi +if test $ac_cv_header_zlib_h = yes; then + have_zlib=yes + ZLIB_LIBS="-lz" +fi + + +else + { { echo "$as_me:$LINENO: error: zlib needed" >&5 +echo "$as_me: error: zlib needed" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + +no_glib12=no +must_gtk=no + +# Check whether --with-glib-prefix or --without-glib-prefix was given. +if test "${with_glib_prefix+set}" = set; then + withval="$with_glib_prefix" + glib_config_prefix="$withval" +else + glib_config_prefix="" +fi; + +# Check whether --with-glib-exec-prefix or --without-glib-exec-prefix was given. +if test "${with_glib_exec_prefix+set}" = set; then + withval="$with_glib_exec_prefix" + glib_config_exec_prefix="$withval" +else + glib_config_exec_prefix="" +fi; +# Check whether --enable-glibtest or --disable-glibtest was given. +if test "${enable_glibtest+set}" = set; then + enableval="$enable_glibtest" + +else + enable_glibtest=yes +fi; + + if test x$glib_config_exec_prefix != x ; then + glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config + fi + fi + if test x$glib_config_prefix != x ; then + glib_config_args="$glib_config_args --prefix=$glib_config_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_prefix/bin/glib-config + fi + fi + + for module in . + do + case "$module" in + gmodule) + glib_config_args="$glib_config_args gmodule" + ;; + gthread) + glib_config_args="$glib_config_args gthread" + ;; + esac + done + + # Extract the first word of "glib-config", so it can be a program name with args. +set dummy glib-config; 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_path_GLIB_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GLIB_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_CONFIG="$GLIB_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GLIB_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GLIB_CONFIG" && ac_cv_path_GLIB_CONFIG="no" + ;; +esac +fi +GLIB_CONFIG=$ac_cv_path_GLIB_CONFIG + +if test -n "$GLIB_CONFIG"; then + echo "$as_me:$LINENO: result: $GLIB_CONFIG" >&5 +echo "${ECHO_T}$GLIB_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + min_glib_version=1.2.0 + echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 +echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6 + no_glib="" + if test "$GLIB_CONFIG" = "no" ; then + no_glib=yes + else + GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` + GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` + glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" + rm -f conf.glibtest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If glib-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); + printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the glib-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); + printf("*** correct copy of glib-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_glib=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_GLIB 1 +_ACEOF + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test "$GLIB_CONFIG" = "no" ; then + echo "*** The glib-config script installed by GLIB could not be found" + echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GLIB_CONFIG environment variable to the" + echo "*** full path to glib-config." + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB was incorrectly installed" + echo "*** or that you have moved GLIB since it was installed. In the latter case, you" + echo "*** may want to edit the glib-config script: $GLIB_CONFIG" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + echo "$as_me:$LINENO: result: No glib-1.2 found. Next check glib-2.0" >&5 +echo "${ECHO_T}No glib-1.2 found. Next check glib-2.0" >&6 + no_glib12=yes + + + fi + + + rm -f conf.glibtest + + +if test "x$no_glib12" = xyes; then + # Check whether --enable-glibtest or --disable-glibtest was given. +if test "${enable_glibtest+set}" = set; then + enableval="$enable_glibtest" + +else + enable_glibtest=yes +fi; + + pkg_config_args=glib-2.0 + for module in . + do + case "$module" in + gmodule) + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gmodule-no-export) + pkg_config_args="$pkg_config_args gmodule-no-export-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" + ;; + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + esac + done + + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; 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_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + no_glib="" + + if test x$PKG_CONFIG != xno ; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_glib=yes + PKG_CONFIG=no + fi + else + no_glib=yes + fi + + min_glib_version=2.0.0 + echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 +echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6 + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi + + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi + + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" + rm -f conf.glibtest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_glib=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 +echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_GLIB 1 +_ACEOF + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB is incorrectly installed." +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" + echo "$as_me:$LINENO: result: No glib-2.x found. Next check glib-1.0 in gtk" >&5 +echo "${ECHO_T}No glib-2.x found. Next check glib-1.0 in gtk" >&6 + must_gtk=yes + + + fi + + + + + + rm -f conf.glibtest + +fi + + +# Check whether --enable-gtk or --disable-gtk was given. +if test "${enable_gtk+set}" = set; then + enableval="$enable_gtk" + +else + enable_gtk=yes +fi; +if test "x$must_gtk" = xyes; then + if test "x$enable_gtk" != xyes; then + enable_gtk=yes + fi +fi + +no_gtk1x=no +have_gtk=no +if test "x$enable_gtk" = xyes; then + +# Check whether --with-gtk-prefix or --without-gtk-prefix was given. +if test "${with_gtk_prefix+set}" = set; then + withval="$with_gtk_prefix" + gtk_config_prefix="$withval" +else + gtk_config_prefix="" +fi; + +# Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given. +if test "${with_gtk_exec_prefix+set}" = set; then + withval="$with_gtk_exec_prefix" + gtk_config_exec_prefix="$withval" +else + gtk_config_exec_prefix="" +fi; +# Check whether --enable-gtktest or --disable-gtktest was given. +if test "${enable_gtktest+set}" = set; then + enableval="$enable_gtktest" + +else + enable_gtktest=yes +fi; + + for module in . + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + # Extract the first word of "gtk-config", so it can be a program name with args. +set dummy gtk-config; 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_path_GTK_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GTK_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTK_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" + ;; +esac +fi +GTK_CONFIG=$ac_cv_path_GTK_CONFIG + +if test -n "$GTK_CONFIG"; then + echo "$as_me:$LINENO: result: $GTK_CONFIG" >&5 +echo "${ECHO_T}$GTK_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + min_gtk_version=1.0.0 + echo "$as_me:$LINENO: checking for GTK - version >= $min_gtk_version" >&5 +echo $ECHO_N "checking for GTK - version >= $min_gtk_version... $ECHO_C" >&6 + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" + rm -f conf.gtktest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_gtk=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_GTK 1 +_ACEOF + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + echo "$as_me:$LINENO: result: No gtk-1.x found. Next check gtk-2.x" >&5 +echo "${ECHO_T}No gtk-1.x found. Next check gtk-2.x" >&6 + no_gtk1x=yes + + + fi + + + rm -f conf.gtktest + + if test "x$no_gtk1x" = xyes; then + # Check whether --enable-gtktest or --disable-gtktest was given. +if test "${enable_gtktest+set}" = set; then + enableval="$enable_gtktest" + +else + enable_gtktest=yes +fi; + + pkg_config_args=gtk+-2.0 + for module in . + do + case "$module" in + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + esac + done + + no_gtk="" + + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; 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_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + if test x$PKG_CONFIG != xno ; then + if pkg-config --atleast-pkgconfig-version 0.7 ; then + : + else + echo "*** pkg-config too old; version 0.7 or better required." + no_gtk=yes + PKG_CONFIG=no + fi + else + no_gtk=yes + fi + + min_gtk_version=2.0.0 + echo "$as_me:$LINENO: checking for GTK+ - version >= $min_gtk_version" >&5 +echo $ECHO_N "checking for GTK+ - version >= $min_gtk_version... $ECHO_C" >&6 + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" + enable_gtktest=no + fi + + if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then + : + else + no_gtk=yes + fi + fi + + if test x"$no_gtk" = x ; then + GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` + GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` + gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" + rm -f conf.gtktest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_gtk=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + echo "$as_me:$LINENO: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5 +echo "${ECHO_T}yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_GTK 1 +_ACEOF + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://pkgconfig.sourceforge.net" + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK+ test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK+ or finding the wrong" + echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + { { echo "$as_me:$LINENO: error: *** check for GTK failed ***" >&5 +echo "$as_me: error: *** check for GTK failed ***" >&2;} + { (exit 1); exit 1; }; } + + fi + + + rm -f conf.gtktest + + fi + have_gtk=yes +fi + + + + + +if test "x$have_gtk" = xyes; then + HAVE_GTK_TRUE= + HAVE_GTK_FALSE='#' +else + HAVE_GTK_TRUE='#' + HAVE_GTK_FALSE= +fi + +SRC_MENU= +if test "x$have_gtk" = xyes ; then + SRC_MENU="menu.c menu_callback.c menu_gui.c" +else + SRC_MENU="menu_null.c" +fi + + +if test "x$must_gtk" = xyes; then + GLIB_CFLAGS="$GTK_CFLAGS" + GLIB_LIBS="$GTK_LIBS" +fi + + +# Check whether --enable-audio or --disable-audio was given. +if test "${enable_audio+set}" = set; then + enableval="$enable_audio" + enable_audio=$enableval +else + enable_audio=yes +fi; + +test "x$enable_audio" = xyes && enable_audio=default + +if test "x$enable_audio" != xno; then + for i in `echo $enable_audio | sed 's/,/ /g'`; do + eval "enable_$i=yes" + done + if test "x$enable_default" = xyes; then + enable_audio=default + fi +fi + +if test "x$enable_audio" = xdefault; then + case "$target" in + *-*-linux*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*) + enable_oss=yes + ;; + *-*-solaris*) + enable_sun=yes + ;; + *) + enable_esd=yes + ;; + esac +fi + + +have_sunaudio=no +if test "x$enable_sun" = xyes; then + echo "$as_me:$LINENO: checking for Sun audio support" >&5 +echo $ECHO_N "checking for Sun audio support... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + audio_info_t audio_info; + AUDIO_INITINFO(&audio_info); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + + have_sunaudio=yes + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $have_sunaudio" >&5 +echo "${ECHO_T}$have_sunaudio" >&6 + if test "x$have_sunaudio" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_SUNAUDIO 1 +_ACEOF + + fi +fi + + +have_ossaudio=no +if test "x$enable_oss" = xyes; then + echo "$as_me:$LINENO: checking for OSS audio support" >&5 +echo $ECHO_N "checking for OSS audio support... $ECHO_C" >&6 + case "$target" in + *-*-netbsd*) + EXTRALIBS="$EXTRALIBS -lossaudio" + have_ossaudio=yes + ;; + *-*-openbsd*) + EXTRACFLAGS="$EXTRACFLAGS -I/usr/local/lib/oss/include" + EXTRALIBS="$EXTRALIBS -lossaudio" + have_ossaudio=yes + ;; + *-*-linux*|*-*-freebsd*) + have_ossaudio=yes + ;; + *) + have_ossaudio=no + ;; + esac + echo "$as_me:$LINENO: result: $have_ossaudio" >&5 +echo "${ECHO_T}$have_ossaudio" >&6 + if test "x$have_ossaudio" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_OSS 1 +_ACEOF + + fi +fi + + + +if test "x$enable_alsa" = xyes; then + alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + + +# Check whether --with-alsa-prefix or --without-alsa-prefix was given. +if test "${with_alsa_prefix+set}" = set; then + withval="$with_alsa_prefix" + alsa_prefix="$withval" +else + alsa_prefix="" +fi; + + +# Check whether --with-alsa-inc-prefix or --without-alsa-inc-prefix was given. +if test "${with_alsa_inc_prefix+set}" = set; then + withval="$with_alsa_inc_prefix" + alsa_inc_prefix="$withval" +else + alsa_inc_prefix="" +fi; + +# Check whether --enable-alsatest or --disable-alsatest was given. +if test "${enable_alsatest+set}" = set; then + enableval="$enable_alsatest" + enable_alsatest="$enableval" +else + enable_alsatest=yes +fi; + +echo "$as_me:$LINENO: checking for ALSA CFLAGS" >&5 +echo $ECHO_N "checking for ALSA CFLAGS... $ECHO_C" >&6 +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 +echo "${ECHO_T}$ALSA_CFLAGS" >&6 + +echo "$as_me:$LINENO: checking for ALSA LDFLAGS" >&5 +echo $ECHO_N "checking for ALSA LDFLAGS... $ECHO_C" >&6 +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS=`echo $LIBS | sed 's/-lm//'` +LIBS=`echo $LIBS | sed 's/-ldl//'` +LIBS=`echo $LIBS | sed 's/-lpthread//'` +LIBS=`echo $LIBS | sed 's/ //'` +LIBS="$ALSA_LIBS $LIBS" +echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 +echo "${ECHO_T}$ALSA_LIBS" >&6 + +min_alsa_version=0.9.0 +echo "$as_me:$LINENO: checking for libasound headers version >= $min_alsa_version" >&5 +echo $ECHO_N "checking for libasound headers version >= $min_alsa_version... $ECHO_C" >&6 +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + + + +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include + +int +main () +{ + +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "$as_me:$LINENO: result: found." >&5 +echo "${ECHO_T}found." >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: not present." >&5 +echo "${ECHO_T}not present." >&6 + + alsa_found=no + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +if test "x$enable_alsatest" = "xyes"; then + +echo "$as_me:$LINENO: checking for snd_ctl_open in -lasound" >&5 +echo $ECHO_N "checking for snd_ctl_open in -lasound... $ECHO_C" >&6 +if test "${ac_cv_lib_asound_snd_ctl_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 snd_ctl_open (); +int +main () +{ +snd_ctl_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_asound_snd_ctl_open=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_asound_snd_ctl_open=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_ctl_open" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_ctl_open" >&6 +if test $ac_cv_lib_asound_snd_ctl_open = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBASOUND 1 +_ACEOF + + LIBS="-lasound $LIBS" + +else + + alsa_found=no + +fi + +fi + +if test "x$alsa_found" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_ALSA09 1 +_ACEOF + + have_alsa09=yes + + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + have_alsa09=no + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + + + + + if test "x$have_alsa09" = xno; then + alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + + +# Check whether --with-alsa-prefix or --without-alsa-prefix was given. +if test "${with_alsa_prefix+set}" = set; then + withval="$with_alsa_prefix" + alsa_prefix="$withval" +else + alsa_prefix="" +fi; + + +# Check whether --with-alsa-inc-prefix or --without-alsa-inc-prefix was given. +if test "${with_alsa_inc_prefix+set}" = set; then + withval="$with_alsa_inc_prefix" + alsa_inc_prefix="$withval" +else + alsa_inc_prefix="" +fi; + +# Check whether --enable-alsatest or --disable-alsatest was given. +if test "${enable_alsatest+set}" = set; then + enableval="$enable_alsatest" + enable_alsatest="$enableval" +else + enable_alsatest=yes +fi; + +echo "$as_me:$LINENO: checking for ALSA CFLAGS" >&5 +echo $ECHO_N "checking for ALSA CFLAGS... $ECHO_C" >&6 +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 +echo "${ECHO_T}$ALSA_CFLAGS" >&6 + +echo "$as_me:$LINENO: checking for ALSA LDFLAGS" >&5 +echo $ECHO_N "checking for ALSA LDFLAGS... $ECHO_C" >&6 +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS=`echo $LIBS | sed 's/-lm//'` +LIBS=`echo $LIBS | sed 's/-ldl//'` +LIBS=`echo $LIBS | sed 's/-lpthread//'` +LIBS=`echo $LIBS | sed 's/ //'` +LIBS="$ALSA_LIBS $LIBS" +echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 +echo "${ECHO_T}$ALSA_LIBS" >&6 + +min_alsa_version=0.5.0 +echo "$as_me:$LINENO: checking for libasound headers version >= $min_alsa_version" >&5 +echo $ECHO_N "checking for libasound headers version >= $min_alsa_version... $ECHO_C" >&6 +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + + + +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include + +int +main () +{ + +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "$as_me:$LINENO: result: found." >&5 +echo "${ECHO_T}found." >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: not present." >&5 +echo "${ECHO_T}not present." >&6 + + alsa_found=no + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +if test "x$enable_alsatest" = "xyes"; then + +echo "$as_me:$LINENO: checking for snd_ctl_open in -lasound" >&5 +echo $ECHO_N "checking for snd_ctl_open in -lasound... $ECHO_C" >&6 +if test "${ac_cv_lib_asound_snd_ctl_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 snd_ctl_open (); +int +main () +{ +snd_ctl_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_asound_snd_ctl_open=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_asound_snd_ctl_open=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_ctl_open" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_ctl_open" >&6 +if test $ac_cv_lib_asound_snd_ctl_open = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBASOUND 1 +_ACEOF + + LIBS="-lasound $LIBS" + +else + + alsa_found=no + +fi + +fi + +if test "x$alsa_found" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_ALSA05 1 +_ACEOF + + have_alsa05=yes + + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + have_alsa05=no + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + + + + + fi + if test "x$have_alsa09" = xno -a "x$have_alsa05" = xno; then + echo "$as_me:$LINENO: result: *** All of ALSA dependent parts will be disabled ***" >&5 +echo "${ECHO_T}*** All of ALSA dependent parts will be disabled ***" >&6 + else + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_ALSA 1 +_ACEOF + + fi +fi + + +no_esd=yes +if test "x$enable_esd" = xyes; then + +# Check whether --with-esd-prefix or --without-esd-prefix was given. +if test "${with_esd_prefix+set}" = set; then + withval="$with_esd_prefix" + esd_prefix="$withval" +else + esd_prefix="" +fi; + +# Check whether --with-esd-exec-prefix or --without-esd-exec-prefix was given. +if test "${with_esd_exec_prefix+set}" = set; then + withval="$with_esd_exec_prefix" + esd_exec_prefix="$withval" +else + esd_exec_prefix="" +fi; +# Check whether --enable-esdtest or --disable-esdtest was given. +if test "${enable_esdtest+set}" = set; then + enableval="$enable_esdtest" + +else + enable_esdtest=yes +fi; + + if test x$esd_exec_prefix != x ; then + esd_args="$esd_args --exec-prefix=$esd_exec_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_exec_prefix/bin/esd-config + fi + fi + if test x$esd_prefix != x ; then + esd_args="$esd_args --prefix=$esd_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_prefix/bin/esd-config + fi + fi + + # Extract the first word of "esd-config", so it can be a program name with args. +set dummy esd-config; 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_path_ESD_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ESD_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ESD_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no" + ;; +esac +fi +ESD_CONFIG=$ac_cv_path_ESD_CONFIG + +if test -n "$ESD_CONFIG"; then + echo "$as_me:$LINENO: result: $ESD_CONFIG" >&5 +echo "${ECHO_T}$ESD_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + min_esd_version=0.2.8 + echo "$as_me:$LINENO: checking for ESD - version >= $min_esd_version" >&5 +echo $ECHO_N "checking for ESD - version >= $min_esd_version... $ECHO_C" >&6 + no_esd="" + if test "$ESD_CONFIG" = "no" ; then + no_esd=yes + 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 + + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` + + esd_major_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + esd_minor_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_esdtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + rm -f conf.esdtest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.esdtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_esd_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_esd_version"); + exit(1); + } + + if (($esd_major_version > major) || + (($esd_major_version == major) && ($esd_minor_version > minor)) || + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); + printf("*** to point to the correct copy of esd-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_esd=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + 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 + fi + if test "x$no_esd" = x ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_ESD 1 +_ACEOF + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test "$ESD_CONFIG" = "no" ; then + echo "*** The esd-config script installed by ESD could not be found" + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ESD_CONFIG environment variable to the" + echo "*** full path to esd-config." + else + if test -f conf.esdtest ; then + : + else + echo "*** Could not run ESD test program, checking why..." + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + + + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding ESD or finding the wrong" + echo "*** version of ESD. If it is not finding ESD, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means ESD was incorrectly installed" + echo "*** or that you have moved ESD since it was installed. In the latter case, you" + echo "*** may want to edit the esd-config script: $ESD_CONFIG" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + 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 + fi + ESD_CFLAGS="" + ESD_LIBS="" + echo "$as_me:$LINENO: result: *** All of ESD dependent parts will be disabled ***" >&5 +echo "${ECHO_T}*** All of ESD dependent parts will be disabled ***" >&6 + fi + + + rm -f conf.esdtest + +fi + + +DEFAULT_PLAYMODE= + +# Check whether --with-default-output or --without-default-output was given. +if test "${with_default_output+set}" = set; then + withval="$with_default_output" + if test "$enable_audio" != no; then + DEFAULT_PLAYMODE=$withval + eval "enable_$DEFAULT_PLAYMODE=yes" + else + { echo "$as_me:$LINENO: WARNING: --with-default-output=$withval: audio is not enabled" >&5 +echo "$as_me: WARNING: --with-default-output=$withval: audio is not enabled" >&2;} + fi + +fi; +echo "$as_me:$LINENO: checking default output mode" >&5 +echo $ECHO_N "checking default output mode... $ECHO_C" >&6 +if test "x$DEFAULT_PLAYMODE" = x; then + DEFAULT_PLAYMODE=`echo $enable_audio | sed 's/,.*//'` +fi +case ".$DEFAULT_PLAYMODE" in + .default) def_am=AUDIO_PCM_ANY ;; + .oss) def_am=AUDIO_PCM_OSS ;; + .alsa) def_am=AUDIO_PCM_ALSA ;; + .esd) def_am=AUDIO_PCM_ESD ;; + .sun) def_am=AUDIO_PCM_SUN ;; + *) def_am= ;; +esac +if test "x$have_alsa09" = xyes; then + if test "x$def_am" != x; then + def_am="$def_am09" + fi +fi +echo "$as_me:$LINENO: result: $def_am" >&5 +echo "${ECHO_T}$def_am" >&6 +if test "x$def_am" != x; then + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_AUDIO_MODE $def_am +_ACEOF + +fi + + + +SRC_AUDIO= +if test "x$have_ossaudio" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_oss.c" +fi +if test "x$have_sunaudio" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_sun.c" +fi +if test "x$have_alsa05" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_alsa.c" +fi +if test "x$have_alsa09" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_alsa09.c" +fi +if test "x$no_esd" != xyes; then + SRC_AUDIO="$SRC_AUDIO audio_esd.c" +fi + + +# Check whether --enable-cdrom or --disable-cdrom was given. +if test "${enable_cdrom+set}" = set; then + enableval="$enable_cdrom" + enable_cdrom=$enableval +else + enable_cdrom=yes +fi; + +test "x$enable_cdrom" = xyes -a enable_cdrom=default + +if test "x$enable_cdrom" != xno; then + for i in `echo $enable_cdrom | sed 's/,/ /g'`; do + eval "enable_cd_$i=yes" + done + if test "x$enable_cd_default" = xyes; then + enable_cdrom=default + fi +fi + +if test "x$enable_cdrom" = xdefault; then + case "$target" in + *-*-linux*|*-*-solaris*) + enable_cd_linux=yes + ;; + *-*-freebsd*|*-*-netbsd*|*-*-openbsd*) + enable_cd_bsd=yes + ;; + *-irix*) + enable_cd_irix=yes + ;; + *-dec-*) + enable_cd_mp3=yes + ;; + *) + { echo "$as_me:$LINENO: WARNING: No --enable-cdrom=default cdrom for $target" >&5 +echo "$as_me: WARNING: No --enable-cdrom=default cdrom for $target" >&2;} + ;; + esac +fi + +SRC_CDROM= +if test "x$enable_cd_linux" = xyes; then + SRC_CDROM="cdrom.Linux.c" + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CDROM_LINUX 1 +_ACEOF + +elif test "x$enable_cd_bsd" = xyes; then + SRC_CDROM="$SRC_CROM cdrom.FreeBSD.c" + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CDROM_BSD 1 +_ACEOF + +elif test "x$enable_cd_irix" = xyes; then + SRC_CDROM="$SRC_CDROM cdrom.Irix.c" + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CDROM_IRIX 1 +_ACEOF + +else + SRC_CDROM="$SRC_CDROM cdrom.empty.c" +fi +if test "x$enable_cd_mp3" = xyes; then + SRC_CDROM="$SRC_CDROM cdrom.mp3.c" + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CDROM_MP3 1 +_ACEOF + +fi + + + +# Check whether --with-cdromdev or --without-cdromdev was given. +if test "${with_cdromdev+set}" = set; then + withval="$with_cdromdev" + cdromdev="$withval" +else + cdromdev="/dev/cdrom" +fi; + +cat >>confdefs.h <<_ACEOF +#define CDROM_DEVICE "$cdromdev" +_ACEOF + + + +# Check whether --with-locale or --without-locale was given. +if test "${with_locale+set}" = set; then + withval="$with_locale" + +fi; +echo "$as_me:$LINENO: checking need -DX_LOCALE" >&5 +echo $ECHO_N "checking need -DX_LOCALE... $ECHO_C" >&6 + +if test "$cross_compiling" = yes; then + need_x_locale=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return setlocale (LC_ALL, "${with_locale}") == NULL; +} +_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 + need_x_locale=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +need_x_locale=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $need_x_locale" >&5 +echo "${ECHO_T}$need_x_locale" >&6 + +if test "x$need_x_locale" = xyes; then + EXTRACFLAGS="$EXTRACFLAGS -DX_LOCALE" +fi + +case "$target" in + *-*-linux*) + ;; + *-*-freebsd*) + EXTRALIBS="$EXTRALIBS -lxpg4" + EXTRACFLAGS="$EXTRACFLAGS -I/usr/local/include" + EXTRALDFLAGS="$EXTRALDFLAGS -L/usr/local/lib" + ;; + *-irix*) + chk_rgb=yes + EXTRALIBS="$EXTRALIBS -lcdaudio -lds -lmediad" + ;; + sparc-*) + chk_rgb=yes + ;; +esac + +if test "x$chk_rgb" = xyes; then + # Check whether --enable-bgr or --disable-bgr was given. +if test "${enable_bgr+set}" = set; then + enableval="$enable_bgr" + +else + enable_bgr=yes +fi; +fi +if test "x$enable_bgr" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define BGR_ORDER 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define RGB_ORDER 1 +_ACEOF + +fi + +if test "x$have_alsa" = xyes ; then + +# Check whether --with-alsa-card or --without-alsa-card was given. +if test "${with_alsa_card+set}" = set; then + withval="$with_alsa_card" + alsacard="$withval" +else + alsacard="0" +fi; + +# Check whether --with-alsa-pcmdev or --without-alsa-pcmdev was given. +if test "${with_alsa_pcmdev+set}" = set; then + withval="$with_alsa_pcmdev" + alsapcmdev="$withval" +else + alsapcmdev="0" +fi; + +# Check whether --with-alsa-mixerdev or --without-alsa-mixerdev was given. +if test "${with_alsa_mixerdev+set}" = set; then + withval="$with_alsa_mixerdev" + alsamixerdev="$withval" +else + alsamixerdev="0" +fi; + ALSACARD=$alsacard + +cat >>confdefs.h <<_ACEOF +#define ALSACARD "$alsacard" +_ACEOF + + MIXERDEV_ALSA=$alsamixerdev + AUDIODEV_ALSA=$alsapcmdev + +cat >>confdefs.h <<_ACEOF +#define AUDIODEV_ALSA "$AUDIODEV_ALSA" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define MIXERDEV_ALSA "$MIXERDEV_ALSA" +_ACEOF + + echo "$as_me:$LINENO: checking for snd_mixer_element_read in -lasound" >&5 +echo $ECHO_N "checking for snd_mixer_element_read in -lasound... $ECHO_C" >&6 +if test "${ac_cv_lib_asound_snd_mixer_element_read+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 snd_mixer_element_read (); +int +main () +{ +snd_mixer_element_read (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_asound_snd_mixer_element_read=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_asound_snd_mixer_element_read=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_mixer_element_read" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_mixer_element_read" >&6 +if test $ac_cv_lib_asound_snd_mixer_element_read = yes; then + ALSAMIX_H=mixer_alsa.h +fi + + +fi + +if test "x$have_ossaudio" = xyes ; then + +# Check whether --with-audiodev or --without-audiodev was given. +if test "${with_audiodev+set}" = set; then + withval="$with_audiodev" + audiodev="$withval" +else + ossaudiodev="/dev/dsp" +fi; + +# Check whether --with-mixerdev or --without-mixerdev was given. +if test "${with_mixerdev+set}" = set; then + withval="$with_mixerdev" + mixerdev="Ec$withval" +else + ossmixerdev="/dev/mixer" +fi; + AUDIODEV_OSS=$ossaudiodev + MIXERDEV_OSS=$ossmixerdev + +cat >>confdefs.h <<_ACEOF +#define AUDIODEV_OSS "$AUDIODEV_OSS" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define MIXERDEV_OSS "$MIXERDEV_OSS" +_ACEOF + +fi + + +# Check whether --enable-midi or --disable-midi was given. +if test "${enable_midi+set}" = set; then + enableval="$enable_midi" + enable_midi=$enableval +else + enable_midi=yes +fi; + +test "x$enable_midi" = xyes && enable_midi=default + +if test "x$enable_midi" != xno; then + for i in `echo $enable_midi | sed 's/,/ /g'`; do + eval "enable_midi_$i=yes" + done +fi + +if test "x$enable_midi" = xdefault; then + case "$target" in + *) + enable_midi_extp=yes + ;; + esac +fi + +SRC_MIDI= +if test "x$enable_midi_extp" = xyes; then + SRC_MIDI="midi.extplayer.c" + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MIDI_EXTPLAYER 1 +_ACEOF + +fi +if test "x$enable_midi_raw" = xyes || test "x$enable_midi_seq" = xyes; then + SRC_MIDI="$SRC_MIDI midi.rawmidi.c midifile.c" + if test "x$enable_midi_raw" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MIDI_RAWMIDI 1 +_ACEOF + + fi + if test "x$enable_midi_seq" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MIDI_SEQMIDI 1 +_ACEOF + + fi +fi + + + +# Check whether --with-midi-player or --without-midi-player was given. +if test "${with_midi_player+set}" = set; then + withval="$with_midi_player" + midiplayer="$withval" +else + midiplayer="playmidi -4" +fi; + +cat >>confdefs.h <<_ACEOF +#define MIDI_PLAYER "$midiplayer" +_ACEOF + + +# Check whether --enable-qmidi or --disable-qmidi was given. +if test "${enable_qmidi+set}" = set; then + enableval="$enable_qmidi" + +cat >>confdefs.h <<\_ACEOF +#define QUITE_MIDI 1 +_ACEOF + +fi; + + +# Check whether --with-mididev or --without-mididev was given. +if test "${with_mididev+set}" = set; then + withval="$with_mididev" + mididev="$withval" +else + mididev="/dev/midi" +fi; + +cat >>confdefs.h <<_ACEOF +#define MIDI_DEVICE "$mididev" +_ACEOF + + + +# Check whether --with-seqdev or --without-seqdev was given. +if test "${with_seqdev+set}" = set; then + withval="$with_seqdev" + mididev="$withval" +else + seqdev="/dev/sequencer" +fi; + +cat >>confdefs.h <<_ACEOF +#define SEQ_DEVICE "$seqdev" +_ACEOF + + + + +# Check whether --with-cachesize or --without-cachesize was given. +if test "${with_cachesize+set}" = set; then + withval="$with_cachesize" + +cat >>confdefs.h <<_ACEOF +#define CACHE_TOTALSIZE $withval +_ACEOF + +fi; + + +SRC_GRAPHDEV="xcore_draw.c xcore_video.c xcore_mode.c xcore_event.c xcore_cursor.c xcore_maskupdate.c image.c" +# Check whether --enable-sdl or --disable-sdl was given. +if test "${enable_sdl+set}" = set; then + enableval="$enable_sdl" + +else + enable_sdl=no +fi; +if test "x$enable_sdl" = xyes ; then + KEEPLIBS=$LIBS + KEEPCFLAGS=$CFLAGS + KEEPLDFLAGS=$LDFLAGS + +# Check whether --with-sdl-prefix or --without-sdl-prefix was given. +if test "${with_sdl_prefix+set}" = set; then + withval="$with_sdl_prefix" + sdl_prefix="$withval" +else + sdl_prefix="" +fi; + +# Check whether --with-sdl-exec-prefix or --without-sdl-exec-prefix was given. +if test "${with_sdl_exec_prefix+set}" = set; then + withval="$with_sdl_exec_prefix" + sdl_exec_prefix="$withval" +else + sdl_exec_prefix="" +fi; +# Check whether --enable-sdltest or --disable-sdltest was given. +if test "${enable_sdltest+set}" = set; then + enableval="$enable_sdltest" + +else + enable_sdltest=yes +fi; + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + # Extract the first word of "sdl-config", so it can be a program name with args. +set dummy sdl-config; 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_path_SDL_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SDL_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" + ;; +esac +fi +SDL_CONFIG=$ac_cv_path_SDL_CONFIG + +if test -n "$SDL_CONFIG"; then + echo "$as_me:$LINENO: result: $SDL_CONFIG" >&5 +echo "${ECHO_T}$SDL_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + min_sdl_version=1.0.0 + echo "$as_me:$LINENO: checking for SDL - version >= $min_sdl_version" >&5 +echo $ECHO_N "checking for SDL - version >= $min_sdl_version... $ECHO_C" >&6 + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + rm -f conf.sdltest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_sdl=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + have_sdl=yes + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main + +int +main () +{ + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_CXXFLAGS="" + SDL_LIBS="" + have_sdl=no + fi + + + rm -f conf.sdltest + + LIBS=$SDL_LIBS + CFLAGS=$SDL_CFLAGS + echo "$as_me:$LINENO: checking for SDL_NumJoysticks in -lSDL" >&5 +echo $ECHO_N "checking for SDL_NumJoysticks in -lSDL... $ECHO_C" >&6 +if test "${ac_cv_lib_SDL_SDL_NumJoysticks+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lSDL $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 SDL_NumJoysticks (); +int +main () +{ +SDL_NumJoysticks (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_SDL_SDL_NumJoysticks=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_SDL_SDL_NumJoysticks=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_SDL_NumJoysticks" >&5 +echo "${ECHO_T}$ac_cv_lib_SDL_SDL_NumJoysticks" >&6 +if test $ac_cv_lib_SDL_SDL_NumJoysticks = yes; then + have_sdljoy=yes +fi + + echo "$as_me:$LINENO: checking for SDL RLE accell" >&5 +echo $ECHO_N "checking for SDL RLE accell... $ECHO_C" >&6 + sdlrle=no + sdlralpha=no + if test "$cross_compiling" = yes; then + echo "$as_me:$LINENO: result: \"unknown\"" >&5 +echo "${ECHO_T}\"unknown\"" >&6 + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +int main( int argc,char **argv) { +#ifndef SDL_RLEACCEL + exit(1); +#else + exit(0); +#endif +} + +_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 + echo "$as_me:$LINENO: result: \"yes\"" >&5 +echo "${ECHO_T}\"yes\"" >&6;sdlrle=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +echo "$as_me:$LINENO: result: \"no\"" >&5 +echo "${ECHO_T}\"no\"" >&6 +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + if test "x$sdlrle" = xyes ; then + echo "$as_me:$LINENO: checking for SDL alpha value" >&5 +echo $ECHO_N "checking for SDL alpha value... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + echo "$as_me:$LINENO: result: \"unknown\"" >&5 +echo "${ECHO_T}\"unknown\"" >&6 + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +int main( int argc,char **argv) { + SDL_Surface *s1,*s2; + unsigned short *x; + s1=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); + s2=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); + SDL_FillRect(s1,NULL,0); + SDL_FillRect(s2,NULL,0xFFFF); + SDL_SetAlpha(s2,SDL_SRCALPHA|SDL_RLEACCEL,255); + SDL_BlitSurface(s2,NULL,s1,NULL); + x=s1->pixels; + if( *x ) + exit(1); + 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 + echo "$as_me:$LINENO: result: \"normal\"" >&5 +echo "${ECHO_T}\"normal\"" >&6 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +echo "$as_me:$LINENO: result: \"revese\"" >&5 +echo "${ECHO_T}\"revese\"" >&6;sdlralpha=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + fi + LIBS=$KEEPLIBS + CFLAGS=$KEEPCFLAGS + LDFLAGS=$KEEPLDFLAGS +fi +if test "x$have_sdl" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_SDL 1 +_ACEOF + + SDL=1 + SRC_GRAPHDEV="sdl_video.c sdl_mode.c sdl_draw.c sdl_event.c sdl_image.c sdl_cursor.c image.c" + + if test "x$sdlrle" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SDLRLE 1 +_ACEOF + + fi + if test "x$sdlralpha" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SDLRALPHA 1 +_ACEOF + + fi +fi + + +# Check whether --enable-joy or --disable-joy was given. +if test "${enable_joy+set}" = set; then + enableval="$enable_joy" + +else + enable_joy=no +fi; +if test "x$enable_joy" = xyes ; then + if test "x$have_sdljoy" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SDLJOY 1 +_ACEOF + + JOY_S=joystick_sdl + else + +for ac_header in linux/joystick.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + JOY_S=joystick_linux +else + JOY_S=joystick_dmy +fi + +done + + fi +else + JOY_S=joystick_dmy +fi + + + +# Check whether --with-joydev or --without-joydev was given. +if test "${with_joydev+set}" = set; then + withval="$with_joydev" + joydev="$withval" +else + joydev="/dev/js0" +fi; + +cat >>confdefs.h <<_ACEOF +#define JOY_DEVICE "$joydev" +_ACEOF + + + +have_ttf=no +SRC_FONT= +if test "x$have_sdl" = xyes; then + if test "x$enable_gtk" = xyes; then + SRC_FONT="font_gtk.c" + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_GTKFONT 1 +_ACEOF + + fi +else + SRC_FONT="font_x11.c" + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_X11FONT 1 +_ACEOF + +fi +# Get the cflags and libraries from the freetype-config script + # + +# Check whether --with-ft-prefix or --without-ft-prefix was given. +if test "${with_ft_prefix+set}" = set; then + withval="$with_ft_prefix" + ft_config_prefix="$withval" +else + ft_config_prefix="" +fi; + + +# Check whether --with-ft-exec-prefix or --without-ft-exec-prefix was given. +if test "${with_ft_exec_prefix+set}" = set; then + withval="$with_ft_exec_prefix" + ft_config_exec_prefix="$withval" +else + ft_config_exec_prefix="" +fi; + + # Check whether --enable-freetypetest or --disable-freetypetest was given. +if test "${enable_freetypetest+set}" = set; then + enableval="$enable_freetypetest" + +else + enable_fttest=yes +fi; + + if test x$ft_config_exec_prefix != x ; then + ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config + fi + fi + + if test x$ft_config_prefix != x ; then + ft_config_args="$ft_config_args --prefix=$ft_config_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_prefix/bin/freetype-config + fi + fi + + # Extract the first word of "freetype-config", so it can be a program name with args. +set dummy freetype-config; 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_path_FT2_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $FT2_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FT2_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_FT2_CONFIG" && ac_cv_path_FT2_CONFIG="no" + ;; +esac +fi +FT2_CONFIG=$ac_cv_path_FT2_CONFIG + +if test -n "$FT2_CONFIG"; then + echo "$as_me:$LINENO: result: $FT2_CONFIG" >&5 +echo "${ECHO_T}$FT2_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + min_ft_version=2.0.0 + echo "$as_me:$LINENO: checking for FreeType -- version >= $min_ft_version" >&5 +echo $ECHO_N "checking for FreeType -- version >= $min_ft_version... $ECHO_C" >&6 + no_ft="" + if test "$FT2_CONFIG" = "no" ; then + no_ft=yes + else + FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` + FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` + ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + ft_min_major_version=`echo $min_ft_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + ft_min_minor_version=`echo $min_ft_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + ft_min_micro_version=`echo $min_ft_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test x$enable_fttest = xyes ; then + ft_config_is_lt="" + if test $ft_config_major_version -lt $ft_min_major_version ; then + ft_config_is_lt=yes + else + if test $ft_config_major_version -eq $ft_min_major_version ; then + if test $ft_config_minor_version -lt $ft_min_minor_version ; then + ft_config_is_lt=yes + else + if test $ft_config_minor_version -eq $ft_min_minor_version ; then + if test $ft_config_micro_version -lt $ft_min_micro_version ; then + ft_config_is_lt=yes + fi + fi + fi + fi + fi + if test x$ft_config_is_lt = xyes ; then + no_ft=yes + else + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $FT2_CFLAGS" + LIBS="$FT2_LIBS $LIBS" + + # + # Sanity checks for the results of freetype-config to some extent. + # + if test "$cross_compiling" = yes; then + echo $ECHO_N "cross compiling; assuming OK... $ECHO_C" +else + cat >conftest.$ac_ext <<_ACEOF + + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +#include +#include FT_FREETYPE_H +#include +#include + +int +main() +{ + FT_Library library; + FT_Error error; + + error = FT_Init_FreeType(&library); + + if (error) + return 1; + else + { + FT_Done_FreeType(library); + 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_ft=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi # test $ft_config_version -lt $ft_min_version + fi # test x$enable_fttest = xyes + fi # test "$FT2_CONFIG" = "no" + + if test x$no_ft = x ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_FT2 1 +_ACEOF + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test "$FT2_CONFIG" = "no" ; then + { echo "$as_me:$LINENO: WARNING: + + The freetype-config script installed by FreeType 2 could not be found. + If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in + your path, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + " >&5 +echo "$as_me: WARNING: + + The freetype-config script installed by FreeType 2 could not be found. + If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in + your path, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + " >&2;} + else + if test x$ft_config_is_lt = xyes ; then + { echo "$as_me:$LINENO: WARNING: + + Your installed version of the FreeType 2 library is too old. + If you have different versions of FreeType 2, make sure that + correct values for --with-ft-prefix or --with-ft-exec-prefix + are used, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + " >&5 +echo "$as_me: WARNING: + + Your installed version of the FreeType 2 library is too old. + If you have different versions of FreeType 2, make sure that + correct values for --with-ft-prefix or --with-ft-exec-prefix + are used, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + " >&2;} + else + { echo "$as_me:$LINENO: WARNING: + + The FreeType test program failed to run. If your system uses + shared libraries and they are installed outside the normal + system library path, make sure the variable LD_LIBRARY_PATH + (or whatever is appropiate for your system) is correctly set. + " >&5 +echo "$as_me: WARNING: + + The FreeType test program failed to run. If your system uses + shared libraries and they are installed outside the normal + system library path, make sure the variable LD_LIBRARY_PATH + (or whatever is appropiate for your system) is correctly set. + " >&2;} + fi + fi + + FT2_CFLAGS="" + FT2_LIBS="" + : + fi + + + +if test "x$no_ft" = xyes; then + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Check whether --with-freetype-prefix or --without-freetype-prefix was given. +if test "${with_freetype_prefix+set}" = set; then + withval="$with_freetype_prefix" + freetype_prefix="$withval" +else + freetype_prefix="" +fi; + + if test ".$freetype_prefix" != . ; then + FREETYPE_INCLUDES=-I$freetype_prefix/include + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$FREETYPE_INCLUDES $CPPFLAGS" + if test "${ac_cv_header_freetype_freetype_h+set}" = set; then + echo "$as_me:$LINENO: checking for freetype/freetype.h" >&5 +echo $ECHO_N "checking for freetype/freetype.h... $ECHO_C" >&6 +if test "${ac_cv_header_freetype_freetype_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_freetype_freetype_h" >&5 +echo "${ECHO_T}$ac_cv_header_freetype_freetype_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking freetype/freetype.h usability" >&5 +echo $ECHO_N "checking freetype/freetype.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 freetype/freetype.h presence" >&5 +echo $ECHO_N "checking freetype/freetype.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: freetype/freetype.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: freetype/freetype.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: freetype/freetype.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: freetype/freetype.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: freetype/freetype.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: freetype/freetype.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: freetype/freetype.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: freetype/freetype.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: freetype/freetype.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for freetype/freetype.h" >&5 +echo $ECHO_N "checking for freetype/freetype.h... $ECHO_C" >&6 +if test "${ac_cv_header_freetype_freetype_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_freetype_freetype_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_freetype_freetype_h" >&5 +echo "${ECHO_T}$ac_cv_header_freetype_freetype_h" >&6 + +fi +if test $ac_cv_header_freetype_freetype_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define FREETYPE_HAVE_DIR 1 +_ACEOF + +fi + + + CPPFLAGS="$save_CPPFLAGS" + + if test x$no_freetype = x ; then + if test x$freetype_prefix != x ; then + freetype_libs=-L$freetype_prefix/lib + fi + freetype_libs="$freetype_libs -lttf" + + echo "$as_me:$LINENO: checking for working Freetype environment" >&5 +echo $ECHO_N "checking for working Freetype environment... $ECHO_C" >&6 +if test "${ac_cv_lib_freetype+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + save_LDFLAGS="$LDFLAGS" + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + LIBS="$LIBS $freetype_libs" + LDFLAGS="$LDFLAGS" + CPPFLAGS="$CPPFLAGS $FREETYPE_INCLUDES" + + if test "$cross_compiling" = yes; then + ac_cv_lib_freetype=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef FREETYPE_HAVE_DIR +#include +#else +#include +#endif +#include +int main (int argc, char* argv[]) +{ + TT_Engine library; + if(TT_Init_FreeType(&library) != 0) + { + printf("Error: Could not initialize FreeType engine!\n"); + return 1; + } + 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_lib_freetype=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_lib_freetype=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_freetype" >&5 +echo "${ECHO_T}$ac_cv_lib_freetype" >&6 + fi + + if test x$ac_cv_lib_freetype = xyes ; then + FREETYPE_LIBS=$freetype_libs + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_TTF 1 +_ACEOF + have_ttf=yes + else + + if test ".1.0.0" = .mandatory ; then + { { echo "$as_me:$LINENO: error: Could not find freetype library!" >&5 +echo "$as_me: error: Could not find freetype library!" >&2;} + { (exit 1); exit 1; }; } + fi + have_ttf=no + 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 + + +fi +if test "x$no_ft" != xyes; then + SRC_FONT="$SRC_FONT font_freetype2.c cp932tojis0213.c" + EXTRALIBS="$EXTRALIBS $FT2_LIBS" + EXTRACFLAGS="$EXTRACFLAGS $FT2_CFLAGS" +elif test "x$have_ttf" = xyes; then + SRC_FONT="$SRC_FONT font_ttf.c" + EXTRALIBS="$EXTRALIBS $FREETYPE_LIBS" + EXTRACFLAGS="$EXTRACFLAGS $FREETYPE_INCLUDES" +fi +if test x"SRC_FONT" = "x"; then + { { echo "$as_me:$LINENO: error: \"*** No font device available ***\"" >&5 +echo "$as_me: error: \"*** No font device available ***\"" >&2;} + { (exit 1); exit 1; }; }; +fi + + + +echo "$as_me:$LINENO: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5 +echo $ECHO_N "checking for XF86VidModeQueryExtension in -lXxf86vm... $ECHO_C" >&6 +if test "${ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXxf86vm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 XF86VidModeQueryExtension (); +int +main () +{ +XF86VidModeQueryExtension (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_Xxf86vm_XF86VidModeQueryExtension=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension" >&6 +if test $ac_cv_lib_Xxf86vm_XF86VidModeQueryExtension = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_XF86VMODE 1 +_ACEOF + + XXF86VM_LIB="-lXxf86vm" +fi + +X_LIBS="$X_LIBS $XXF86VM_LIB -lXext" + +# Check whether --enable-xrender or --disable-xrender was given. +if test "${enable_xrender+set}" = set; then + enableval="$enable_xrender" + +else + enable_xrender="no" +fi; +if test "x$enable-xrender" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_XRENDER 1 +_ACEOF + +fi + + +SRC_ABLEND= +# Extract the first word of "nasm", so it can be a program name with args. +set dummy nasm; 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_path_HAVE_NASM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $HAVE_NASM in + [\\/]* | ?:[\\/]*) + ac_cv_path_HAVE_NASM="$HAVE_NASM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_HAVE_NASM="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_HAVE_NASM" && ac_cv_path_HAVE_NASM="no" + ;; +esac +fi +HAVE_NASM=$ac_cv_path_HAVE_NASM + +if test -n "$HAVE_NASM"; then + echo "$as_me:$LINENO: result: $HAVE_NASM" >&5 +echo "${ECHO_T}$HAVE_NASM" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test "x$HAVE_NASM" != xno; then + case "$target" in + *i*86-*) + # Check whether --enable-mmx or --disable-mmx was given. +if test "${enable_mmx+set}" = set; then + enableval="$enable_mmx" + +else + enable_mmx=yes +fi; + if test "x$enable_mmx" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MMX 1 +_ACEOF + + SRC_ABLEND="alpha_blend16.s haveunit.s" + fi;; + esac +fi + + + + +# Check whether --with-ogg-prefix or --without-ogg-prefix was given. +if test "${with_ogg_prefix+set}" = set; then + withval="$with_ogg_prefix" + ogg_prefix="$withval" +else + ogg_prefix="" +fi; +# Check whether --enable-oggtest or --disable-oggtest was given. +if test "${enable_oggtest+set}" = set; then + enableval="$enable_oggtest" + +else + enable_oggtest=yes +fi; + + if test x$ogg_prefix != x ; then + ogg_args="$ogg_args --prefix=$ogg_prefix" + OGG_CFLAGS="-I$ogg_prefix/include" + OGG_LIBS="-L$ogg_prefix/lib" + fi + + OGG_LIBS="$OGG_LIBS -logg" + + echo "$as_me:$LINENO: checking for Ogg" >&5 +echo $ECHO_N "checking for Ogg... $ECHO_C" >&6 + no_ogg="" + + + if test "x$enable_oggtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $OGG_LIBS" + rm -f conf.oggtest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include + +int main () +{ + system("touch conf.oggtest"); + 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_ogg=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + if test "x$no_ogg" = x ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +# Check whether --with-vorbis-prefix or --without-vorbis-prefix was given. +if test "${with_vorbis_prefix+set}" = set; then + withval="$with_vorbis_prefix" + vorbis_prefix="$withval" +else + vorbis_prefix="" +fi; +# Check whether --enable-vorbistest or --disable-vorbistest was given. +if test "${enable_vorbistest+set}" = set; then + enableval="$enable_vorbistest" + +else + enable_vorbistest=yes +fi; + + if test x$vorbis_prefix != x ; then + vorbis_args="$vorbis_args --prefix=$vorbis_prefix" + VORBIS_CFLAGS="-I$vorbis_prefix/include" + VORBIS_LIBDIR="-L$vorbis_prefix/lib" + fi + + VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm" + VORBISFILE_LIBS="-lvorbisfile" + VORBISENC_LIBS="-lvorbisenc" + + echo "$as_me:$LINENO: checking for Vorbis" >&5 +echo $ECHO_N "checking for Vorbis... $ECHO_C" >&6 + no_vorbis="" + + + if test "x$enable_vorbistest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $VORBIS_CFLAGS" + LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" + rm -f conf.vorbistest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include +#include + +int main () +{ + system("touch conf.vorbistest"); + 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 + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_vorbis=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + if test "x$no_vorbis" = x ; then + 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 + if test -f conf.vorbistest ; then + : + else + echo "*** Could not run Vorbis test program, checking why..." + CFLAGS="$CFLAGS $VORBIS_CFLAGS" + LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Vorbis or finding the wrong" + echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means Vorbis was incorrectly installed" + echo "*** or that you have moved Vorbis since it was installed." +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + VORBIS_CFLAGS="" + VORBIS_LIBS="" + VORBISFILE_LIBS="" + VORBISENC_LIBS="" + { { echo "$as_me:$LINENO: error: OGG/VORBIS needed" >&5 +echo "$as_me: error: OGG/VORBIS needed" >&2;} + { (exit 1); exit 1; }; } + fi + + + + + rm -f conf.vorbistest + + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + if test -f conf.oggtest ; then + : + else + echo "*** Could not run Ogg test program, checking why..." + CFLAGS="$CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $OGG_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Ogg or finding the wrong" + echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means Ogg was incorrectly installed" + echo "*** or that you have moved Ogg since it was installed. In the latter case, you" + echo "*** may want to edit the ogg-config script: $OGG_CONFIG" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + OGG_CFLAGS="" + OGG_LIBS="" + { { echo "$as_me:$LINENO: error: OGG/VORBIS needed" >&5 +echo "$as_me: error: OGG/VORBIS needed" >&2;} + { (exit 1); exit 1; }; } + fi + + + rm -f conf.oggtest + + + +if test "x$no_ogg" != xyes -a "x$no_vorbis" != xyes; then + HAVE_VORBIS_TRUE= + HAVE_VORBIS_FALSE='#' +else + HAVE_VORBIS_TRUE='#' + HAVE_VORBIS_FALSE= +fi + + +JPEG_CFLAGS="" +JPEG_LIBS="" +available_jpeg=no + +# Check whether --with-libjpeg-prefix or --without-libjpeg-prefix was given. +if test "${with_libjpeg_prefix+set}" = set; then + withval="$with_libjpeg_prefix" + libjpeg_prefix="$withval" +else + libjpeg_prefix="" +fi; + +if test "x$libjpeg_prefix" != x ; then + JPEG_CFLAGS="-I$libjpeg_prefix/include" + JPEG_LIBS="-L$libjpeg_prefix/lib" +fi + +ac_save_CFLAGS="$CFLAGS" +ac_save_LIBS="$LIBS" +CFLAGS="$CFLAGS $JPEG_CFLAGS" +LIBS="$LIBS $JPEG_LIBS" + +echo "$as_me:$LINENO: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo $ECHO_N "checking for jpeg_destroy_decompress in -ljpeg... $ECHO_C" >&6 +if test "${ac_cv_lib_jpeg_jpeg_destroy_decompress+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 jpeg_destroy_decompress (); +int +main () +{ +jpeg_destroy_decompress (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_jpeg_jpeg_destroy_decompress=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_jpeg_jpeg_destroy_decompress=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 +echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6 +if test $ac_cv_lib_jpeg_jpeg_destroy_decompress = yes; then + available_jpeg=yes +else + available_jpeg=no +fi + + +if test "x$available_jpeg" = xyes; then + echo "$as_me:$LINENO: checking for jpeglib.h" >&5 +echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#undef PACKAGE +#undef VERSION +#undef HAVE_STDLIB_H +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + available_jpeg=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + available_jpeg=no +fi +rm -f conftest.err conftest.$ac_ext + echo "$as_me:$LINENO: result: $available_jpeg" >&5 +echo "${ECHO_T}$available_jpeg" >&6 + if test "x$available_jpeg" = xyes; then + JPEG_LIBS="$JPEG_LIBS -ljpeg" + fi +fi +CFLAGS="$ac_save_CFLAGS" +LIBS="$ac_save_LIBS" + +if test "x$available_jpeg" != xyes; then + { { echo "$as_me:$LINENO: error: libjpeg needed" >&5 +echo "$as_me: error: libjpeg needed" >&2;} + { (exit 1); exit 1; }; } +fi + + + +if test "x$available_jpeg" = xyes; then + ENABLE_JPEG_TRUE= + ENABLE_JPEG_FALSE='#' +else + ENABLE_JPEG_TRUE='#' + ENABLE_JPEG_FALSE= +fi + + + + +enable_jpeg=$available_jpeg + + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + +else + enable_debug=no +fi; + +if test "x$enable_debug" = xyes; then + DEBUG_CFLAGS="-g" + if test "x$GCC" = xyes; then + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall" + fi + +cat >>confdefs.h <<\_ACEOF +#define DEBUG 1 +_ACEOF + +else + CFLAGS="`echo $CFLAGS | sed 's/-g//g'`" + DEBUG_CFLAGS="" +fi + + + +echo "xsystem35 summary:" +echo "------------------" + +echo " * audio output:" +if test "x$have_ossaudio" = xyes; then + echo " - oss (Open Sound System)" +fi +if test "x$have_sunaudio" = xyes; then + echo " - sun ()" +fi +if test "x$no_alsa" != xyes; then + if test "x$have_alsa05" = xyes; then + echo " - alsa05 (Alsa 0.5.x)" + fi + if test "x$have_alsa09" = xyes; then + echo " - alsa09 (Alsa 0.9.x)" + fi +fi +if test "x$no_esd" != xyes; then + echo " - esd (Enlightened Sound Daemon)" +fi +echo "" + +echo " * cdrom output:" +if test "x$enable_cd_linux" = xyes; then + echo " - Linux|Solaris ioctl" +fi +if test "x$enable_cd_bsd" = xyes; then + echo " - *BSD ioctl" +fi +if test "x$enable_cd_irix" = xyes; then + echo " - Irix cdrom library" +fi +if test "x$enable_cd_mp3" = xyes; then + echo " - External player (wav|mp3|ogg...)" +fi +echo "" + +echo " * midi output:" +if test "x$enable_midi_raw" = xyes; then + echo " - raw midi interface" +fi +if test "x$enable_midi_seq" = xyes; then + echo " - OSS sequencer interface" +fi +if test "x$enable_midi_extp" = xyes; then + echo " - External MIDI Player" +fi +echo "" + +echo " * font device:" +if test "x$have_sdl" = xyes; then + if test "x$enable_gtk" = xyes; then + echo " - gtk(gdk) font" + fi +else + echo " - x11 font" +fi +if test "x$have_ttf" = xyes; then + echo " - old truetype font library" +fi +if test "x$no_ft" != xyes; then + echo " - freetype2 library" +fi +echo "" + +echo "----" + + + + + ac_config_files="$ac_config_files po/Makefile.in Makefile xsystem35.spec modules/ShArray/Makefile modules/ShCalc/Makefile modules/ShString/Makefile modules/ShPort/Makefile modules/nDEMO/Makefile modules/nDEMOE/Makefile modules/NIGHTDLL/Makefile modules/oujimisc/Makefile modules/RandMT/Makefile modules/Math/Makefile modules/Gpx/Makefile modules/MsgSkip/Makefile modules/ShSound/Makefile modules/ShGraph/Makefile modules/dDemo/Makefile modules/oDEMO/Makefile modules/SACT/Makefile modules/tDemo/Makefile modules/eDemo/Makefile modules/eeDemo/Makefile modules/Confirm/Makefile modules/AliceLogo/Makefile modules/NightDemonDemo/Makefile modules/lib/Makefile modules/Makefile src/Makefile macros/Makefile" + +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 diff $cache_file confcache >/dev/null 2>&1; 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 "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${INSIDE_GNOME_COMMON_TRUE}" && test -z "${INSIDE_GNOME_COMMON_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"INSIDE_GNOME_COMMON\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"INSIDE_GNOME_COMMON\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +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 "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"INSTALL_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"CONVENIENCE_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"CONVENIENCE_LTDL\" 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 +if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTK\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_GTK\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_VORBIS_TRUE}" && test -z "${HAVE_VORBIS_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_VORBIS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_VORBIS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_JPEG_TRUE}" && test -z "${ENABLE_JPEG_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"ENABLE_JPEG\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"ENABLE_JPEG\" 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 +ac_cs_recheck=false +ac_cs_silent=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 +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/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_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(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" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +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 + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# 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.59. 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 + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 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) + ac_cs_recheck=: ;; + --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;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # 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 + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "xsystem35.spec" ) CONFIG_FILES="$CONFIG_FILES xsystem35.spec" ;; + "modules/ShArray/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/ShArray/Makefile" ;; + "modules/ShCalc/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/ShCalc/Makefile" ;; + "modules/ShString/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/ShString/Makefile" ;; + "modules/ShPort/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/ShPort/Makefile" ;; + "modules/nDEMO/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/nDEMO/Makefile" ;; + "modules/nDEMOE/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/nDEMOE/Makefile" ;; + "modules/NIGHTDLL/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/NIGHTDLL/Makefile" ;; + "modules/oujimisc/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/oujimisc/Makefile" ;; + "modules/RandMT/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/RandMT/Makefile" ;; + "modules/Math/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Math/Makefile" ;; + "modules/Gpx/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Gpx/Makefile" ;; + "modules/MsgSkip/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/MsgSkip/Makefile" ;; + "modules/ShSound/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/ShSound/Makefile" ;; + "modules/ShGraph/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/ShGraph/Makefile" ;; + "modules/dDemo/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/dDemo/Makefile" ;; + "modules/oDEMO/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/oDEMO/Makefile" ;; + "modules/SACT/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/SACT/Makefile" ;; + "modules/tDemo/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/tDemo/Makefile" ;; + "modules/eDemo/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/eDemo/Makefile" ;; + "modules/eeDemo/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/eeDemo/Makefile" ;; + "modules/Confirm/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Confirm/Makefile" ;; + "modules/AliceLogo/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/AliceLogo/Makefile" ;; + "modules/NightDemonDemo/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/NightDemonDemo/Makefile" ;; + "modules/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/lib/Makefile" ;; + "modules/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "macros/Makefile" ) CONFIG_FILES="$CONFIG_FILES macros/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS 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 + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# 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. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&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,@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,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@VERSION_MA@,$VERSION_MA,;t t +s,@VERSION_MI@,$VERSION_MI,;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,@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,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@INSIDE_GNOME_COMMON_TRUE@,$INSIDE_GNOME_COMMON_TRUE,;t t +s,@INSIDE_GNOME_COMMON_FALSE@,$INSIDE_GNOME_COMMON_FALSE,;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,@subdirs@,$subdirs,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@INSTALL_LTDL_TRUE@,$INSTALL_LTDL_TRUE,;t t +s,@INSTALL_LTDL_FALSE@,$INSTALL_LTDL_FALSE,;t t +s,@CONVENIENCE_LTDL_TRUE@,$CONVENIENCE_LTDL_TRUE,;t t +s,@CONVENIENCE_LTDL_FALSE@,$CONVENIENCE_LTDL_FALSE,;t t +s,@LIBADD_DL@,$LIBADD_DL,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;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,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@LTDLINCL@,$LTDLINCL,;t t +s,@LIBLTDL@,$LIBLTDL,;t t +s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@MSGMERGE@,$MSGMERGE,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@LIBICONV@,$LIBICONV,;t t +s,@LTLIBICONV@,$LTLIBICONV,;t t +s,@INTLLIBS@,$INTLLIBS,;t t +s,@LIBINTL@,$LIBINTL,;t t +s,@LTLIBINTL@,$LTLIBINTL,;t t +s,@POSUB@,$POSUB,;t t +s,@X_CFLAGS@,$X_CFLAGS,;t t +s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t +s,@X_LIBS@,$X_LIBS,;t t +s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t +s,@ZLIB_LIBS@,$ZLIB_LIBS,;t t +s,@GLIB_CONFIG@,$GLIB_CONFIG,;t t +s,@GLIB_CFLAGS@,$GLIB_CFLAGS,;t t +s,@GLIB_LIBS@,$GLIB_LIBS,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@GLIB_GENMARSHAL@,$GLIB_GENMARSHAL,;t t +s,@GOBJECT_QUERY@,$GOBJECT_QUERY,;t t +s,@GLIB_MKENUMS@,$GLIB_MKENUMS,;t t +s,@GTK_CONFIG@,$GTK_CONFIG,;t t +s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t +s,@GTK_LIBS@,$GTK_LIBS,;t t +s,@HAVE_GTK_TRUE@,$HAVE_GTK_TRUE,;t t +s,@HAVE_GTK_FALSE@,$HAVE_GTK_FALSE,;t t +s,@SRC_MENU@,$SRC_MENU,;t t +s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t +s,@ALSA_LIBS@,$ALSA_LIBS,;t t +s,@ESD_CONFIG@,$ESD_CONFIG,;t t +s,@ESD_CFLAGS@,$ESD_CFLAGS,;t t +s,@ESD_LIBS@,$ESD_LIBS,;t t +s,@SRC_AUDIO@,$SRC_AUDIO,;t t +s,@SRC_CDROM@,$SRC_CDROM,;t t +s,@ALSAMIX_H@,$ALSAMIX_H,;t t +s,@SRC_MIDI@,$SRC_MIDI,;t t +s,@SDL_CONFIG@,$SDL_CONFIG,;t t +s,@SDL_CFLAGS@,$SDL_CFLAGS,;t t +s,@SDL_LIBS@,$SDL_LIBS,;t t +s,@SDL@,$SDL,;t t +s,@SRC_GRAPHDEV@,$SRC_GRAPHDEV,;t t +s,@JOY_S@,$JOY_S,;t t +s,@FT2_CONFIG@,$FT2_CONFIG,;t t +s,@FT2_CFLAGS@,$FT2_CFLAGS,;t t +s,@FT2_LIBS@,$FT2_LIBS,;t t +s,@FREETYPE_LIBS@,$FREETYPE_LIBS,;t t +s,@FREETYPE_INCLUDES@,$FREETYPE_INCLUDES,;t t +s,@SRC_FONT@,$SRC_FONT,;t t +s,@HAVE_NASM@,$HAVE_NASM,;t t +s,@SRC_ABLEND@,$SRC_ABLEND,;t t +s,@VORBIS_CFLAGS@,$VORBIS_CFLAGS,;t t +s,@VORBIS_LIBS@,$VORBIS_LIBS,;t t +s,@VORBISFILE_LIBS@,$VORBISFILE_LIBS,;t t +s,@VORBISENC_LIBS@,$VORBISENC_LIBS,;t t +s,@OGG_CFLAGS@,$OGG_CFLAGS,;t t +s,@OGG_LIBS@,$OGG_LIBS,;t t +s,@HAVE_VORBIS_TRUE@,$HAVE_VORBIS_TRUE,;t t +s,@HAVE_VORBIS_FALSE@,$HAVE_VORBIS_FALSE,;t t +s,@ENABLE_JPEG_TRUE@,$ENABLE_JPEG_TRUE,;t t +s,@ENABLE_JPEG_FALSE@,$ENABLE_JPEG_FALSE,;t t +s,@JPEG_CFLAGS@,$JPEG_CFLAGS,;t t +s,@JPEG_LIBS@,$JPEG_LIBS,;t t +s,@DEBUG_CFLAGS@,$DEBUG_CFLAGS,;t t +s,@EXTRACFLAGS@,$EXTRACFLAGS,;t t +s,@EXTRALIBS@,$EXTRALIBS,;t t +s,@EXTRALDFLAGS@,$EXTRALDFLAGS,;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 + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + 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; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + 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 <>$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 <>$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 diff $ac_file $tmp/config.h >/dev/null 2>&1; 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 +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +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'` + { 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 + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { 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 + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -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 + ;; + default-1 ) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + 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=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -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=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d $srcdir/$ac_dir || continue + + { echo "$as_me:$LINENO: configuring in $ac_dir" >&5 +echo "$as_me: configuring in $ac_dir" >&6;} + { 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 + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + cd $ac_dir + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'" + elif test -f $ac_srcdir/configure; then + ac_sub_configure="$SHELL '$ac_srcdir/configure'" + elif test -f $ac_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 +echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file=$ac_top_builddir$cache_file ;; + esac + + { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval $ac_sub_configure $ac_sub_configure_args \ + --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir || + { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 +echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} + { (exit 1); exit 1; }; } + fi + + cd $ac_popdir + done +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..92801e6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,1043 @@ +dnl +dnl configure.ac for xsystem35 +dnl ----- +AC_INIT(configure.ac) +AC_CANONICAL_TARGET + +dnl +dnl Require autoconf version 2.59 +dnl +AC_PREREQ(2.59) + +dnl +dnl EXTRAxxx is for misc CFLAGS and LIBS +dnl +EXTRACFLAGS= +EXTRALIBS= +EXTRALDFLAGS="-rdynamic" + +dnl +dnl versions +dnl +XSYS35_MAJOR=1 +XSYS35_MINOR=7 +XSYS35_MICRO=3 +XSYS35_EXTRA=pre5 + +XSYS35_VERSION=$XSYS35_MAJOR.$XSYS35_MINOR.$XSYS35_MICRO$XSYS35_EXTRA +VERSION_MA=$XSYS35_MAJOR.$XSYS35_MINOR.$XSYS35_MICRO +VERSION_MI=$XSYS35_EXTRA +AC_SUBST(VERSION_MA) +AC_SUBST(VERSION_MI) + +dnl +dnl For automake. +dnl +VERSION=$XSYS35_VERSION +PACKAGE=xsystem35 + +dnl +dnl Initialize automake stuff +dnl +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AM_CONFIG_HEADER(config.h) +AM_MAINTAINER_MODE + +dnl +dnl Pick up m4 macros +dnl +dnl AM_ACLOCAL_INCLUDE(m4) +AM_ACLOCAL_INCLUDE(macros) + +dnl +dnl add subdirectory for libltdl +dnl +dnl AC_CONFIG_SUBDIRS(libltdl) + +dnl +dnl Checks for programs. +dnl +AC_PROG_CC +dnl AC_PROG_INSTALL +dnl AC_PROG_MAKE_SET +dnl AC_ISC_POSIX +dnl AC_C_VAR_FUNC + +dnl +dnl Check for libltdl +dnl +AC_CONFIG_SUBDIRS(libltdl) +AC_LIBTOOL_DLOPEN +AC_LIBLTDL_CONVENIENCE([libltdl]) +AC_LIB_LTDL +AC_PROG_LIBTOOL +AC_SUBST([LTDLINCL]) +AC_SUBST([LIBLTDL]) + +dnl AM_PROG_LIBTOOL +dnl AC_SUBST(INCLTDL) +dnl AC_SUBST(LIBLTDL) +dnl AC_SUBST(LIBADD_DL) +dnl AC_LIBLTDL_INSTALLABLE +dnl AC_WITH_LTDL + +dnl +dnl Check for gettext +dnl +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.11.5) + +dnl +dnl Checks for header files. +dnl +AC_PATH_X + +dnl +dnl Checks for typedefs, structures, and compiler characteristics. +dnl +dnl AC_C_CONST +dnl AC_C_INLINE +dnl AC_TYPE_PID_T +dnl AC_TYPE_SIZE_T +dnl AC_HEADER_TIME +dnl AC_STRUCT_TM +AC_C_BIGENDIAN +AC_CHECK_HEADERS(libgen.h) + + +dnl +dnl Check X11 +dnl +AC_PATH_XTRA +AC_SUBST(X_CFLAGS) +AC_SUBST(X_LIBS) + +dnl +dnl Checks for library functions. +dnl +AC_CHECK_FUNCS(gettimeofday mkdtemp) + +dnl +dnl zlib +dnl +AC_CHECK_LIB(z, zlibVersion, + [ AC_CHECK_HEADER(zlib.h, + have_zlib=yes + ZLIB_LIBS="-lz",)], AC_MSG_ERROR(zlib needed)) +AC_SUBST(ZLIB_LIBS) + + + +dnl +dnl check pkg-config program +dnl +dnl AC_PATH_PROG(PKGCONFIG,pkg-config,no) +dnl enable_pkgc=no +dnl if test x"$PKGCONFIG" != "xno"; then +dnl AC_ARG_ENABLE(pkg-config, +dnl [ --enable-pkg-config Enable pkg-config for check glib|gtk [default=no]], +dnl [enable_pkgc=yes]) +dnl fi + +dnl +dnl check glib +dnl +no_glib12=no +must_gtk=no +AM_PATH_GLIB(1.2.0, + AC_DEFINE(ENABLE_GLIB,1,[Define this if you have glib >= 1.2.0]), + [AC_MSG_RESULT(No glib-1.2 found. Next check glib-2.0) + no_glib12=yes + ] + ) + +if test "x$no_glib12" = xyes; then + AM_PATH_GLIB_2_0(2.0.0, + AC_DEFINE(ENABLE_GLIB,1,[Define this if you have glib >= 1.2.0]), + [AC_MSG_RESULT(No glib-2.x found. Next check glib-1.0 in gtk) + must_gtk=yes + ] + ) +fi + +dnl if test x"$enable_pkgc" = "xno"; then +dnl AM_PATH_GLIB(1.2.0, +dnl AC_DEFINE(ENABLE_GLIB,1,[Define this if you have glib >= 1.2.0]),must_gtk=yes) +dnl if test x"$must_gtk" = "xyes"; then +dnl AC_MSG_RESULT("May be 1.0.x ?. You can't be disable gtk") +dnl fi +dnl else +dnl AC_ARG_WITH(glib-target, +dnl [ --with-glib-target target glib [default=glib]], +dnl [glibtarget="glib$withval"],[glibtarget="glib"]) +dnl PKG_CHECK_MODULES(BASE_DEPENDENCEIS, $glibtarget >= 1.2.0) +dnl GLIB_CFLAGS="`$PKGCONFIG --cflags $glibtarget`" +dnl GLIB_LIBS="`$PKGCONFIG --libs $glibtarget`" +dnl AC_DEFINE(ENABLE_GLIB,1,[Define this if you have glib >= 1.2.0]) +dnl fi + +dnl +dnl check for gtk +dnl +AC_ARG_ENABLE(gtk, + [ --enable-gtk Enable gtk-based widget [default=yes]],, + [enable_gtk=yes]) +if test "x$must_gtk" = xyes; then + if test "x$enable_gtk" != xyes; then + enable_gtk=yes + fi +fi + +no_gtk1x=no +have_gtk=no +if test "x$enable_gtk" = xyes; then + AM_PATH_GTK(1.0.0, + AC_DEFINE(ENABLE_GTK,1,[Define this if you have gtk+ >= 1.0.0]), + [AC_MSG_RESULT(No gtk-1.x found. Next check gtk-2.x) + no_gtk1x=yes + ] + ) + if test "x$no_gtk1x" = xyes; then + AM_PATH_GTK_2_0(2.0.0, + AC_DEFINE(ENABLE_GTK,1,[Define this if you have gtk+ >= 1.0.0]), + AC_MSG_ERROR(*** check for GTK failed ***) + ) + fi + have_gtk=yes +fi + + +dnl if test x"$enable_gtk" = "xyes"; then +dnl if test x"$enable_pkgc" = "xno"; then +dnl AM_PATH_GTK(1.0.0, +dnl AC_DEFINE(ENABLE_GTK,1,[Define this if you have gtk+ >= 1.0.0]), +dnl AC_MSG_ERROR(*** check for GTK failed ***)) +dnl else +dnl AC_ARG_WITH(gtk-target, +dnl [ --with-gtk-target target gtk+ [default=gtk+]], +dnl [gtktarget="gtk+$withval"],[gtktarget="gtk+"]) +dnl PKG_CHECK_MODULES(BASE_DEPENDENCEIS, $gtktarget >= 1.0.0) +dnl GTK_CFLAGS="`$PKGCONFIG --cflags $gtktarget`" +dnl GTK_LIBS="`$PKGCONFIG --libs $gtktarget`" +dnl AC_DEFINE(ENABLE_GTK,1,[Define this if you have gtk+ >= 1.0.0]) +dnl fi +dnl have_gtk=yes +dnl fi + +AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = xyes) +SRC_MENU= +if test "x$have_gtk" = xyes ; then + SRC_MENU="menu.c menu_callback.c menu_gui.c" +else + SRC_MENU="menu_null.c" +fi +AC_SUBST(SRC_MENU) + +dnl for gtk-1.0 +if test "x$must_gtk" = xyes; then + GLIB_CFLAGS="$GTK_CFLAGS" + GLIB_LIBS="$GTK_LIBS" +fi + + +dnl +dnl audio check +dnl +AC_ARG_ENABLE(audio, + [ --enable-audio[=mode_list] Enable audio (Specify comma separated mode list): + default: Automatically select audio device. + oss: OSS (Open Sound System) device + sun: sun style interface + alsa: ALSA pcm device + esd: EsounD], + [ enable_audio=$enableval], + [ enable_audio=yes]) + +dnl yes -> default +test "x$enable_audio" = xyes && enable_audio=default + +if test "x$enable_audio" != xno; then + for i in `echo $enable_audio | sed 's/,/ /g'`; do + eval "enable_$i=yes" + done + if test "x$enable_default" = xyes; then + enable_audio=default + fi +fi + +if test "x$enable_audio" = xdefault; then + case "$target" in + *-*-linux*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*) + enable_oss=yes + ;; + *-*-solaris*) + enable_sun=yes + ;; + *) + enable_esd=yes + ;; + esac +fi + + +dnl +dnl Sun style audio interface +dnl +have_sunaudio=no +if test "x$enable_sun" = xyes; then + AC_MSG_CHECKING(for Sun audio support) + AC_TRY_COMPILE([ + #include + #include + ],[ + audio_info_t audio_info; + AUDIO_INITINFO(&audio_info); + ],[ + have_sunaudio=yes + ]) + AC_MSG_RESULT($have_sunaudio) + if test "x$have_sunaudio" = xyes; then + AC_DEFINE(ENABLE_SUNAUDIO,1,[define this if you use sun stlye audio interface]) + fi +fi + + +dnl +dnl OSS +dnl +have_ossaudio=no +if test "x$enable_oss" = xyes; then + AC_MSG_CHECKING(for OSS audio support) + case "$target" in + *-*-netbsd*) + EXTRALIBS="$EXTRALIBS -lossaudio" + have_ossaudio=yes + ;; + *-*-openbsd*) + EXTRACFLAGS="$EXTRACFLAGS -I/usr/local/lib/oss/include" + EXTRALIBS="$EXTRALIBS -lossaudio" + have_ossaudio=yes + ;; + *-*-linux*|*-*-freebsd*) + have_ossaudio=yes + ;; + *) + have_ossaudio=no + ;; + esac + AC_MSG_RESULT($have_ossaudio) + if test "x$have_ossaudio" = xyes; then + AC_DEFINE(ENABLE_OSS,1,[define this if you use OSS audio interface]) + fi +fi + + +dnl +dnl ALSA +dnl +dnl if test x"$enable_alsa" = "xyes"; then +dnl AM_PATH_ALSA(0.5.0, +dnl [ AC_DEFINE(ENABLE_ALSA,1,[Define this if you have Alsa (libasound) installed]) +dnl if test x"$have_alsa09" = "xyes"; then +dnl AC_DEFINE(ENABLE_ALSA09,1,[Define this if you have alsa 0.9.x and more installed]) +dnl fi +dnl if test x"$have_alsa05" = "xyes"; then +dnl AC_DEFINE(ENABLE_ALSA05,1,[Define this if you have alsa 0.5.x installed]) +dnl fi +dnl ], +dnl AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***)) +dnl fi + +if test "x$enable_alsa" = xyes; then + AM_PATH_ALSA(0.9.0, + [ AC_DEFINE(ENABLE_ALSA09,1,[Define this if you have alsa 0.9.x and more installed]) + have_alsa09=yes + ], + have_alsa09=no) + if test "x$have_alsa09" = xno; then + AM_PATH_ALSA(0.5.0, + [ AC_DEFINE(ENABLE_ALSA05,1,[Define this if you have 0.5.x <= alsa < 0.9.0 installed]) + have_alsa05=yes + ], + have_alsa05=no) + fi + if test "x$have_alsa09" = xno -a "x$have_alsa05" = xno; then + AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***) + else + AC_DEFINE(ENABLE_ALSA,1,[Define this if you have Alsa (libasound) installed]) + fi +fi + + +dnl +dnl ESD +dnl +no_esd=yes +if test "x$enable_esd" = xyes; then + AM_PATH_ESD(0.2.8, + AC_DEFINE(ENABLE_ESD,1,[Define this if you have ESD (libesd) installed]), + AC_MSG_RESULT(*** All of ESD dependent parts will be disabled ***)) +fi + + +dnl +dnl Turn on default audio output mode +dnl +DEFAULT_PLAYMODE= +AC_ARG_WITH(default-output, + [ --with-default-output= Specify default output mode (optional): + default|oss|alsa|esd|sun], + [ if test "$enable_audio" != no; then + DEFAULT_PLAYMODE=$withval + eval "enable_$DEFAULT_PLAYMODE=yes" + else + AC_MSG_WARN(--with-default-output=$withval: audio is not enabled) + fi] +) +AC_MSG_CHECKING(default output mode) +if test "x$DEFAULT_PLAYMODE" = x; then + DEFAULT_PLAYMODE=`echo $enable_audio | sed 's/,.*//'` +fi +case ".$DEFAULT_PLAYMODE" in + .default) def_am=AUDIO_PCM_ANY ;; + .oss) def_am=AUDIO_PCM_OSS ;; + .alsa) def_am=AUDIO_PCM_ALSA ;; + .esd) def_am=AUDIO_PCM_ESD ;; + .sun) def_am=AUDIO_PCM_SUN ;; + *) def_am= ;; +esac +if test "x$have_alsa09" = xyes; then + if test "x$def_am" != x; then + def_am="$def_am09" + fi +fi +AC_MSG_RESULT($def_am) +if test "x$def_am" != x; then + AC_DEFINE_UNQUOTED(DEFAULT_AUDIO_MODE, $def_am, [default audio mode]) +fi + + + +dnl +dnl OSS/ALSA/ESD +dnl +SRC_AUDIO= +if test "x$have_ossaudio" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_oss.c" +fi +if test "x$have_sunaudio" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_sun.c" +fi +if test "x$have_alsa05" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_alsa.c" +fi +if test "x$have_alsa09" = xyes; then + SRC_AUDIO="$SRC_AUDIO audio_alsa09.c" +fi +if test "x$no_esd" != xyes; then + SRC_AUDIO="$SRC_AUDIO audio_esd.c" +fi +AC_SUBST(SRC_AUDIO) + +dnl +dnl cdrom device +dnl +AC_ARG_ENABLE(cdrom, + [ --enable-cdrom[=mode_list] Enable CD-adio (Specify comma separated mode list): + (default: Automatically select cdrom device) + linux: linux API (Linux/Solaris) + bsd: BSD API (FreeBSD/NetBSD/OpenBSD) + irix: IRIX API + mp3: play mp3 file using external/piped player], + [ enable_cdrom=$enableval], + [ enable_cdrom=yes]) + +dnl yes -> default +test "x$enable_cdrom" = xyes -a enable_cdrom=default + +if test "x$enable_cdrom" != xno; then + for i in `echo $enable_cdrom | sed 's/,/ /g'`; do + eval "enable_cd_$i=yes" + done + if test "x$enable_cd_default" = xyes; then + enable_cdrom=default + fi +fi + +if test "x$enable_cdrom" = xdefault; then + case "$target" in + *-*-linux*|*-*-solaris*) + enable_cd_linux=yes + ;; + *-*-freebsd*|*-*-netbsd*|*-*-openbsd*) + enable_cd_bsd=yes + ;; + *-irix*) + enable_cd_irix=yes + ;; + *-dec-*) + enable_cd_mp3=yes + ;; + *) + AC_MSG_WARN(No --enable-cdrom=default cdrom for $target) + ;; + esac +fi + +SRC_CDROM= +if test "x$enable_cd_linux" = xyes; then + SRC_CDROM="cdrom.Linux.c" + AC_DEFINE(ENABLE_CDROM_LINUX,1,[Define this if your use cdrom ioctl in linux or Solaris]) +elif test "x$enable_cd_bsd" = xyes; then + SRC_CDROM="$SRC_CROM cdrom.FreeBSD.c" + AC_DEFINE(ENABLE_CDROM_BSD,1,[Define this if you use cdrom iotctl in *BSD]) +elif test "x$enable_cd_irix" = xyes; then + SRC_CDROM="$SRC_CDROM cdrom.Irix.c" + AC_DEFINE(ENABLE_CDROM_IRIX,1,[Define this if you use cdrom ctrl library in IRX]) +else + SRC_CDROM="$SRC_CDROM cdrom.empty.c" +fi +if test "x$enable_cd_mp3" = xyes; then + SRC_CDROM="$SRC_CDROM cdrom.mp3.c" + AC_DEFINE(ENABLE_CDROM_MP3,1,[Define this if you use external player for cdrom audio]) +fi +AC_SUBST(SRC_CDROM) + +AC_ARG_WITH(cdromdev, [ --with-cdromdev=# CDROM Device Name. [default=/dev/cdrom]], cdromdev="$withval",cdromdev="/dev/cdrom") +AC_DEFINE_UNQUOTED(CDROM_DEVICE,"$cdromdev",[cdrom device]) + +dnl +dnl Check if X_LOCALE definition is necessary +dnl +AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use(ex. ja_JP.ujis) ]) +AC_MSG_CHECKING(need -DX_LOCALE) + +AC_TRY_RUN([ +#include +#include + +int +main () +{ + return setlocale (LC_ALL, "${with_locale}") == NULL; +}], +need_x_locale=no, +need_x_locale=yes, +need_x_locale=no) +AC_MSG_RESULT($need_x_locale) + +if test "x$need_x_locale" = xyes; then + EXTRACFLAGS="$EXTRACFLAGS -DX_LOCALE" +fi + +dnl +dnl OS dependent param +dnl +case "$target" in + *-*-linux*) + ;; + *-*-freebsd*) + EXTRALIBS="$EXTRALIBS -lxpg4" + EXTRACFLAGS="$EXTRACFLAGS -I/usr/local/include" + EXTRALDFLAGS="$EXTRALDFLAGS -L/usr/local/lib" + ;; + *-irix*) + chk_rgb=yes + EXTRALIBS="$EXTRALIBS -lcdaudio -lds -lmediad" + ;; + sparc-*) + chk_rgb=yes + ;; +esac + +dnl +dnl Force to set Color RGB order (need to check for sparc) +dnl +if test "x$chk_rgb" = xyes; then + AC_ARG_ENABLE(bgr, + [ --enable-bgr Color order is BGR [default is no for most arch] + You should check whether your X server is RGB or + BGR order, especially in sparc architecture.],, + [ enable_bgr=yes ]) +fi +if test "x$enable_bgr" = xyes; then + AC_DEFINE(BGR_ORDER,1,[Define this if X11 Pixmap color order is BGR]) +else + AC_DEFINE(RGB_ORDER,1,[Define this if X11 Pixmap color order is RGB]) +fi + +dnl +dnl set ALSA param +dnl +if test "x$have_alsa" = xyes ; then + AC_ARG_WITH(alsa-card, [ --with-alsa-card=# ALSA Card No.], + alsacard="$withval",alsacard="0") + AC_ARG_WITH(alsa-pcmdev, [ --with-alsa-pcmdev=# ALSA PCM device No.], + alsapcmdev="$withval",alsapcmdev="0") + AC_ARG_WITH(alsa-mixerdev,[ --with-alsa-mixerdev=# ALSA Mixer device No.], + alsamixerdev="$withval",alsamixerdev="0") + ALSACARD=$alsacard + AC_DEFINE_UNQUOTED(ALSACARD,"$alsacard",[alsa card no]) + MIXERDEV_ALSA=$alsamixerdev + AUDIODEV_ALSA=$alsapcmdev + AC_DEFINE_UNQUOTED(AUDIODEV_ALSA,"$AUDIODEV_ALSA",[aduio device]) + AC_DEFINE_UNQUOTED(MIXERDEV_ALSA,"$MIXERDEV_ALSA",[mixer device]) + AC_CHECK_LIB(asound,snd_mixer_element_read,ALSAMIX_H=mixer_alsa.h) + AC_SUBST(ALSAMIX_H) +fi + +dnl +dnl set OSS param +dnl +if test "x$have_ossaudio" = xyes ; then + AC_ARG_WITH(audiodev,[ --with-oss-audiodev=DEVFILE DSP DEVICE], + audiodev="$withval",ossaudiodev="/dev/dsp") + AC_ARG_WITH(mixerdev,[ --with-oss-mixerdev=DEVFILE MIXER DEVICE], + mixerdev="Ec$withval",ossmixerdev="/dev/mixer") + AUDIODEV_OSS=$ossaudiodev + MIXERDEV_OSS=$ossmixerdev + AC_DEFINE_UNQUOTED(AUDIODEV_OSS,"$AUDIODEV_OSS",[aduio device]) + AC_DEFINE_UNQUOTED(MIXERDEV_OSS,"$MIXERDEV_OSS",[mixer device]) +fi + + +dnl +dnl Select Midi Play Methods +dnl +AC_ARG_ENABLE(midi, + [ --enable-midi[=mode_list] Enable midi (Specify comma separated mode list): + extp: External midi player(default) + raw: Raw midi interface + seq: Sequencer interface], + [ enable_midi=$enableval], + [ enable_midi=yes]) + +dnl yes -> default +test "x$enable_midi" = xyes && enable_midi=default + +if test "x$enable_midi" != xno; then + for i in `echo $enable_midi | sed 's/,/ /g'`; do + eval "enable_midi_$i=yes" + done +fi + +if test "x$enable_midi" = xdefault; then + case "$target" in + *) + enable_midi_extp=yes + ;; + esac +fi + +SRC_MIDI= +if test "x$enable_midi_extp" = xyes; then + SRC_MIDI="midi.extplayer.c" + AC_DEFINE(ENABLE_MIDI_EXTPLAYER,1,[define this if you use external midi player]) +fi +if test "x$enable_midi_raw" = xyes || test "x$enable_midi_seq" = xyes; then + SRC_MIDI="$SRC_MIDI midi.rawmidi.c midifile.c" + if test "x$enable_midi_raw" = xyes; then + AC_DEFINE(ENABLE_MIDI_RAWMIDI,1,[define this if you use oss raw midi interface]) + fi + if test "x$enable_midi_seq" = xyes; then + AC_DEFINE(ENABLE_MIDI_SEQMIDI,1,[define thsi if you use oss sequencer interface]) + fi +fi +AC_SUBST(SRC_MIDI) + +dnl +dnl set midi player +dnl +AC_ARG_WITH(midi-player,[ --with-midi-player=xxx External Midi Player [default=playmidi -4]], + midiplayer="$withval",midiplayer="playmidi -4") +AC_DEFINE_UNQUOTED(MIDI_PLAYER,"$midiplayer",[midi player]) + +dnl +dnl Quiet mode for external midi player +dnl +AC_ARG_ENABLE(qmidi,[ --enable-qmidi No display midi stdout], + AC_DEFINE(QUITE_MIDI,1,[define this if you stop midi stdout])) + +dnl +dnl Midi device for rawmidi mode +dnl +AC_ARG_WITH(mididev, [ --with-mididev=# MIDI Raw Device Name. [default=/dev/midi]], mididev="$withval", mididev="/dev/midi") +AC_DEFINE_UNQUOTED(MIDI_DEVICE,"$mididev",[midi device]) + +dnl +dnl Sequencer device for seqmidi mode +dnl +AC_ARG_WITH(seqdev, [ --with-seqdev=# MIDI Sequencer Device Name. [default=/dev/sequencer]], mididev="$withval", seqdev="/dev/sequencer") +AC_DEFINE_UNQUOTED(SEQ_DEVICE,"$seqdev",[sequencer device]) + + +dnl +dnl general cachae size +dnl +AC_ARG_WITH(cachesize,[ --with-cachesize=# General Cache size (MB)], + AC_DEFINE_UNQUOTED(CACHE_TOTALSIZE,$withval,[General Cache size (MB)])) + + +dnl +dnl SDL +dnl +SRC_GRAPHDEV="xcore_draw.c xcore_video.c xcore_mode.c xcore_event.c xcore_cursor.c xcore_maskupdate.c image.c" +AC_ARG_ENABLE(sdl, + [ --enable-sdl SDL [default=no] ],, + [ enable_sdl=no ]) +if test "x$enable_sdl" = xyes ; then + KEEPLIBS=$LIBS + KEEPCFLAGS=$CFLAGS + KEEPLDFLAGS=$LDFLAGS + AM_PATH_SDL(1.0.0,have_sdl=yes,have_sdl=no) + LIBS=$SDL_LIBS + CFLAGS=$SDL_CFLAGS + AC_CHECK_LIB(SDL,SDL_NumJoysticks,have_sdljoy=yes) + AC_MSG_CHECKING(for SDL RLE accell) + sdlrle=no + sdlralpha=no + AC_TRY_RUN([ +#include +int main( int argc,char **argv) { +#ifndef SDL_RLEACCEL + exit(1); +#else + exit(0); +#endif +} + ], + AC_MSG_RESULT("yes");sdlrle=yes, + AC_MSG_RESULT("no"), + AC_MSG_RESULT("unknown") + ) + if test "x$sdlrle" = xyes ; then + AC_MSG_CHECKING(for SDL alpha value) + AC_TRY_RUN([ +#include +int main( int argc,char **argv) { + SDL_Surface *s1,*s2; + unsigned short *x; + s1=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); + s2=SDL_AllocSurface(SDL_SWSURFACE,8,8,16,0,0,0,0); + SDL_FillRect(s1,NULL,0); + SDL_FillRect(s2,NULL,0xFFFF); + SDL_SetAlpha(s2,SDL_SRCALPHA|SDL_RLEACCEL,255); + SDL_BlitSurface(s2,NULL,s1,NULL); + x=s1->pixels; + if( *x ) + exit(1); + exit(0); +} + ], + AC_MSG_RESULT("normal"), + AC_MSG_RESULT("revese");sdlralpha=yes, + AC_MSG_RESULT("unknown") + ) + fi + LIBS=$KEEPLIBS + CFLAGS=$KEEPCFLAGS + LDFLAGS=$KEEPLDFLAGS +fi +if test "x$have_sdl" = xyes ; then + AC_DEFINE(ENABLE_SDL,1,[define this if you use SDL]) + SDL=1 + SRC_GRAPHDEV="sdl_video.c sdl_mode.c sdl_draw.c sdl_event.c sdl_image.c sdl_cursor.c image.c" + AC_SUBST(SDL) + if test "x$sdlrle" = xyes ; then + AC_DEFINE(HAVE_SDLRLE,1,[define this if you have SDLRLE]) + fi + if test "x$sdlralpha" = xyes ; then + AC_DEFINE(HAVE_SDLRALPHA,1,[define this if you have SDLRALPHA]) + fi +fi +AC_SUBST(SRC_GRAPHDEV) + +dnl +dnl joystick +dnl +AC_ARG_ENABLE(joy, + [ --enable-joy Use joystick (only linux and SDL) [default=no]],, + [ enable_joy=no] ) +if test "x$enable_joy" = xyes ; then + if test "x$have_sdljoy" = xyes ; then + AC_DEFINE(HAVE_SDLJOY,1,[define this if you use SDL joystick interface]) + JOY_S=joystick_sdl + else + AC_CHECK_HEADERS(linux/joystick.h, + [JOY_S=joystick_linux], + [JOY_S=joystick_dmy]) + fi +else + JOY_S=joystick_dmy +fi +AC_SUBST(JOY_S) + +AC_ARG_WITH(joydev, [ --with-joydev=# Joystick Device Name. [default=/dev/js0]], joydev="$withval",joydev="/dev/js0") +AC_DEFINE_UNQUOTED(JOY_DEVICE,"$joydev",[joystick device]) + + +dnl +dnl FreeType (Font) +dnl +have_ttf=no +SRC_FONT= +if test "x$have_sdl" = xyes; then + if test "x$enable_gtk" = xyes; then + SRC_FONT="font_gtk.c" + AC_DEFINE(ENABLE_GTKFONT,1,[define this if you use gtk(gdk) font interface]) + fi +else + SRC_FONT="font_x11.c" + AC_DEFINE(ENABLE_X11FONT,1,[define this if you use X11 font interface]) +fi +AC_CHECK_FT2(2.0.0, + AC_DEFINE(ENABLE_FT2,1,[Define this if you have freetype2 installed])) +if test "x$no_ft" = xyes; then + AM_PATH_FREETYPE(1.0.0, + AC_DEFINE(ENABLE_TTF,1,[Define this if you have old(1.x) freetype installed]) have_ttf=yes,have_ttf=no) +fi +if test "x$no_ft" != xyes; then + SRC_FONT="$SRC_FONT font_freetype2.c cp932tojis0213.c" + EXTRALIBS="$EXTRALIBS $FT2_LIBS" + EXTRACFLAGS="$EXTRACFLAGS $FT2_CFLAGS" +elif test "x$have_ttf" = xyes; then + SRC_FONT="$SRC_FONT font_ttf.c" + EXTRALIBS="$EXTRALIBS $FREETYPE_LIBS" + EXTRACFLAGS="$EXTRACFLAGS $FREETYPE_INCLUDES" +fi +dnl +dnl check null +if test x"SRC_FONT" = "x"; then + AC_MSG_ERROR("*** No font device available ***"); +fi +AC_SUBST(SRC_FONT) + + +dnl +dnl XFree86extendions +dnl +AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, + [ AC_DEFINE(HAVE_XF86VMODE,1,[Define this if you have libXxf86vm installed]) + XXF86VM_LIB="-lXxf86vm"],, + $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS) +X_LIBS="$X_LIBS $XXF86VM_LIB -lXext" + +AC_ARG_ENABLE(xrender, + [ --enable-xrender Use XRender extension (future work) [default=disable]],, + enable_xrender="no") +if test "x$enable-xrender" = xyes; then + AC_DEFINE(ENABLE_XRENDER,1,[define this if you use X11 render etension]) +fi + + +dnl +dnl MMX +dnl +SRC_ABLEND= +AC_PATH_PROG(HAVE_NASM,nasm,no) +if test "x$HAVE_NASM" != xno; then + case "$target" in + *i*86-*) + AC_ARG_ENABLE(mmx, + [ --enable-mmx MMX support [default=yes]],, + [ enable_mmx=yes ]) + if test "x$enable_mmx" = xyes ; then + AC_DEFINE(ENABLE_MMX,1,[define this if you want to use MMX instructions]) + SRC_ABLEND="alpha_blend16.s haveunit.s" + fi;; + esac +fi +AC_SUBST(SRC_ABLEND) + + +dnl +dnl Vorbis input +dnl +AM_PATH_OGG( + [ AM_PATH_VORBIS([], + AC_MSG_ERROR([OGG/VORBIS needed])) + ], + AC_MSG_ERROR([OGG/VORBIS needed])) +AM_CONDITIONAL(HAVE_VORBIS, [test "x$no_ogg" != xyes -a "x$no_vorbis" != xyes]) + +dnl +dnl Test for libjpeg +dnl +JPEG_CFLAGS="" +JPEG_LIBS="" +available_jpeg=no +AC_ARG_WITH(libjpeg-prefix, + [ --with-libjpeg-prefix=PFX Prefix where libjpeg is install(optional)], libjpeg_prefix="$withval", libjpeg_prefix="") + +if test "x$libjpeg_prefix" != x ; then + JPEG_CFLAGS="-I$libjpeg_prefix/include" + JPEG_LIBS="-L$libjpeg_prefix/lib" +fi + +ac_save_CFLAGS="$CFLAGS" +ac_save_LIBS="$LIBS" +CFLAGS="$CFLAGS $JPEG_CFLAGS" +LIBS="$LIBS $JPEG_LIBS" + +AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, + available_jpeg=yes, + available_jpeg=no) + +if test "x$available_jpeg" = xyes; then + AC_MSG_CHECKING([for jpeglib.h]) + AC_TRY_CPP( +[#include +#undef PACKAGE +#undef VERSION +#undef HAVE_STDLIB_H +#include ], + available_jpeg=yes, + available_jpeg=no) + AC_MSG_RESULT($available_jpeg) + if test "x$available_jpeg" = xyes; then + JPEG_LIBS="$JPEG_LIBS -ljpeg" + fi +fi +CFLAGS="$ac_save_CFLAGS" +LIBS="$ac_save_LIBS" + +if test "x$available_jpeg" != xyes; then + AC_MSG_ERROR(libjpeg needed) +fi + +AM_CONDITIONAL(ENABLE_JPEG, test "x$available_jpeg" = xyes) +AC_SUBST(JPEG_CFLAGS) +AC_SUBST(JPEG_LIBS) + +enable_jpeg=$available_jpeg + + +dnl +dnl debugging +dnl +AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging [default=no]],,enable_debug=no) + +if test "x$enable_debug" = xyes; then + DEBUG_CFLAGS="-g" + if test "x$GCC" = xyes; then + DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall" + fi + AC_DEFINE(DEBUG,1,[Define this if you want to Debug]) +else + CFLAGS="`echo $CFLAGS | sed 's/-g//g'`" + DEBUG_CFLAGS="" +fi +AC_SUBST(DEBUG_CFLAGS) + + +dnl +dnl Some infos: +dnl +echo "xsystem35 summary:" +echo "------------------" + +dnl Audio +echo " * audio output:" +if test "x$have_ossaudio" = xyes; then + echo " - oss (Open Sound System)" +fi +if test "x$have_sunaudio" = xyes; then + echo " - sun ()" +fi +if test "x$no_alsa" != xyes; then + if test "x$have_alsa05" = xyes; then + echo " - alsa05 (Alsa 0.5.x)" + fi + if test "x$have_alsa09" = xyes; then + echo " - alsa09 (Alsa 0.9.x)" + fi +fi +if test "x$no_esd" != xyes; then + echo " - esd (Enlightened Sound Daemon)" +fi +echo "" + +dnl CDROM +echo " * cdrom output:" +if test "x$enable_cd_linux" = xyes; then + echo " - Linux|Solaris ioctl" +fi +if test "x$enable_cd_bsd" = xyes; then + echo " - *BSD ioctl" +fi +if test "x$enable_cd_irix" = xyes; then + echo " - Irix cdrom library" +fi +if test "x$enable_cd_mp3" = xyes; then + echo " - External player (wav|mp3|ogg...)" +fi +echo "" + +dnl MIDI +echo " * midi output:" +if test "x$enable_midi_raw" = xyes; then + echo " - raw midi interface" +fi +if test "x$enable_midi_seq" = xyes; then + echo " - OSS sequencer interface" +fi +if test "x$enable_midi_extp" = xyes; then + echo " - External MIDI Player" +fi +echo "" + +dnl font +echo " * font device:" +if test "x$have_sdl" = xyes; then + if test "x$enable_gtk" = xyes; then + echo " - gtk(gdk) font" + fi +else + echo " - x11 font" +fi +if test "x$have_ttf" = xyes; then + echo " - old truetype font library" +fi +if test "x$no_ft" != xyes; then + echo " - freetype2 library" +fi +echo "" + +echo "----" + +AC_SUBST(EXTRACFLAGS) +AC_SUBST(EXTRALIBS) +AC_SUBST(EXTRALDFLAGS) +AC_CONFIG_FILES([ +po/Makefile.in +Makefile +xsystem35.spec +modules/ShArray/Makefile +modules/ShCalc/Makefile +modules/ShString/Makefile +modules/ShPort/Makefile +modules/nDEMO/Makefile +modules/nDEMOE/Makefile +modules/NIGHTDLL/Makefile +modules/oujimisc/Makefile +modules/RandMT/Makefile +modules/Math/Makefile +modules/Gpx/Makefile +modules/MsgSkip/Makefile +modules/ShSound/Makefile +modules/ShGraph/Makefile +modules/dDemo/Makefile +modules/oDEMO/Makefile +modules/SACT/Makefile +modules/tDemo/Makefile +modules/eDemo/Makefile +modules/eeDemo/Makefile +modules/Confirm/Makefile +modules/AliceLogo/Makefile +modules/NightDemonDemo/Makefile +modules/lib/Makefile +modules/Makefile +src/Makefile +macros/Makefile +]) +AC_OUTPUT diff --git a/contrib/20cDPS.inf b/contrib/20cDPS.inf new file mode 100644 index 0000000..7302b95 --- /dev/null +++ b/contrib/20cDPS.inf @@ -0,0 +1,7 @@ +# 20世紀アリス これDPS? Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ald, 20cDPS_sa.ald +GraphicsA, gamedata/*GA.ald, 20cDPS_ga.ald +MidiA, gamedata/*MA.ald, 20cDPS_ma.ald +SaveA, , 20cDPS_sa.asd +Ain, gamedata/*.ain, system39.ain diff --git a/contrib/20cKaeru.inf b/contrib/20cKaeru.inf new file mode 100644 index 0000000..f70168c --- /dev/null +++ b/contrib/20cKaeru.inf @@ -0,0 +1,10 @@ +# 20世紀アリス かえるにょ国にょアリス Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ald, 20cKaeru_sa.ald +GraphicsA, gamedata/*GA.ald, 20cKaeru_ga.ald +WaveA, gamedata/*WA.ald, 20cKaeru_wa.ald +MidiA, gamedata/*MA.ald, 20cKaeru_ma.ald +DataA, gamedata/*DA.ald, 20cKaeru_da.ald +Ain, gamedata/*.ain, system39.ain +SaveA, , 20cKaeru_sa.asd +SaveZ, , 20cKaeru_sz.asd diff --git a/contrib/456atlach.inf b/contrib/456atlach.inf new file mode 100644 index 0000000..c7d69e1 --- /dev/null +++ b/contrib/456atlach.inf @@ -0,0 +1,14 @@ +# ATLACH-NACHA Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, atlach_sa.ald +GraphicsA, gamedata/*ga.ald, atlach_ga.ald +GraphicsB, gamedata/*gb.ald, atlach_gb.ald +WaveA, gamedata/*wa.ald, atlach_wa.ald +SaveA, , atlach_sa.asd +SaveB, , atlach_sb.asd +SaveC, , atlach_sc.asd +SaveD, , atlach_sd.asd +SaveE, , atlach_se.asd +SaveF, , atlach_sf.asd +SaveG, , atlach_sg.asd +SaveH, , atlach_sh.asd diff --git a/contrib/456ningen.inf b/contrib/456ningen.inf new file mode 100644 index 0000000..b93a54e --- /dev/null +++ b/contrib/456ningen.inf @@ -0,0 +1,6 @@ +# Ningen Kari Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, ningen_sa.ald +GraphicsA, gamedata/*ga.ald, ningen_ga.ald +WaveA, gamedata/*wa.ald, ningen_wa.ald +SaveA, , ningen_sa.asd diff --git a/contrib/456zero.inf b/contrib/456zero.inf new file mode 100644 index 0000000..982809d --- /dev/null +++ b/contrib/456zero.inf @@ -0,0 +1,12 @@ +# Zero-shiki Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, zero_sa.ald +GraphicsA, gamedata/*ga.ald, zero_ga.ald +WaveA, gamedata/*wa.ald, zero_wa.ald +SaveA, , zero_sa.asd +SaveB, , zero_sb.asd +SaveC, , zero_sc.asd +SaveD, , zero_sd.asd +SaveE, , zero_se.asd +, gamedata/map_data.dat, MAP_DATA.DAT +, gamedata/ur_data.dat, UR_DATA.DAT diff --git a/contrib/README.TXT b/contrib/README.TXT new file mode 100644 index 0000000..fc38b1a --- /dev/null +++ b/contrib/README.TXT @@ -0,0 +1,115 @@ + $B%2!<%`%G!<%?%$%s%9%H!<%kMQ%9%/%j%W%H(B instgame $B$N;H$$J}$K$D$$$F(B + + $B%9%/%j%W%H:n@.(B $BF`NILZ(B $B$5$s(B + $B%I%-%e%a%s%H:n@.(B $B6a4V(B@NAIST +0. $BL\$N>pJs(B + 4. $BCx:n8"$J$I(B + 5. $BO"Mm@h(B + + +1. $B%U%!%$%k$N@bL@(B + + instgame $B%9%/%j%W%HK\BN(B + 456atlach.inf ATLACH-NACHA $BMQ@_Dj%U%!%$%k(B ($B%"%j%9$N4[(B456$B<}O?(B) + 456ningen.inf $B?M4V$,(B~/game/$B$N2<$N%G%#%l%/%H%jL>$K(B + $B$J$j$^$9!#(B + + $B$3$l$i$N%G%U%)%k%H$N>r7o$rJQ$($k$K$O0J2<$N%*%W%7%g%s$r;H$$$^$9!#(B + + -c : CD-ROM$B$N%^%&%s%H$5$l$F$$$k0LCV$r;XDj$7$^$9(B(default: -c /cdrom) + -d : $B%2!<%`%G!<%?$N%$%s%9%H!<%k@h$r;XDj$7$^$9(B (default: -d ~/game/target>) + + $B%G!<%?$,@5>o$K%3%T!<$5$l$k$H!"(B~/game/$B$N2<$K(Bkichiku.gr$B$H8@$&%U%!%$%k$,:n@.(B + $B$5$l$^$9!#$3$l$O%2!<%`%G!<%?$N>l=j$r%W%m%0%i%`(B(xsystem35)$B$KCN$i$;$k$?$a$N$b(B + $B$N$G!"(B + % xsystem35 -gamefile ~/game/kichiku.gr + $B$N$h$&$K;XDj$9$k$N$K;H$$$^$9!#(B($B!V%2!<%`%j%=!<%9%U%!%$%k!W$H$G$b8F$s$G2<$5$$(B) + + $B%G%U%)%k%H$G$O!"(B*.gr$B$H$$$&%U%!%$%k$b@_DjMQ%U%!%$%k$N%U%!%$%kL>$HF1$8L>A0$K(B + $B$J$j$^$9$,!"0J2<$N%*%W%7%g%s$GJQ992DG=$G$9!#(B + + -g : $B%2!<%`%j%=!<%9%U%!%$%k$N%U%!%$%kL>$r;XDj$7$^$9(B + (default: -g ~/game/.inf) + + +3. $B$=$NB>$N>pJs(B + + $B$=$NB>$N%*%W%7%g%s$K!";XDj$N%U%!%$%k$O(BCD-ROM$B$+$i%3%T!<$;$:$K%j%s%/$rD%$k!"(B + $B$H$$$&;XDj$,=PMh$^$9!#(B + + % ./instgame -k Graphics kichiku.inf + + $B$H$9$k$H!"(Bkichiku_ga.ald $B$H(B kichiku_gb.ald $B$N%U%!%$%k$O%3%T!<$5$l$:$K!"(B + CD-ROM$B>e$N%G!<%?$X$N%7%s%\%j%C%/%j%s%/$K$J$j$^$9!#$?$@$7!"$=$&$9$k$H%2!<%`Cf(B + $B$O(BCD-ROM$B$r%^%&%s%H$7$F$*$+$J$1$l$P$J$i$J$$$N$G!"(BCD-ROM$B$r%^%&%s%H$7$?$^$^(B + CD-DA$B$N1iAU2DG=$J0lIt$N%7%9%F%`$G$N$_2DG=$G$9!#(B + + + $B$3$N%*%W%7%g%s$O%2!<%`%G!<%?$N%$%s%9%H!<%k;~$NF0:n$r5,Dj$9$k$b$N$J$N$G!"(B + $B<+J,$G(BCD-ROM$B$+$i%U%!%$%k$r%3%T!<$7$F!"%2!<%`%j%=!<%9%U%!%$%k$r%(%G%#%?$G(B + $BJT=8$9$l$P!"A4$/<+M3$K%G!<%?$NG[CV$r9T$J$&;v$,=PMh$^$9!#$b$A$m$s!"%2!<%`(B + $B%j%=!<%9%U%!%$%k$N%U%!%$%kL>$dCV$->l=j$b<+M3$K$7$F=PMh$^$9!#(B + $B%2!<%`%j%=!<%9%U%!%$%k$N=q<0$K$D$$$F$O(B doc/GRFMT.TXT $B$r8fMw2<$5$$!#(B + + +4. $BCx:n8"$J$I(B + + instgame$B$O(B $BF`NILZ(B $B$5$s$,$D$/$i$l$?$b$N$G$9$N$G!"Cx:n8"$OF`NILZ$5$s$K(B + $BB0$7$^$9!#F`NILZ$5$s$N0U8~$K$h$j!"(BGPL$B$K4p$E$$$F:FG[I[2DG=$G$9!#(B + + $B%I%-%e%a%s%H$NITHw$O;d(B($B6a4V(B)$B$^$G$I$&$>!#(B + + +5. $BO"Mm@h(B + + $BF`NILZ$5$s(B + $B6a4V(B@NAIST diff --git a/contrib/ambi.inf b/contrib/ambi.inf new file mode 100644 index 0000000..eb1db18 --- /dev/null +++ b/contrib/ambi.inf @@ -0,0 +1,18 @@ +# AmbivalenZ Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, ambi_sa.ald +GraphicsA, gamedata/*ga.ald, ambi_ga.ald +SaveA, , ambi_sa.asd +SaveB, , ambi_sb.asd +SaveC, , ambi_sc.asd +SaveD, , ambi_sd.asd +SaveE, , ambi_se.asd +SaveF, , ambi_sf.asd +SaveG, , ambi_sg.asd +SaveH, , ambi_sh.asd +SaveI, , ambi_si.asd +SaveJ, , ambi_sj.asd +SaveK, , ambi_sk.asd +SaveL, , ambi_sl.asd +SaveM, , ambi_sm.asd +SaveN, , ambi_sn.asd diff --git a/contrib/atlach_new.inf b/contrib/atlach_new.inf new file mode 100644 index 0000000..7f8235b --- /dev/null +++ b/contrib/atlach_new.inf @@ -0,0 +1,30 @@ +# ATLACH-NACHA (low price version) Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, atlach_sa.ald +GraphicsA, gamedata/*ga.ald, atlach_ga.ald +WaveA, gamedata/*wa.ald, atlach_wa.ald +SaveA, , atlach_sa.asd +SaveB, , atlach_sb.asd +SaveC, , atlach_sc.asd +SaveD, , atlach_sd.asd +SaveE, , atlach_se.asd +SaveF, , atlach_sf.asd +SaveG, , atlach_sg.asd +SaveH, , atlach_sh.asd +SaveI, , atlach_si.asd +SaveJ, , atlach_sj.asd +SaveK, , atlach_sk.asd +SaveL, , atlach_sl.asd +SaveM, , atlach_sm.asd +SaveN, , atlach_sn.asd +SaveO, , atlach_so.asd +SaveP, , atlach_sp.asd +SaveQ, , atlach_sq.asd +SaveR, , atlach_sr.asd +SaveS, , atlach_ss.asd +SaveT, , atlach_st.asd +SaveU, , atlach_su.asd +SaveV, , atlach_sv.asd +SaveW, , atlach_sw.asd +SaveX, , atlach_sx.asd +SaveY, , atlach_sy.asd diff --git a/contrib/chairs.inf b/contrib/chairs.inf new file mode 100644 index 0000000..6c6722b --- /dev/null +++ b/contrib/chairs.inf @@ -0,0 +1,37 @@ +# シェル・クレイル Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, chairs_sa.ald +GraphicsA, GAMEDATA/*GA.ald, chairs_ga.ald +WaveA, GAMEDATA/*WA.ald, chairs_wa.ald +BGMA, GAMEDATA/*BA.ald, chairs_ba.ald +WAIA, GAMEDATA/*WA.wai, chairs_wa.wai +BGIA, GAMEDATA/*BA.bgi, chairs_ba.bgi +Ain, GAMEDATA/*.ain, system39.ain +Init, GAMEDATA/*.ini, system39.ini +SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD +SaveA, , chairs_sa.asd +SaveB, , chairs_sb.asd +SaveC, , chairs_sc.asd +SaveD, , chairs_sd.asd +SaveE, , chairs_se.asd +SaveF, , chairs_sf.asd +SaveG, , chairs_sg.asd +SaveH, , chairs_sh.asd +SaveI, , chairs_si.asd +SaveJ, , chairs_sj.asd +SaveK, , chairs_sk.asd +SaveL, , chairs_sl.asd +SaveM, , chairs_sm.asd +SaveN, , chairs_sn.asd +SaveO, , chairs_so.asd +SaveP, , chairs_sp.asd +SaveQ, , chairs_sq.asd +SaveR, , chairs_sr.asd +SaveS, , chairs_ss.asd +SaveT, , chairs_st.asd +SaveU, , chairs_su.asd +SaveV, , chairs_sv.asd +SaveW, , chairs_sw.asd +SaveX, , chairs_sx.asd +SaveY, , chairs_sy.asd +SaveZ, , chairs_sz.asd diff --git a/contrib/daiakuji.inf b/contrib/daiakuji.inf new file mode 100644 index 0000000..3ac9d75 --- /dev/null +++ b/contrib/daiakuji.inf @@ -0,0 +1,19 @@ +# 大悪司 Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, daiakuji_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, daiakuji_ga.ald +WaveA, GAMEDATA/*WA.ALD, daiakuji_wa.ald +DataA, GAMEDATA/*DA.ALD, daiakuji_da.ald +Ain, GAMEDATA/*.ain, system39.ain +SaveA, , daiakuji_sa.asd +SaveB, , daiakuji_sb.asd +SaveC, , daiakuji_sc.asd +SaveD, , daiakuji_sd.asd +SaveE, , daiakuji_se.asd +SaveF, , daiakuji_sf.asd +SaveG, , daiakuji_sg.asd +SaveH, , daiakuji_sh.asd +SaveI, , daiakuji_si.asd +SaveJ, , daiakuji_sj.asd +SaveK, , daiakuji_sk.asd +SaveL, , daiakuji_sl.asd diff --git a/contrib/dalk.inf b/contrib/dalk.inf new file mode 100644 index 0000000..fbcab15 --- /dev/null +++ b/contrib/dalk.inf @@ -0,0 +1,17 @@ +# dalk Install infomation +# Tag, #origin, #destination +ScenarioA, dalk/dalk_sa.ald, dalk_sa.ald +GraphicsA, dalk/dalk_ga.ald, dalk_ga.ald +MidiA, dalk/dalk_ma.ald, dalk_ma.ald +WaveA, dalk/dalk_wa.ald, dalk_wa.ald +DataA, dalk/dalk_da.ald, dalk_da.ald +SaveA, , dalk_sa.asd +SaveB, , dalk_sb.asd +SaveC, , dalk_sc.asd +SaveD, , dalk_sd.asd +SaveE, , dalk_se.asd +SaveF, , dalk_sf.asd +SaveG, , dalk_sg.asd +SaveH, , dalk_sh.asd +SaveI, , dalk_si.asd +SaveJ, , dalk_sj.asd diff --git a/contrib/darcrows.inf b/contrib/darcrows.inf new file mode 100644 index 0000000..1e18ab4 --- /dev/null +++ b/contrib/darcrows.inf @@ -0,0 +1,35 @@ +# DARCROWS Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ALD, hime_sa.ald +GraphicsA, gamedata/*GA.ALD, hime_ga.ald +GraphicsB, gamedata/*GB.ALD, hime_gb.ald +WaveA, gamedata/*WA.ALD, hime_wa.ald +WaveB, gamedata/*WB.ALD, hime_wb.ald +MidiA, gamedata/*MA.ALD, hime_ma.ald +ResourceA, gamedata/*RA.ALD, hime_ra.ald +SaveA, , hime_sa.asd +SaveB, , hime_sb.asd +SaveC, , hime_sc.asd +SaveD, , hime_sd.asd +SaveE, , hime_se.asd +SaveF, , hime_sf.asd +SaveG, , hime_sg.asd +SaveH, , hime_sh.asd +SaveI, , hime_si.asd +SaveJ, , hime_sj.asd +SaveK, , hime_sk.asd +SaveL, , hime_sl.asd +SaveM, , hime_sm.asd +SaveN, , hime_sn.asd +SaveO, , hime_so.asd +SaveP, , hime_sp.asd +SaveQ, , hime_sq.asd +SaveR, , hime_sr.asd +SaveS, , hime_ss.asd +SaveT, , hime_st.asd +SaveU, , hime_su.asd +SaveV, , hime_sv.asd +SaveW, , hime_sw.asd +SaveX, , hime_sx.asd +SaveY, , hime_sy.asd +SaveZ, , hime_sz.asd diff --git a/contrib/diabo.inf b/contrib/diabo.inf new file mode 100644 index 0000000..fc28f54 --- /dev/null +++ b/contrib/diabo.inf @@ -0,0 +1,16 @@ +# DiaboLiQue Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, diabo_sa.ald +GraphicsA, gamedata/*ga.ald, diabo_ga.ald +GraphicsB, gamedata/*gb.ald, diabo_gb.ald +WaveA, gamedata/*wa.ald, diabo_wa.ald +SaveA, , diabo_sa.asd +SaveB, , diabo_sb.asd +SaveC, , diabo_sc.asd +SaveD, , diabo_sd.asd +SaveE, , diabo_se.asd +SaveF, , diabo_sf.asd +SaveG, , diabo_sg.asd +SaveH, , diabo_sh.asd +SaveI, , diabo_si.asd +SaveJ, , diabo_sj.asd diff --git a/contrib/diabo_new.inf b/contrib/diabo_new.inf new file mode 100644 index 0000000..654e7f8 --- /dev/null +++ b/contrib/diabo_new.inf @@ -0,0 +1,30 @@ +# DiaboLiQue (low price version) Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, diabo_sa.ald +GraphicsA, gamedata/*ga.ald, diabo_ga.ald +WaveA, gamedata/*wa.ald, diabo_wa.ald +SaveA, , diabo_sa.asd +SaveB, , diabo_sb.asd +SaveC, , diabo_sc.asd +SaveD, , diabo_sd.asd +SaveE, , diabo_se.asd +SaveF, , diabo_sf.asd +SaveG, , diabo_sg.asd +SaveH, , diabo_sh.asd +SaveI, , diabo_si.asd +SaveJ, , diabo_sj.asd +SaveK, , diabo_sk.asd +SaveL, , diabo_sl.asd +SaveM, , diabo_sm.asd +SaveN, , diabo_sn.asd +SaveO, , diabo_so.asd +SaveP, , diabo_sp.asd +SaveQ, , diabo_sq.asd +SaveR, , diabo_sr.asd +SaveS, , diabo_ss.asd +SaveT, , diabo_st.asd +SaveU, , diabo_su.asd +SaveV, , diabo_sv.asd +SaveW, , diabo_sw.asd +SaveX, , diabo_sx.asd +SaveY, , diabo_sy.asd diff --git a/contrib/drstop.inf b/contrib/drstop.inf new file mode 100644 index 0000000..efac080 --- /dev/null +++ b/contrib/drstop.inf @@ -0,0 +1,10 @@ +# DrStop! Install infomation +# Tag, #origin, #destination +ScenarioA, drstop\!/ds_sa.ald, ds_sa.ald +GraphicsA, drstop\!/ds_ga.ald, ds_ga.ald +MidiA, drstop\!/ds_ma.ald, ds_ma.ald +SaveA, , ds_sa.asd +SaveB, , ds_sb.asd +SaveC, , ds_sc.asd +SaveD, , ds_sd.asd +SaveE, , ds_se.asd diff --git a/contrib/esuka.inf b/contrib/esuka.inf new file mode 100644 index 0000000..acad716 --- /dev/null +++ b/contrib/esuka.inf @@ -0,0 +1,38 @@ +# エスカレイヤー Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, esuka_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, esuka_ga.ald +GraphicsB, GAMEDATA/*GB.ALD, esuka_gb.ald +WaveA, GAMEDATA/*WA.ALD, esuka_wa.ald +WaveB, GAMEDATA/*WB.ALD, esuka_wb.ald +BGMA, GAMEDATA/*BA.ALD, esuka_ba.ald +WAIA, GAMEDATA/*WA.WAI, esuka_wa.wai +BGIA, GAMEDATA/*BA.BGI, esuka_ba.bgi +Ain, GAMEDATA/*.ain, system39.ain +Init, GAMEDATA/*.ini, system39.ini +SaveA, , esuka_sa.asd +SaveB, , esuka_sb.asd +SaveC, , esuka_sc.asd +SaveD, , esuka_sd.asd +SaveE, , esuka_se.asd +SaveF, , esuka_sf.asd +SaveG, , esuka_sg.asd +SaveH, , esuka_sh.asd +SaveI, , esuka_si.asd +SaveJ, , esuka_sj.asd +SaveK, , esuka_sk.asd +SaveL, , esuka_sl.asd +SaveM, , esuka_sm.asd +SaveN, , esuka_sn.asd +SaveO, , esuka_so.asd +SaveP, , esuka_sp.asd +SaveQ, , esuka_sq.asd +SaveR, , esuka_sr.asd +SaveS, , esuka_ss.asd +SaveT, , esuka_st.asd +SaveU, , esuka_su.asd +SaveV, , esuka_sv.asd +SaveW, , esuka_sw.asd +SaveX, , esuka_sx.asd +SaveY, , esuka_sy.asd +SaveZ, , esuka_sz.asd diff --git a/contrib/hushaby.inf b/contrib/hushaby.inf new file mode 100644 index 0000000..63eb80b --- /dev/null +++ b/contrib/hushaby.inf @@ -0,0 +1,8 @@ +# Hushaby Baby Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ALD, hushaby_sa.ald +GraphicsA, gamedata/*GA.ALD, hushaby_ga.ald +WaveA, gamedata/*WA.ALD, hushaby_wa.ald +MidiA, gamedata/*MA.ALD, hushaby_ma.ald +SaveA, , hushaby_sa.asd + diff --git a/contrib/instgame b/contrib/instgame new file mode 100755 index 0000000..cf6d2f0 --- /dev/null +++ b/contrib/instgame @@ -0,0 +1,151 @@ +#!/usr/bin/perl +# +# instgame: xsystem3.5 data install script +# +# Author: Hiroshi Naraki +# +# $Id: instgame,v 1.5 1999/05/18 21:52:02 chikama Exp $ +# +# 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. + +# default value +$cdrom_dir = "/cdrom"; +$dest_base_dir = "~/game"; + +# get program name +($program) = ($0 =~ m%([^/]+)$%); + +# get home directory +$home = $ENV{'HOME'}; + +# show usage and exit +sub usage { + print "Usage: $program [options] .inf \n"; + print " -c directory cdrom directory.(default: /cdrom) \n"; + print " -d directory destination game directory.(default: ~/game/)\n"; + print " -g file game resource file name.(default: ~/game/.gr)\n"; + print " -k tag keep the tagged file from copying.\n"; +} + +;# parsing options +while (@ARGV) { + $_ = shift; + s/^-// || do { $target = $_; last }; + $_ eq 'c' && @ARGV && do { $cdrom_dir = shift; next }; # install from + $_ eq 'd' && @ARGV && do { $dest_base_dir = shift; next }; # install to + $_ eq 'g' && @ARGV && do { $grfile = shift; next }; # gr-file to + $_ eq 'k' && @ARGV && do { @keep_list = (@keep_list, shift); next }; # keep tag + $_ eq 'v' && @ARGV && do { $debug = 1; next }; # debug + &usage; + exit; +} + +# nothing target +if (! -f $target ) { + &usage; + exit; +} +# decide game resource file name +$base = $target; +$base =~ s%.*/%%; +$base =~ s/\.inf//; +$dest_dir = $dest_base_dir."/".$base; +$grfile = $dest_base_dir."/".$base.".gr"; + +# expand directory name +$dest_dir =~ s/~/$home/; +$grfile =~ s/~/$home/; + +# print variables if debug +if ($debug) { + print "cdrom_dir:$cdrom_dir\n"; + print "dest_dir:$dest_dir\n"; + print "grfile :$grfile\n"; +} + +-d $cdrom_dir || die "$!:$cdrom_dir\n"; + +&make_dir($dest_dir); + +open( DAT, $target) || die "Can't open $target:$!\n"; + +open( FILE, "> $grfile" ) || die "Can't create file $grfile:$!\n"; +print FILE "# System 3.5 GameResource File: [$target]\n"; + +while( $line = ) { + $line =~ s/\#.*|\s//g; + $line eq /^$/ && do { next }; + @data = split(/,/,$line); + $tag = $data[0]; + $from = $data[1]; + $to = $data[2]; + + if( $to eq '' ) { + &view_action("Ignore ", $tag, $from, $to); + next; + } + $to = $dest_dir."/".$to; + if( $tag eq '' ) { + $keep = 0; + } else { + $keep = grep(/$tag*/, @keep_list ); + } + if( $keep ) { + $from = $cdrom_dir."/".$from ; + &view_action("Linking", $tag, $from, $to); +# symlink($from, $to) if !$debug; + system("ln -s $from $to") if !$debug; + } elsif( $from eq '' ) { +# &view_action("Create ", $tag, $from, $to); +# system("touch $to") if !$debug; + &view_action("Skip ", $tag, $from, $to); + } else { + $from = $cdrom_dir."/".$from ; + foreach ( <${from}>) { + &view_action("Copying", $tag, $from, $to); + system("cp $from $to") if !$debug; + } + } + + # Create game resource file + if( $tag ne '' ) { + print "writing: $tag $to\n" if $debug; + print FILE "$tag $to\n"; + } +} +close(FILE); +close(DAT); +exit; + +sub view_action { + local($action, $tag, $from, $to ) = @_; + + print "$action $tag: $from -> $to\n"; +} + +# mkdir destination directories. +sub make_dir { + local($target ) = @_; + + @dest = split(/\//,$target); + foreach $dir ( @dest ) { + $work .= $dir.'/'; + print "checking $work\n" if $debug; + if( !-d $work ) { + print "mkdir $work\n" if $debug; + mkdir( $work,0777) || die "Can't mkdir $work:$!\n"; + } + } +} diff --git a/contrib/kakurezuki.inf b/contrib/kakurezuki.inf new file mode 100644 index 0000000..75b4348 --- /dev/null +++ b/contrib/kakurezuki.inf @@ -0,0 +1,16 @@ +# kakurezuki Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, tsuki_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, tsuki_ga.ald +WaveA, GAMEDATA/*WA.ALD, tsuki_wa.ald +SaveA, , tsuki_sa.asd +SaveB, , tsuki_sb.asd +SaveC, , tsuki_sc.asd +SaveD, , tsuki_sd.asd +SaveE, , tsuki_se.asd +SaveF, , tsuki_sf.asd +SaveG, , tsuki_sg.asd +SaveH, , tsuki_sh.asd +SaveI, , tsuki_si.asd +SaveJ, , tsuki_sj.asd +SaveK, , tsuki_sk.asd diff --git a/contrib/katsumi.inf b/contrib/katsumi.inf new file mode 100644 index 0000000..fe29309 --- /dev/null +++ b/contrib/katsumi.inf @@ -0,0 +1,17 @@ +# Ikenai Katsumisensei Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, katsumi_sa.ald +GraphicsA, gamedata/*ga.ald, katsumi_ga.ald +GraphicsB, gamedata/*gb.ald, katsumi_gb.ald +WaveA, gamedata/*wa.ald, katsumi_wa.ald +SaveA, , katsumi_sa.asd +SaveB, , katsumi_sb.asd +SaveC, , katsumi_sc.asd +SaveD, , katsumi_sd.asd +SaveE, , katsumi_se.asd +SaveF, , katsumi_sf.asd +SaveG, , katsumi_sg.asd +SaveH, , katsumi_sh.asd +SaveI, , katsumi_si.asd +SaveJ, , katsumi_sj.asd + gamedata/gaiji.dat, gaiji.dat diff --git a/contrib/kichiku.inf b/contrib/kichiku.inf new file mode 100644 index 0000000..d11f668 --- /dev/null +++ b/contrib/kichiku.inf @@ -0,0 +1,16 @@ +# Kichikuoh Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, kichiku_sa.ald +GraphicsA, gamedata/*ga.ald, kichiku_ga.ald +GraphicsB, gamedata/*gb.ald, kichiku_gb.ald +WaveA, gamedata/*wa.ald, kichiku_wa.ald +SaveA, , kichiku_sa.asd +SaveB, , kichiku_sb.asd +SaveC, , kichiku_sc.asd +SaveD, , kichiku_sd.asd +SaveE, , kichiku_se.asd +SaveF, , kichiku_sf.asd +SaveG, , kichiku_sg.asd +SaveH, , kichiku_sh.asd +SaveI, , kichiku_si.asd +SaveJ, , kichiku_sj.asd diff --git a/contrib/mamatoto.inf b/contrib/mamatoto.inf new file mode 100644 index 0000000..d960540 --- /dev/null +++ b/contrib/mamatoto.inf @@ -0,0 +1,34 @@ +# MAMATOTO Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, mamatoto_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, mamatoto_ga.ald +GraphicsB, GAMEDATA/*GB.ALD, mamatoto_gb.ald +WaveA, GAMEDATA/*WA.ALD, mamatoto_wa.ald +MidiA, GAMEDATA/*MA.ALD, mamatoto_ma.ald +DataA, GAMEDATA/*DA.ALD, mamatoto_da.ald +SaveA, , mamatoto_sa.asd +SaveB, , mamatoto_sb.asd +SaveC, , mamatoto_sc.asd +SaveD, , mamatoto_sd.asd +SaveE, , mamatoto_se.asd +SaveF, , mamatoto_sf.asd +SaveG, , mamatoto_sg.asd +SaveH, , mamatoto_sh.asd +SaveI, , mamatoto_si.asd +SaveJ, , mamatoto_sj.asd +SaveK, , mamatoto_sk.asd +SaveL, , mamatoto_sl.asd +SaveM, , mamatoto_sm.asd +SaveN, , mamatoto_sn.asd +SaveO, , mamatoto_so.asd +SaveP, , mamatoto_sp.asd +SaveQ, , mamatoto_sq.asd +SaveR, , mamatoto_sr.asd +SaveS, , mamatoto_ss.asd +SaveT, , mamatoto_st.asd +SaveU, , mamatoto_su.asd +SaveV, , mamatoto_sv.asd +SaveW, , mamatoto_sw.asd +SaveX, , mamatoto_sx.asd +SaveY, , mamatoto_sy.asd +SaveZ, , mamatoto_sz.asd diff --git a/contrib/mamori.inf b/contrib/mamori.inf new file mode 100644 index 0000000..55e2b26 --- /dev/null +++ b/contrib/mamori.inf @@ -0,0 +1,17 @@ +# MamoriGami Sama Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, mamori_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, mamori_ga.ald +GraphicsB, GAMEDATA/*GB.ALD, mamori_gb.ald +WaveA, GAMEDATA/*WA.ALD, mamori_wa.ald +MidiA, GAMEDATA/*MA.ALD, mamori_ma.ald +SaveA, , mamori_sa.asd +SaveB, , mamori_sb.asd +SaveC, , mamori_sc.asd +SaveD, , mamori_sd.asd +SaveE, , mamori_se.asd +SaveF, , mamori_sf.asd +SaveG, , mamori_sg.asd +SaveH, , mamori_sh.asd +SaveI, , mamori_si.asd +SaveJ, , mamori_sj.asd diff --git a/contrib/miko.inf b/contrib/miko.inf new file mode 100644 index 0000000..7519f60 --- /dev/null +++ b/contrib/miko.inf @@ -0,0 +1,9 @@ +# Ikusa Miko Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, miko_sa.ald +GraphicsA, gamedata/*ga.ald, miko_ga.ald +WaveA, gamedata/*wa.ald, miko_wa.ald +SaveA, , miko_sa.asd +SaveB, , miko_sb.asd +SaveC, , miko_sc.asd +SaveJ, , miko_sj.asd diff --git a/contrib/mugen.inf b/contrib/mugen.inf new file mode 100644 index 0000000..b27260b --- /dev/null +++ b/contrib/mugen.inf @@ -0,0 +1,7 @@ +# mugen hoyo Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ald, mugen_sa.ald +GraphicsA, gamedata/*GA.ald, mugen_ga.ald +SaveA, , mugen_sa.asd +SaveB, , mugen_sb.asd +SaveC, , mugen_sc.asd diff --git a/contrib/nd.inf b/contrib/nd.inf new file mode 100644 index 0000000..6e12464 --- /dev/null +++ b/contrib/nd.inf @@ -0,0 +1,41 @@ +# Night Demon Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ald, nd_sa.ald +GraphicsA, GAMEDATA/*GA.ald, nd_ga.ald +WaveA, GAMEDATA/*WA.ald, nd_wa.ald +BGMA, GAMEDATA/*BA.ald, nd_ba.ald +WAIA, GAMEDATA/*WA.wai, nd_wa.wai +BGIA, GAMEDATA/*BA.bgi, nd_ba.bgi +Ain, GAMEDATA/*.ain, system39.ain +Init, GAMEDATA/*.ini, system39.ini +SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD +ALK01, GAMEDATA/AliceLogo.alk, AliceLogo.alk +ALK02, GAMEDATA/NightDemonDemo1.alk, NightDemonDemo1.alk +ALK03, GAMEDATA/NightDemonDemo2.alk, NightDemonDemo2.alk +ALK04, GAMEDATA/NightDemonDemo3.alk, NightDemonDemo3.alk +SaveA, , nd_sa.asd +SaveB, , nd_sb.asd +SaveC, , nd_sc.asd +SaveD, , nd_sd.asd +SaveE, , nd_se.asd +SaveF, , nd_sf.asd +SaveG, , nd_sg.asd +SaveH, , nd_sh.asd +SaveI, , nd_si.asd +SaveJ, , nd_sj.asd +SaveK, , nd_sk.asd +SaveL, , nd_sl.asd +SaveM, , nd_sm.asd +SaveN, , nd_sn.asd +SaveO, , nd_so.asd +SaveP, , nd_sp.asd +SaveQ, , nd_sq.asd +SaveR, , nd_sr.asd +SaveS, , nd_ss.asd +SaveT, , nd_st.asd +SaveU, , nd_su.asd +SaveV, , nd_sv.asd +SaveW, , nd_sw.asd +SaveX, , nd_sx.asd +SaveY, , nd_sy.asd +SaveZ, , nd_sz.asd diff --git a/contrib/onlyyou_r.inf b/contrib/onlyyou_r.inf new file mode 100644 index 0000000..e2c3431 --- /dev/null +++ b/contrib/onlyyou_r.inf @@ -0,0 +1,32 @@ +# Only You リクルス Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ald, onlyyou_r_sa.ald +GraphicsA, gamedata/*GA.ald, onlyyou_r_ga.ald +WaveA, gamedata/*WA.ald, onlyyou_r_wa.ald +Ain, gamedata/*.ain, System39.ain +SaveA, , onlyyou_r_sa.asd +SaveB, , onlyyou_r_sb.asd +SaveC, , onlyyou_r_sc.asd +SaveD, , onlyyou_r_sd.asd +SaveE, , onlyyou_r_se.asd +SaveF, , onlyyou_r_sf.asd +SaveG, , onlyyou_r_sg.asd +SaveH, , onlyyou_r_sh.asd +SaveI, , onlyyou_r_si.asd +SaveJ, , onlyyou_r_sj.asd +SaveK, , onlyyou_r_sk.asd +SaveL, , onlyyou_r_sl.asd +SaveM, , onlyyou_r_sm.asd +SaveN, , onlyyou_r_sn.asd +SaveO, , onlyyou_r_so.asd +SaveP, , onlyyou_r_sp.asd +SaveQ, , onlyyou_r_sq.asd +SaveR, , onlyyou_r_sr.asd +SaveS, , onlyyou_r_ss.asd +SaveT, , onlyyou_r_st.asd +SaveU, , onlyyou_r_su.asd +SaveV, , onlyyou_r_sv.asd +SaveW, , onlyyou_r_sw.asd +SaveX, , onlyyou_r_sx.asd +SaveY, , onlyyou_r_sy.asd +SaveZ, , onlyyou_r_sz.asd diff --git a/contrib/oudou.inf b/contrib/oudou.inf new file mode 100644 index 0000000..6aff6cd --- /dev/null +++ b/contrib/oudou.inf @@ -0,0 +1,16 @@ +# Oudou Yusha Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, oudou_sa.ald +GraphicsA, gamedata/*ga.ald, oudou_ga.ald +GraphicsB, gamedata/*gb.ald, oudou_gb.ald +WaveA, gamedata/*wa.ald, oudou_wa.ald +SaveA, , oudou_sa.asd +SaveB, , oudou_sb.asd +SaveC, , oudou_sc.asd +SaveD, , oudou_sd.asd +SaveE, , oudou_se.asd +SaveF, , oudou_sf.asd +SaveG, , oudou_sg.asd +SaveH, , oudou_sh.asd +SaveI, , oudou_si.asd +SaveJ, , oudou_sj.asd diff --git a/contrib/panyo.inf b/contrib/panyo.inf new file mode 100644 index 0000000..65bb053 --- /dev/null +++ b/contrib/panyo.inf @@ -0,0 +1,36 @@ +# Kaerunyo Panyon Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, panyo_sa.ald +GraphicsA, gamedata/*ga.ald, panyo_ga.ald +WaveA, gamedata/*wa.ald, panyo_wa.ald +SaveA, , panyo_sa.asd +SaveB, , panyo_sb.asd +SaveC, , panyo_sc.asd +SaveD, , panyo_sd.asd +SaveE, , panyo_se.asd +SaveF, , panyo_sf.asd +SaveG, , panyo_sg.asd +SaveH, , panyo_sh.asd +SaveI, , panyo_si.asd +SaveJ, , panyo_sj.asd +SaveK, , panyo_sk.asd +SaveL, , panyo_sl.asd +SaveM, , panyo_sm.asd +SaveN, , panyo_sn.asd +SaveO, , panyo_so.asd +, gamedata/floor_1.map, floor_1.map +, gamedata/floor_2.map, floor_2.map +, gamedata/floor_3.map, floor_3.map +, gamedata/floor_4.map, floor_4.map +, gamedata/floor_5.map, floor_5.map +, gamedata/floor_6.map, floor_6.map +, gamedata/floor_7.map, floor_7.map +, gamedata/floor_8.map, floor_8.map +, gamedata/floor_9.map, floor_9.map +, gamedata/floor_10.map, floor_10.map +, gamedata/floor_11.map, floor_11.map +, gamedata/floor_12.map, floor_12.map +, gamedata/floor_13.map, floor_13.map +, gamedata/floor_14.map, floor_14.map +, gamedata/floor_15.map, floor_15.map +, gamedata/floor_16.map, floor_16.map diff --git a/contrib/panyo_new.inf b/contrib/panyo_new.inf new file mode 100644 index 0000000..b537fdc --- /dev/null +++ b/contrib/panyo_new.inf @@ -0,0 +1,63 @@ +# Kaerunyo Panyon (low price version) Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, panyo_sa.ald +GraphicsA, gamedata/*ga.ald, panyo_ga.ald +WaveA, gamedata/*wa.ald, panyo_wa.ald +SaveA, , panyo_sa.asd +SaveB, , panyo_sb.asd +SaveC, , panyo_sc.asd +SaveD, , panyo_sd.asd +SaveE, , panyo_se.asd +SaveF, , panyo_sf.asd +SaveG, , panyo_sg.asd +SaveH, , panyo_sh.asd +SaveI, , panyo_si.asd +SaveJ, , panyo_sj.asd +SaveK, , panyo_sk.asd +SaveL, , panyo_sl.asd +SaveM, , panyo_sm.asd +SaveN, , panyo_sn.asd +SaveO, , panyo_so.asd +SaveP, , panyo_sp.asd +SaveQ, , panyo_sq.asd +SaveR, , panyo_sr.asd +SaveS, , panyo_ss.asd +SaveT, , panyo_st.asd +SaveU, , panyo_su.asd +SaveV, , panyo_sv.asd +SaveW, , panyo_sw.asd +SaveX, , panyo_sx.asd +SaveY, , panyo_sy.asd +, gamedata/floor_1.map, floor_1.map +, gamedata/floor_2.map, floor_2.map +, gamedata/floor_3.map, floor_3.map +, gamedata/floor_4.map, floor_4.map +, gamedata/floor_5.map, floor_5.map +, gamedata/floor_6.map, floor_6.map +, gamedata/floor_7.map, floor_7.map +, gamedata/floor_8.map, floor_8.map +, gamedata/floor_9.map, floor_9.map +, gamedata/floor_10.map, floor_10.map +, gamedata/floor_11.map, floor_11.map +, gamedata/floor_12.map, floor_12.map +, gamedata/floor_13.map, floor_13.map +, gamedata/floor_14.map, floor_14.map +, gamedata/floor_15.map, floor_15.map +, gamedata/floor_16.map, floor_16.map +, gamedata/floor_17.map, floor_17.map +, gamedata/floor_18.map, floor_18.map +, gamedata/floor_19.map, floor_19.map +, gamedata/floor_20.map, floor_20.map +, gamedata/floor_21.map, floor_21.map +, gamedata/floor_22.map, floor_22.map +, gamedata/floor_23.map, floor_23.map +, gamedata/floor_24.map, floor_24.map +, gamedata/floor_25.map, floor_25.map +, gamedata/floor_26.map, floor_26.map +, gamedata/floor_27.map, floor_27.map +, gamedata/floor_28.map, floor_28.map +, gamedata/floor_29.map, floor_29.map +, gamedata/floor_30.map, floor_30.map +, gamedata/floor_31.map, floor_31.map +, gamedata/floor_32.map, floor_32.map +, gamedata/floor_33.map, floor_33.map diff --git a/contrib/pascha.inf b/contrib/pascha.inf new file mode 100644 index 0000000..e668b16 --- /dev/null +++ b/contrib/pascha.inf @@ -0,0 +1,33 @@ +# PastelChime Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ALD, pascha_sa.ald +GraphicsA, gamedata/*GA.ALD, pascha_ga.ald +WaveA, gamedata/*WA.ALD, pascha_wa.ald +MidiA, gamedata/*MA.ALD, pascha_ma.ald +DataA, gamedata/*DA.ALD, pascha_da.ald +SaveA, , pascha_sa.asd +SaveB, , pascha_sb.asd +SaveC, , pascha_sc.asd +SaveD, , pascha_sd.asd +SaveE, , pascha_se.asd +SaveF, , pascha_sf.asd +SaveG, , pascha_sg.asd +SaveH, , pascha_sh.asd +SaveI, , pascha_si.asd +SaveJ, , pascha_sj.asd +SaveK, , pascha_sk.asd +SaveL, , pascha_sl.asd +SaveM, , pascha_sm.asd +SaveN, , pascha_sn.asd +SaveO, , pascha_so.asd +SaveP, , pascha_sp.asd +SaveQ, , pascha_sq.asd +SaveR, , pascha_sr.asd +SaveS, , pascha_ss.asd +SaveT, , pascha_st.asd +SaveU, , pascha_su.asd +SaveV, , pascha_sv.asd +SaveW, , pascha_sw.asd +SaveX, , pascha_sx.asd +SaveY, , pascha_sy.asd +SaveZ, , pascha_sz.asd diff --git a/contrib/persiom.inf b/contrib/persiom.inf new file mode 100644 index 0000000..8dcb37b --- /dev/null +++ b/contrib/persiom.inf @@ -0,0 +1,20 @@ +# Persiom Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, persiom_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, persiom_ga.ald +GraphicsB, GAMEDATA/*GB.ALD, persiom_gb.ald +WaveA, GAMEDATA/*WA.ALD, persiom_wa.ald +MidiA, GAMEDATA/*MA.ALD, persiom_ma.ald +DataA, GAMEDATA/*DA.ALD, persiom_da.ald +SaveA, , persiom_sa.asd +SaveB, , persiom_sb.asd +SaveC, , persiom_sc.asd +SaveD, , persiom_sd.asd +SaveE, , persiom_se.asd +SaveF, , persiom_sf.asd +SaveG, , persiom_sg.asd +SaveH, , persiom_sh.asd +SaveI, , persiom_si.asd +SaveJ, , persiom_sj.asd +SaveK, , persiom_sk.asd +SaveL, , persiom_sl.asd diff --git a/contrib/progood.inf b/contrib/progood.inf new file mode 100644 index 0000000..4117c44 --- /dev/null +++ b/contrib/progood.inf @@ -0,0 +1,17 @@ +# prostudent good Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, progood_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, progood_ga.ald +WaveA, GAMEDATA/*WA.ALD, progood_wa.ald +DataA, GAMEDATA/*DA.ALD, progood_da.ald +SaveA, , progood_sa.asd +SaveB, , progood_sb.asd +SaveC, , progood_sc.asd +SaveD, , progood_sd.asd +SaveE, , progood_se.asd +SaveF, , progood_sf.asd +SaveG, , progood_sg.asd +SaveH, , progood_sh.asd +SaveI, , progood_si.asd +SaveJ, , progood_sj.asd +SaveK, , progood_sk.asd diff --git a/contrib/rance1.inf b/contrib/rance1.inf new file mode 100644 index 0000000..54ac7ad --- /dev/null +++ b/contrib/rance1.inf @@ -0,0 +1,20 @@ +# Rance 1 Install infomation +# Tag, #origin, #destination +ScenarioA, rance1/rancesa.ald, rance1_sa.ald +GraphicsA, rance1/rancega.ald, rance1_ga.ald +MidiA, rance1/rancema.ald, rance1_ma.ald +WaveA, rance1/rancewa.ald, rance1_wa.ald +SaveA, , rance1_sa.asd +SaveB, , rance1_sb.asd +SaveC, , rance1_sc.asd +SaveD, , rance1_sd.asd +SaveE, , rance1_se.asd +SaveF, , rance1_sf.asd +SaveG, , rance1_sg.asd +SaveH, , rance1_sh.asd +SaveI, , rance1_si.asd +SaveJ, , rance1_sj.asd +SaveK, , rance1_sk.asd +SaveL, , rance1_sl.asd +SaveM, , rance1_sm.asd +SaveN, , rance1_sn.asd diff --git a/contrib/rance2.inf b/contrib/rance2.inf new file mode 100644 index 0000000..bcac0c1 --- /dev/null +++ b/contrib/rance2.inf @@ -0,0 +1,20 @@ +# Rance 2 Install infomation +# Tag, #origin, #destination +ScenarioA, rance2/rance2sa.ald, rance2_sa.ald +GraphicsA, rance2/rance2ga.ald, rance2_ga.ald +MidiA, rance2/rance2ma.ald, rance2_ma.ald +WaveA, rance2/rance2wa.ald, rance2_wa.ald +SaveA, , rance2_sa.asd +SaveB, , rance2_sb.asd +SaveC, , rance2_sc.asd +SaveD, , rance2_sd.asd +SaveE, , rance2_se.asd +SaveF, , rance2_sf.asd +SaveG, , rance2_sg.asd +SaveH, , rance2_sh.asd +SaveI, , rance2_si.asd +SaveJ, , rance2_sj.asd +SaveK, , rance2_sk.asd +SaveL, , rance2_sl.asd +SaveM, , rance2_sm.asd +SaveN, , rance2_sn.asd diff --git a/contrib/rance3.inf b/contrib/rance3.inf new file mode 100644 index 0000000..ad4b3f3 --- /dev/null +++ b/contrib/rance3.inf @@ -0,0 +1,15 @@ +# Rance 3 Install infomation +# Tag, #origin, #destination +ScenarioA, rance3/rance3sa.ald, rance3sa.ald +GraphicsA, rance3/rance3ga.ald, rance3ga.ald +WaveA, rance3/rance3wa.ald, rance3wa.ald +MidiA, rance3/rance3ma.ald, rance3ma.ald +DataA, rance3/rance3da.ald, rance3da.ald +SaveA, , rance3sa.asd +SaveB, , rance3sb.asd +SaveC, , rance3sc.asd +SaveD, , rance3sd.asd +SaveE, , rance3se.asd +SaveF, , rance3sf.asd +SaveG, , rance3sg.asd +SaveH, , rance3sh.asd diff --git a/contrib/rance4.inf b/contrib/rance4.inf new file mode 100644 index 0000000..832edf2 --- /dev/null +++ b/contrib/rance4.inf @@ -0,0 +1,15 @@ +# Rance 4 Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, rance4_sa.ald +GraphicsA, gamedata/*ga.ald, rance4_ga.ald +WaveA, gamedata/*wa.ald, rance4_wa.ald +SaveA, , rance4_sa.asd +SaveB, , rance4_sb.asd +SaveC, , rance4_sc.asd +SaveD, , rance4_sd.asd +SaveE, , rance4_se.asd +SaveF, , rance4_sf.asd +SaveG, , rance4_sg.asd +SaveH, , rance4_sh.asd +SaveI, , rance4_si.asd +SaveJ, , rance4_sj.asd diff --git a/contrib/rance5d.inf b/contrib/rance5d.inf new file mode 100644 index 0000000..d9049db --- /dev/null +++ b/contrib/rance5d.inf @@ -0,0 +1,36 @@ +# Rance5D Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, r5d_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, r5d_ga.ald +WaveA, GAMEDATA/*WA.ALD, r5d_wa.ald +BGMA, GAMEDATA/*BA.ALD, r5d_ba.ald +BGIA, GAMEDATA/*BA.BGI, r5d_ba.bgi +Ain, GAMEDATA/*.ain, system39.ain +Init, GAMEDATA/*.ini, system39.ini +SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD +SaveA, , r5d_sa.asd +SaveB, , r5d_sb.asd +SaveC, , r5d_sc.asd +SaveD, , r5d_sd.asd +SaveE, , r5d_se.asd +SaveF, , r5d_sf.asd +SaveG, , r5d_sg.asd +SaveH, , r5d_sh.asd +SaveI, , r5d_si.asd +SaveJ, , r5d_sj.asd +SaveK, , r5d_sk.asd +SaveL, , r5d_sl.asd +SaveM, , r5d_sm.asd +SaveN, , r5d_sn.asd +SaveO, , r5d_so.asd +SaveP, , r5d_sp.asd +SaveQ, , r5d_sq.asd +SaveR, , r5d_sr.asd +SaveS, , r5d_ss.asd +SaveT, , r5d_st.asd +SaveU, , r5d_su.asd +SaveV, , r5d_sv.asd +SaveW, , r5d_sw.asd +SaveX, , r5d_sx.asd +SaveY, , r5d_sy.asd +SaveZ, , r5d_sz.asd diff --git a/contrib/seeinao.inf b/contrib/seeinao.inf new file mode 100644 index 0000000..51952f6 --- /dev/null +++ b/contrib/seeinao.inf @@ -0,0 +1,31 @@ +# SeeInAO Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ald, seeinao_sa.ald +GraphicsA, gamedata/*GA.ald, seeinao_ga.ald +WaveA, gamedata/*WA.ald, seeinao_wa.ald +MidiA, gamedata/*MA.ald, seeinao_ma.ald +SaveA, , seeinao_sa.asd +SaveB, , seeinao_sb.asd +SaveC, , seeinao_sc.asd +SaveD, , seeinao_sd.asd +SaveE, , seeinao_se.asd +SaveF, , seeinao_sf.asd +SaveG, , seeinao_sg.asd +SaveH, , seeinao_sh.asd +SaveI, , seeinao_si.asd +SaveJ, , seeinao_sj.asd +SaveK, , seeinao_sk.asd +SaveL, , seeinao_sl.asd +SaveM, , seeinao_sm.asd +SaveN, , seeinao_sn.asd +SaveO, , seeinao_so.asd +SaveP, , seeinao_sp.asd +SaveQ, , seeinao_sq.asd +SaveR, , seeinao_sr.asd +SaveS, , seeinao_ss.asd +SaveT, , seeinao_st.asd +SaveU, , seeinao_su.asd +SaveV, , seeinao_sv.asd +SaveW, , seeinao_sw.asd +SaveX, , seeinao_sx.asd +SaveY, , seeinao_sy.asd diff --git a/contrib/toushin.inf b/contrib/toushin.inf new file mode 100644 index 0000000..9e1d969 --- /dev/null +++ b/contrib/toushin.inf @@ -0,0 +1,16 @@ +# Toushin Toshi Install infomation +# Tag, #origin, #destination +ScenarioA, ???_?s?s/*_sa.ald, toushin_sa.ald +GraphicsA, ???_?s?s/*_ga.ald, toushin_ga.ald +MidiA, ???_?s?s/*_ma.ald, toushin_ma.ald +WaveA, ???_?s?s/*_wa.ald, toushin_wa.ald +DataA, ???_?s?s/*_da.ald, toushin_da.ald +SaveA, , toushin_sa.asd +SaveB, , toushin_sb.asd +SaveC, , toushin_sc.asd +SaveD, , toushin_sd.asd +SaveE, , toushin_se.asd +SaveF, , toushin_sf.asd +SaveG, , toushin_sg.asd +SaveH, , toushin_sh.asd + diff --git a/contrib/toushin2.inf b/contrib/toushin2.inf new file mode 100644 index 0000000..81df4b4 --- /dev/null +++ b/contrib/toushin2.inf @@ -0,0 +1,16 @@ +# Toushintoshi2 Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, toushin2_sa.ald +GraphicsA, gamedata/*ga.ald, toushin2_ga.ald +WaveA, gamedata/*wa.ald, toushin2_wa.ald +DataA, gamedata/*da.ald, toushin2_da.ald +SaveA, , toushin2_sa.asd +SaveB, , toushin2_sb.asd +SaveC, , toushin2_sc.asd +SaveD, , toushin2_sd.asd +SaveE, , toushin2_se.asd +SaveF, , toushin2_sf.asd +SaveG, , toushin2_sg.asd +SaveH, , toushin2_sh.asd +SaveI, , toushin2_si.asd +SaveJ, , toushin2_sj.asd diff --git a/contrib/tsuma.inf b/contrib/tsuma.inf new file mode 100644 index 0000000..2f2d269 --- /dev/null +++ b/contrib/tsuma.inf @@ -0,0 +1,32 @@ +# 妻みぐい Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*SA.ald, tsuma_sa.ald +GraphicsA, gamedata/*GA.ald, tsuma_ga.ald +WaveA, gamedata/*WA.ald, tsuma_wa.ald +Ain, gamedata/*.ain, system39.ain +SaveA, , tsuma_sa.asd +SaveB, , tsuma_sb.asd +SaveC, , tsuma_sc.asd +SaveD, , tsuma_sd.asd +SaveE, , tsuma_se.asd +SaveF, , tsuma_sf.asd +SaveG, , tsuma_sg.asd +SaveH, , tsuma_sh.asd +SaveI, , tsuma_si.asd +SaveJ, , tsuma_sj.asd +SaveK, , tsuma_sk.asd +SaveL, , tsuma_sl.asd +SaveM, , tsuma_sm.asd +SaveN, , tsuma_sn.asd +SaveO, , tsuma_so.asd +SaveP, , tsuma_sp.asd +SaveQ, , tsuma_sq.asd +SaveR, , tsuma_sr.asd +SaveS, , tsuma_ss.asd +SaveT, , tsuma_st.asd +SaveU, , tsuma_su.asd +SaveV, , tsuma_sv.asd +SaveW, , tsuma_sw.asd +SaveX, , tsuma_sx.asd +SaveY, , tsuma_sy.asd +SaveZ, , tsuma_sz.asd diff --git a/contrib/tsuma2.inf b/contrib/tsuma2.inf new file mode 100644 index 0000000..9e2e1d1 --- /dev/null +++ b/contrib/tsuma2.inf @@ -0,0 +1,38 @@ +# 妻みぐい2 Install infomation +# Tag, #origin, #destination +ScenarioA, GAMEDATA/*SA.ALD, tsuma2_sa.ald +GraphicsA, GAMEDATA/*GA.ALD, tsuma2_ga.ald +WaveA, GAMEDATA/*WA.ALD, tsuma2_wa.ald +WaveB, GAMEDATA/*WB.ALD, tsuma2_wb.ald +BGMA, GAMEDATA/*BA.ALD, tsuma2_ba.ald +WAIA, GAMEDATA/*WA.WAI, tsuma2_wa.wai +BGIA, GAMEDATA/*BA.BGI, tsuma2_ba.bgi +Ain, GAMEDATA/*.ain, system39.ain +Init, GAMEDATA/*.ini, system39.ini +SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD +SaveA, , tsuma2_sa.asd +SaveB, , tsuma2_sb.asd +SaveC, , tsuma2_sc.asd +SaveD, , tsuma2_sd.asd +SaveE, , tsuma2_se.asd +SaveF, , tsuma2_sf.asd +SaveG, , tsuma2_sg.asd +SaveH, , tsuma2_sh.asd +SaveI, , tsuma2_si.asd +SaveJ, , tsuma2_sj.asd +SaveK, , tsuma2_sk.asd +SaveL, , tsuma2_sl.asd +SaveM, , tsuma2_sm.asd +SaveN, , tsuma2_sn.asd +SaveO, , tsuma2_so.asd +SaveP, , tsuma2_sp.asd +SaveQ, , tsuma2_sq.asd +SaveR, , tsuma2_sr.asd +SaveS, , tsuma2_ss.asd +SaveT, , tsuma2_st.asd +SaveU, , tsuma2_su.asd +SaveV, , tsuma2_sv.asd +SaveW, , tsuma2_sw.asd +SaveX, , tsuma2_sx.asd +SaveY, , tsuma2_sy.asd +SaveZ, , tsuma2_sz.asd diff --git a/contrib/zero_new.inf b/contrib/zero_new.inf new file mode 100644 index 0000000..8799fee --- /dev/null +++ b/contrib/zero_new.inf @@ -0,0 +1,32 @@ +# Zero-shiki (low price version) Install infomation +# Tag, #origin, #destination +ScenarioA, gamedata/*sa.ald, zero_sa.ald +GraphicsA, gamedata/*ga.ald, zero_ga.ald +WaveA, gamedata/*wa.ald, zero_wa.ald +SaveA, , zero_sa.asd +SaveB, , zero_sb.asd +SaveC, , zero_sc.asd +SaveD, , zero_sd.asd +SaveE, , zero_se.asd +SaveF, , zero_sf.asd +SaveG, , zero_sg.asd +SaveH, , zero_sh.asd +SaveI, , zero_si.asd +SaveJ, , zero_sj.asd +SaveK, , zero_sk.asd +SaveL, , zero_sl.asd +SaveM, , zero_sm.asd +SaveN, , zero_sn.asd +SaveO, , zero_so.asd +SaveP, , zero_sp.asd +SaveQ, , zero_sq.asd +SaveR, , zero_sr.asd +SaveS, , zero_ss.asd +SaveT, , zero_st.asd +SaveU, , zero_su.asd +SaveV, , zero_sv.asd +SaveW, , zero_sw.asd +SaveX, , zero_sx.asd +SaveY, , zero_sy.asd +, gamedata/map_data.dat, MAP_DATA.DAT +, gamedata/ur_data.dat, UR_DATA.DAT diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..04701da --- /dev/null +++ b/depcomp @@ -0,0 +1,530 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-07-09.11 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/doc/BUGS b/doc/BUGS new file mode 100644 index 0000000..08c744f --- /dev/null +++ b/doc/BUGS @@ -0,0 +1,23 @@ +BUG INFORMATION for + System 3.5 for X Window System Version 1.7 + + + * $B$$$1$J$$$+$D$_@h@8$N30;z$O%5%]!<%H$7$F$$$^$;$s!#(B + + + * Ctrl+C$B$G6/@)=*N;$7$?$j!"0[>o=*N;$7$?>l9g(B IPC Key$B$,$^$l$K;D$k;v$,$"$j$^$9!#(B + % ipcs + $B$G(Bid$B$r3NG'$7!"(B + % ipcrm shm ??? + $B$G>C$7$F2<$5$$!#(B(Linux$B$N>l9g!#$=$NB>$O(B man ipcrm $B$7$F$/$@$5$$(B) + + + * SDL $B$rM-8z$K$7$F%3%s%Q%$%k$7%U%k%9%/%j!<%s$Gl9g!"??Cf%/%j%C%/$K(B + $B$h$k%a%K%e!<$,I=<($5$l$^$;$s!#$=$N>l9g!"(BF4 $B%-!<$G0lC6%U%k%9%/%j!<%s$r2r=|(B + $B$7$F$/$@$5$$!#(B + + + * $B%U%k%9%/%j!<%s Version 1.7.3 (200?.**.**) + +pre5 + * FedoraCore5 $B$G%3%s%Q%$%k$G$-$k$h$&$K$7$?!#(B + +pre4 + * config.sub, config.guess update + +pre3 + * freetype compile errror fix + * Dr.Stop$B$,F0:n$,F0:n$7$J$+$C$?$N$r(Bfix (Thanx by Onodera Hirotaka) + * Gtk2.0$B$N%A%'%C%/$rF~$l$?(B + +pre2 + * configure$B;~$N(Blibjpeg$B$N%A%'%C%/$K<:GT$7$F$$$?$N$r(Bfix + (Thanx by Tamura Toshimichi) + +pre1 + * configure$B;~$K(B libjpeg$B$N>l=j$r;XDj$G$-$k$h$&$K$7$?!#(B --with-libjpeg-prefix + * src/tempname.c $B$,%3%s%Q%$%k=PMh$J$$>l9g$,$"$C$?$N$r(Bfix + (Thanx by Tamura Toshimichi) + +Version 1.7.1 -> Version 1.7.2 (2003.12.21) + +final + * no change from pre3 + +pre3 + * sys_reset$B%3%^%s%I$,$h$P$l$?$H$-$K!"%F%s%]%i%j%G%#%l%/%H%j$r>C$7$F$$$J$+$C$?(B + $B$N$r(Bfix (Thanx by OKUMURA N. Shin-ya) + * music$B%5%V%7%9%F%`$N=i4|2=$r(Bmusic server $B%W%m%;%9$G9T$&$h$&$K$7$?!#(B + (sys_reset$B$G%G%P%$%9$rDO$s$@$^$^$K$J$j2;3Z$,$J$i$J$/$J$C$F$$$?(B) + (Thanx by OKUMURA N. Shin-ya) + * SACT/sactcg.c: fix compile problem (by OKUMURA N. Shin-ya) + * SACT/sactcg.c: $B0z?t$,9g$C$F$$$J$$$N$r(Bfix (by OKUMURA N. Shin-ya) + * SACT/sactcg.c: sg_loadcg_no() $B$,(B NULL$B$rJV$9>l9g$N=hM}$rDI2C(B + (Thanx by OKUMURA N. Shin-ya) + * SACT/sactcg.c: cg$B%*%V%8%'%/%H$N2s<}J}K!$N:FJQ99(B + ($B%(%9%+$N%m!<%I;~Ey$GMn$A$F$$$?$N$r(Bfix) + +pre2 + * NightDemonDemo: $B%G%b$r%9%-%C%W$G$-$k$h$&$K$7$?(B + * IMA ADPCM $B7A<0$N(B .WAV $B%U%!%$%k$r:F@8$G$-$k$h$&$K$7$?(B + * gcc-3.3.2+glibc-2.3.2$B$N4D6-$G(B alk.h $B$G%(%i!<$,$G$F$$$?$N$r(Bfix + (by OKUMURA N. Shin-ya) + * $B%F%s%]%i%j%G%#%l%/%H%j$r(B mkdtemp $B$G:n@.$9$k$h$&$K$7$F!"%^%k%A%f!<%64D6-$G$N(B + $B$$$/$D$+$NLdBj$r2r>C$7$?(B(Thanx by OKUMURA N. Shin-ya) + +pre1 + * add NightDemonDemo.Init, NightDemonDemo.Run + +Version 1.7.0 -> Version 1.7.1 (2003.08.31) + +final + * SACT.MusicCheck $B$G6J$,B8:_$7$J$$>l9g!"Mn$A$F$$$?$N$r(Bfix + * $B%"%;%s%V%i(B(nasm)$B$NB8:_%A%'%C%/$rF~$l$?(B + * portab.h $B$+$i(B abs $B$r:o=|(B (thanx by OKUMURA N. Shin-ya) + +pre4 + * add dummy AliceDemo.dll NightDemonDemo.dll + * add SACT.MusicCheck command + * SACT.MusicXXX $B$G%U%!%$%kHV9f$K(B0$B$,;XDj$5$l$?$H$-$KBP1~(B + * SACT: $B;HMQCf$N(Bcg$B%*%V%8%'%/%H$r3+J|$7$F$$$?>l9g$,$"$C$?$N$r(Bfix + +pre3 + * pcmobj$B$N%m!<%IEy$N(Bcleanup + * libtool$B$,%$%s%9%H!<%k$5$l$F$$$J$$$H$-!"(Bmodules/lib $B$,%3%s%Q%$%k$G$-(B + $B$J$+$C$?$N$r(Bfix (thanx by FUJITA) + * 8bitPCM$B$NJQ49$,@5$7$/$J$+$C$?$N$r(Bfix + ($B54C\2&$J$I$G8z2L2;$N=*N;;~$K%N%$%:$,$N$C$F$$$?(B) + +pre2 + * modules/libs/graph_rect.c $B$K(B 8/24bit$B$N%3!<%I$rDI2C(B + * sys_exit$B$,@5$7$/=*N;%3!<%I$rJV$7$F$$$J$+$C$?$N$r(Bfix + (thanx by OKUMURA N. Shin-ya) + * ShSound$B$G%a%b%j>e$G:81&$N%A%c%s%M%k$NF~$l49$($,=PMh$J$/$J$C$F$$$?$N$r(Bfix + (thanx by OKUMURA N. Shin-ya) + * SACT.SoundXXXX $B$GG[Ns30$N%a%b%j$rGK2u$7$F$$$?$N$r(Bfix + * $B%P%C%/%m%01\MwCf$N%[%$!<%k$NA`:n$r5U$K$7$?(B + +pre1 + * $B8z2L2;$,>C$($:$K;D$k$3$H$,$"$C$?$N$r(Bfix + * MMX$B%k!<%A%s$N4XO"$G!"(Bsurface$B$r2##1%i%$%sJ,$@$1M>J,$K3NJ]$9$k$h$&$K$7$?(B + * SACT: cg$B%*%V%8%'%/%H$N2s<}J}K!$N(Bcleanup + * SACT: $B%a%C%;!<%8%9%W%i%$%H$NHO0O$r1[$($FJ8;z$rIA2h$9$k>l9g$,$"$C$?$N$r(Bfix + + +Version 1.6.0 -> Version 1.7.0 (2003.07.21) + +final + * BA$B%U%!%$%k$N1iAUMQ%9%m%C%H$N7hDjJ}K!$NJQ99(B + * $B%7%'%k%/%l%$%k$N(B*BA.BGI$B%U%!%$%k$,@5$7$/$h$_$3$a$F$J$+$C$?$N$r(Bfix + ($B%*!<%W%K%s%0$N6J$N=*$j$,$*$+$7$+$C$?(B) + * $B%7%'%k%/%l%$%k$G(BZ$B%-!<$G%a%C%;!<%8Ms$,>C$($J$+$C$?$N$r(Bfix + * image$B3HBg=L>.%k!<%A%s$G%P%C%U%!%*!<%P!<%i%s$9$k>l9g$,$"$C$?$N$r(Bfix(again) + * SACT.DrawEffect$B$N(B10$BHV$N8z2L$,@5$7$/F0$$$F$$$J$+$C$?$N$r(Bfix + * SACT.DrawEffect$B$N(B19$BHV$N8z2L$rDI2C(B + * SACT.RegistReplaceString$B$G(Bsrc$B$H(Bdst$B$,F1$8J8;zNsHV9f$N;~$OL5;k$9$k$h$&$K$7$?(B + * $B%P%C%/%m%01\MwCf$K(BCtrl$B$r2!$9$H$X$s$K$J$C$F$$$?$N$r(Bfix + * $B%P%C%/%m%0$N%Z!<%8(BUP/DN$B$r(B1$B9T$9$/$J$/$7$?(B + * $B%k%S$D$-J8;z$N$H$-$N%;%s%?%j%s%0$N0LCV$,$*$+$7$+$C$?$N$r(Bfix + +pre6 + * --enable-pkg-config $B$G(B glib $B$,8+IU$1$i$l$J$+$C$?$N$r(B fix + * MMX alpha blend(ablend16_ppp.s)$B$G(B blend$BN($,(B0$B$N;~$KMn$A$F$$$?$N$r(Bfix + ($B:J$_$0$$#2$N%/%$%C%/%m!<%IEy(B) + * SACT.MessageOutput(Ex)$B$N.$5$/$J$C$?$H$-(B(640x480$B"*(B640x400$BEy(B)$B$K%(%i!<$GMn$A$F$$$?$N$r(Bfix + +pre3 + * add SACT.MusicGetLength command + * SACT.MusicGetPos $B$,@5$7$$CM$r$+$($7$F$$$J$+$C$?$N$r(Bfix + * $B$/$jJV$7?t$,#1$N2;3Z$r:F@8$G$-$J$+$C$?$N$r(Bfix + ($B%(%9%+%l%$%d!<$N%(%s%G%#%s%0Ey(B) + +pre2 + * SACT.EffectDraw$B$N(B10$BHV$N8z2L$rDI2C(B + * 16bit alpha blend $B$^$o$j$N$_$J$*$7(B + * Gpx.CopyEffect(2,4) $B$G;2>H%5!<%U%'%$%9$,4V0c$C$F$$$?$N$r(Bfix + * eeDemo.Run $B$K0z?t$,$?$j$J$+$C$?$N$r(B fix + +pre1 + * $B4q?t(Bx$B4q?t%5%$%:$N(Bqnt$B%U%!%$%k$NE83+$,$*$+$7$+$C$?$N$r(Bfix + * Gpx.c $B$+$i(B cg -> surface $BJQ49It$r@Z$j=P$7$F(B libgraph $B$XE}9g(B + * DLL $BMQ$K%a%C%;!<%8J8;zNs=PNO!"%-!<$H%^%&%9%$%Y%s%H$N(B callback $B$r@_Dj$G$-$k(B + $B$h$&$K$7$?!#(B + * menuReturnGoto $B$G(B farcall $B$+$i$N(Breturn$B$,$G$-$J$+$C$?$N$r(Bfix + * ablend16.s: rate$B@_Dj$"$j$N>l9g$K$*$+$7$$$H$-$,$"$C$?$N$r(Bfix + * PCM$B%G!<%?$N:81&%A%c%s%M%kH?E>$d(B16bitWAV$B%U%!%$%k$N(BEndian$BJQ49$J$I$r(B + $B:F@8;~$K%j%"%k%?%$%`$G9T$&$h$&JQ99(B + * $B8z2L2;%G!<%?$H$7$F(BOGG$B%U%!%$%k$r:F@8$G$-$k$h$&$K$7$?(B + * BGM$B%G!<%?(B(*BA.ALD)$B$r07$($k$h$&$K$7$?!#(B + * $B5/F0;~$N2hLL$NBg$-$5$r(B 640x480 $B$K$7$?!#(B + * SACT.DLL $B$r0lIt.%k!<%A%s$G%P%C%U%!%*!<%P!<%i%s$9$k>l9g$,$"$C$?$N$r(Bfix + + +Version 1.5.4 -> Version 1.6.0 (2003.02.01) + +final + * gtk-1.0$B;~$K(BGLIB_{CFLAGS|LIBS}$B$,@_Dj$5$l$F$$$J$+$C$?$N$r(Bfix + * libgen.h $B$NB8:_%A%'%C%/$HL5$$4D6-$G$NBP:v$r$$$l$?(B + * FreeBSD+OSS$B$G(BSNDCTL_DSP_GETBLKSIZE$B$GF@$?%5%$%:$h$j>.$5$$D9$5$r(Bwrite$B$9$k(B + $B$H0J8e(Bdevice$B$,(Bready$B$K$J$i$:(Bpoll$B$GBT$F$J$/$J$k$N$r(B fix (thanx by kurokawa) + * font_x11.c $B$G%a%b%j!<%j!<%/$,$*$-$F$$$?$N$r(B fix (thanx by kurokawa) + * modules$B0J2<$G$$$/$D$+(B Makefile.am$B$N(B@GLIB_LIBS@$B$,$*$+$7$/$J$C$F$$$?$N$r(Bfix + * x11$B$G%U%k%9%/%j!<%s$K$G$-$J$/$J$C$F$$$?$N$r(B fix (thanx by matuyama_takaaki) + * TPC|TPS|TPP$B%3%^%s%I$G%9%?%C%/$K$D$s$@%G!<%?$,4X?t$+$i$N%j%?!<%s$N:]$NA4(BPOP + $B$N:]$K@5$7$/CM$rLa$7$F$$$J$+$C$?$N$r(Bfix ($B%j%/%k%9$N$*$^$1%b!<%I$GA*BrCf$N(B + $B%a%C%;!<%8$NI=<($,0lIt$*$+$7$/$J$C$F$$$?(B) (thanx by matuyama_takaaki) + * module$B$N8!:w%Q%9$,=EJ#$7$FEPO?$5$l$F$$$?$N$r(Bfix + * pcmlib_load() $B$G%a%b%j!<%j!<%/$7$F$$$?$N$r(Bfix + * $B%j%=!<%9%U%!%$%k$K$h$k%+!<%=%k7A>u$NJQ99$rL58z$K$9$k%*%W%7%g%s$rDI2C(B + (-noimagecursor) + +pre4 + * font_gtk.c $B$GB8:_$7$J$$%U%)%s%H%U%!%$%k$r;XDj$9$k$H0[>o=*N;$7$F$$$?$N$r(Bfix + * SDL/24bpp$B$G%9%W%i%$%H$N?'H4$1$,$G$-$J$$$3$H$,$"$C$?$N$r(B fix ($BBg0-;J$N(B + $B%"%K%a!<%7%g%sEy(B) (thanx by matuyama_takaaki) + * --disable-debug $B$r%G%U%)%k%H$X(B + * --disable-gtk $B$NI|3h$H4XO"$9$k(B configure.ac $BEy$N(B cleanup + * $B%b%8%e!<%k$r:G=i$K%+%l%s%H%G%#%l%/%H%j$N2<$+$i8!:w$9$k$h$&$K$7$?!#(B + * add msgSetOutputFlag command + * $B%G%U%)%k%H$N(Baudiodevice$B$N@_Dj$,8z$$$F$$$J$+$C$?$N$r(B fix + * $B%;!<%V$,<:GT$7$?>l9g!"I,$:%3%s%=!<%k$K%(%i!<%a%C%;!<%8$r=P$9$h$&$K$7$?!#(B + ($B%;!<%V$,<:GT$7$F$b%7%J%j%*B&$GL5;k$9$k>l9g$,$"$k$N$G(B) (thanx by kurokawa) + * $B%a%C%;!<%8NN0h$NB`Hr!&2sI|$K0lIt<:GT$7$F$$$?$N$r(B fix ($B$Q$9$A$c$G2hLL99?7(B + $B$,0lIt@5$7$/$J$+$C$?(B) (thanx by kurokawa) + +pre3 + * Ctrl+C $B$G@5$7$/=*N;$G$-$J$+$C$?$N$r(B fix + * -midiplayer $B%3%^%s%I%i%$%s%*%W%7%g%s$r$D$1$?(B + * EN$B%3%^%s%I$G$I$NNN0h$K$b4^$^$l$F$$$J$$$H$-$NJV$jCM$,@5$7$/$J$+$C$?$N$r(Bfix + ($B2&;RMM(BLv1.5$B$G%9%1%8%e!<%k$NA*Br$,7hDj$G$-$J$+$C$?(B) + * music_fade.c: pcmobj$B$,(BNULL$B$N;~$K(Bfade$B$,;O$^$k$HMn$A$F$$$?$N$r(B fix + * add wavFadeVolue command + * endian $B$NH=Dj$r(B portab.h $B$+$i(B configure.ac $B$K(B (AC_C_BIGENDIAN) + * remove acconfig.h + * configure.ac $B$+$i(B --disable-gtk $B$r$J$/$7$?(B + * PPC+OSS$B$G0lIt2;$,@5>o$K$J$i$J$+$C$?$N$r(B fix (Thanx by Onodera Hirotaka) + +pre2 + * fix some compile warning + * Ain $B%U%!%$%k$,;XDj$5$l$F$$$J$$$H$-$K(B 2F60 command $B$,8F$P$l$k$H0[>o=*N;(B + $B$7$F$$$?$N$r(B fix + * contrib/*.inf $B$K4v$D$+$NDj5A%U%!%$%k$rDI2C(B + * -O0 $B;~$K(Bfade $B>uBV$,@5$7$/$H$l$F$$$J$+$C$?$N$r(B fix (-O0$B;~$K:J$_$0$$$,F0$+$J(B + $B$+$C$?(B) (Thanx by Onodera Hirotaka) + * {OSS|ALSA}$B$G(BPCM$B$N%U%)!<%^%C%H$r(B LE -> NE $B$X(B + * $B2;3Z%U%'!<%IMQ%+%&%s%?$,@5$7$/=i4|2=$5$l$F$$$J$+$C$?$N$r(B fix + * $B%o!<%/Fb$N=i4|%\%j%e!<%`$,@5$7$/=i4|2=$5$l$F$$$J$+$C$?$N$r(B fix + * $B%U%'!<%I3+;O;~$N%\%j%e!<%`$,@5$7$/@_Dj$5$l$F$$$J$+$C$?$N$r(B fix + +pre1 + * --enable-sdl$B;~$N%3%s%Q%$%k(Bfix + * SDL$B$G(B alpha <-> DIB $B4V$N%3%T!<(B(Copy_{from|to}_alpha)$B$,@5$7$/F0$$$F$$$J$+$C$?(B + * SDL_*.c$B$H(Bimage*.c$B$H$N(Bdepth$B$,0lCW$7$F$$$J$+$C$?$N$r(Bfix ($BBg0-;J$G@oN,%^%C%W$,(B + $B@5$7$/I=<($G$-$J$+$C$?(B) + * configure.ac $B$N(B cleanup (freetype$B$r<+F08!=P$K(B) + * -M0/-O0 ($B;HMQIT2D$K$9$k(B)$B%*%W%7%g%s$NDI2C(B + * audio_oss.c$B$N(Bsoundcard.h$B$N%Q%9$NJQ99(B + * .wav$B%G!<%?$NFI$_9~$_$N(B src/pcmlib.c $B$X$N0l852=(B + * BIGENDIAN$B%^%7%s$G$N(B16BitPCM$B%G!<%?$OFI$_9~$_;~$KJQ49$9$k$h$&$K$7$?(B + * ShSound/pcmlib.[ch]$B$N(B ShSound/shpcmlib.c $B$N%U%!%$%kL>JQ99(B + + +Version 1.5.3 -> Version 1.5.4 (2002.12.31) + +final + * esd$B$N%\%j%e!<%`@_Dj$G!"(BMASTER$B$H(BPCM$B0J30$OL5;k$9$k$h$&$K$7$?(B + * gcc3$BBP:v$G(B __func__$B$r%i%C%W$7$F(B sys_error -> SYSERROR $B$KJQ99(B + (thanx by OKUMURA N. Shin-ya) + * PCM$B9g@.$G(Bmono->stereo$B$NJQ49$,0lIt$*$+$7$+$C$?$N$r(Bfix($B$+$($k$K$g9q$N%"%j%9(B + $B$G8z2L2;$,$*$+$7$+$C$?(B) + * cdrom.mp3|midi.extplay$B$N(Bpipe$B%b!<%I$G(Bstop$B$,5!G=$7$F$$$J$+$C$?$N$r(Bfix + * midi.extplay$B$N(Bpipe$B%b!<%I$G1iAU>uBV$,@5$7$/$H$l$F$$$J$+$C$?$N$r(Bfix + * musstrem$B$N(Bpipe open$B;~$O8e$N(Bseek$B$G(Bopen$B$5$;$k$h$&$K$7$?(B + * midi.rawmidi.c$B$N(Bmidi$B%9%/%j%W%H=hM}$NHy=$@5(B + * midi.rawmidi.c$B$G(Bmidi$B%9%/%j%W%H=hM}$G!"(Bjump$B;~$O(BALL ch NOTE off $B$r$$$l$k$h$&(B + $B$K$7$?!#(B($B%k!<%W$N;~$J$I$K2;$,;D$i$J$/$J$C$?(B) + +pre3 + * System_tmpDir $BEy$N%0%m!<%P%kJQ?t$N:o=|(B + * -devfont $B$N%G%P%$%9L>$G(B TrueTypeFont $B$O(B ttf $B$KE}0l(B(ft2$B$b$^$@;H$($^$9(B) + * alk.[ch] $B$r(B modules/dDemo $B$+$i(B modules/lib $B$X0\F0(B + * $B;D$C$F$$$?(B __FUNCTION__ $B$r(B __func__ $B$KCV$-49$((B + * music_client.c: mus_pcm_stop()$B$G(B socket $B$NJD$8K:$l$G$,$"$C$?$N$r(Bfix + (by OKUMURA N. Shin-ya) + * xcore_input.c: KeyPress|Release$B$N;~$N(BButtonMask$B=hM}$r$O$:$7!"$+$o$j$K(B + ButtonPress|Release$B;~$N(BRawKeyInfo$B$X@5$7$/H?1G$5$;$k$h$&$K$7$?(B + * ShPort.{Set|Get}KeyStatus $B$K$h$k%-!<%^%C%W@Z$jBX$($KBP1~(B ($BBg0-;J$G1&%\%?%s(B + $B$r2!$9$H%a%C%;!<%8%9%-%C%W>uBV$K$J$C$F$$$?(B) (thanx by matuyama_takaaki) + * PCM$B9g@.$G<~GH?tJQ49$,$J$/(BVol|bit|ch$BJQ99$,$"$k>l9g$N=hM}$,4V0c$C$F$$$?$N$r(Bfix + ($BBg0-;J$G%Q%$%W$K$h$k(BMP3$B:F@8$G%N%$%:$K$J$C$F$$$?(B)(thanx by matuyama_takaaki) + * doc/TECH.TXT $B$K(B VA/ZK $B%3%^%s%I$N5-=R$rDI2C!#(B + +pre2 + * audio device file $B$N%G%U%)%k%H$N@_Dj$rJQ99(B + * audio $B4X78$N(B popup $B%a%K%e!<$r:o=|(B + * $B%7%J%j%*$N(B busy loop $B$rHr$1$k$?$a(B main loop $B$K(B usleep $B$rF~$l$F$_$k(B + * __func__ $B$^$o$j$NJQ99(B (thanx by OKUMURA N. Shin-ya) + * $B$$$/$D$+$N(B WARNING $B%a%C%;!<%8$NJQ99(B + * DC $B%3%^%s%I$NG[NsJQ?t$N3NJ]J}K!$NJQ99!#(B($B%i%s%9#4$G0[>o$J5sF0$,$_$i$l$?(B) + (thanx by OKUMURA N. Shin-ya) + * $B%^%&%9%+!<%=%k$N0\F0B.EY$N%G%U%)%k%H$rJQ99(B (100msec -> 50msec) + * $Br7o%3%s%Q%$%k$G(B ALSA $B$,A4$/%3%s%Q%$%k$5$l$F$$$J$+$C$?$N$r(B fix + * alsa $B$N(B fragment size $B$NJQ99(B (8192->1536) + * audio device $B$r%2!<%`Cf$O>o$K(B open $B$K$7$F$*$/$h$&$K$7$?(B + * auido $B$N(B rate $BJQ49$G%P%C%U%!0n$l$,5/$-$F$$$?$N$r(B fix + + +Version 1.5.2 -> Version 1.5.3 (2002.09.01) + +final + * fix some compile warning + * Gpx.EffectCopy $B$N(B 11$BHV$N8z2L$rJQ99(B + * cdrom.mp3 $B$G0z?t$NJ,2r$r(B basename $B$H(B strtok_r $B$G$*$3$J$&$h$&$K$7$?!#(B + (by Tomoaki Mega) + * fix ALSA09 'COMPILE' + +pre7 + * ShSound: wav*Memory $B$G(B load $B8e$O$9$0$K(Bdridata$B$r2rJ|(B + * music_pcm|midi $B$G(B dridata $B$N2rJ|J}K!$,8E$$J}K!$@$C$?$N$r(B fix + * PCM$B$N1iAUD9$5$ruBV$,@5$7$/ client $B4V$N%Q%1%C%H%9%H!<%`2sHr$N$?$a$K(B usleep $B$r$$$l$?(B + * $B%9%Z!<%9$r4^$`%U%!%$%kL>$r(Bcdrom.mp3$B$N(Bpipe$B%b!<%I$GEO$7$?$H$-$KF0$+$J$+$C$?(B + $B$N$r(B fix + +pre6 + * mus_wav_* $B$G(B ch $B$NHO0O%A%'%C%/$r$$$l$?(B + * volume $B$N@_Dj$G5/F0;~$N(Blevel$B$r(B100%$B$H$9$k$h$&$K$7$?(B + * pcmlib $B$r(B xsystem35 $B%3%";HMQIt$H(B ShSound $B;HMQIt$KJ,N%$7$?(B + * ShSound: wav*Memory $B$N%G!<%?$N07$$J}$rJQ99$7$?(B + * ShSound: add wavFadeVolume command + * mus_wav_unload $B$H(B mus_wav_stop $B$G(B ch$B>pJs$,@5$7$/Aw$l$F$$$J$+$C$?$N$r(B fix + ($B%j%/%k%9Ey$G8z2L2;$,$J$j$C$Q$J$7$K$J$C$F$$$?(B) + * audio_write $B$G(B 0$B%P%$%H$N(B write $B$OL5;k$9$k$h$&$K$7$?!#(B + +pre5 + * $B%j%/%k%9$G!"%8%g!<$K:G=*1|5A$rEAo=*N;;~$K;D$C$?(B sockt file $B$r:o=|$9$k$h$&$K$7$?(B + * add alsa for new music subsystem + * update macro/alsa.m4 + * mus_wav_waitend $B$G:F@8$7$F$$$J$$$H$-$O$9$0$K(Back$B$rJV$9$h$&$K$7$?!#(B + +pre4 + * dri.c: $B%U%!%$%k?t$N8+@Q$b$j%P%0$GNN0h30$N%a%b%j$r;2>H$7$F$$$?$N$r(B fix + * version 1.5 $B7OMQ$K(B xsystem35.spec.in $B$r=$@5(B + * gcc $B0J30$N%3%s%Q%$%iBP:v(B (-Wall, __FUNCTION__) + * linux $B$K$*$1$k(B endian $B7hDj$NJ}K!$NJQ99(B + * ShString: $BJ8;zNs$NCV49$GJ#?t$NJ8;zNs$r@5$7$/CV$-49$($i$l$F$$$J$+$C$?$N$r(Bfix + $BBg0-;J$G$*$+$7$JL>A0$N%-%c%i$,=P8=$9$k!#(B(by matuyama_takaaki) + * ShArray: typo fix + * ShArray: GrepHighOrderArray $B$G:G>.CM$N07$$$,4V0c$C$F$$$?$N$r(B fix + $BBg0-;J$GBNNO=g$KJB$Y$k$H%-%c%i$,>C$($?!#(B(thanx by matuyama_takaaki) + * rewrite music subsystem + +pre3 + * .xsys35rc $B$N@_Dj$G(BTrueTypeFont$B$N(B face $B$rA*Br$G$-$k$h$&$K$7$?!#(B + * MMX alphablend $B$G0lIt$*$+$7$+$C$?$N$r(B fix (SeeIn$B@D$N%*!<%W%K%s%0(B) + * 24$B%S%C%H%+%i!<$G$$$/$D$+$*$+$7$$$H$3$m$,$"$C$?$N$r(B fix + ($B%j%/%k%9$G@oF.%7!<%s$G967b$,Ev$?$C$?;~$N8z2L$G0l=V?'$,Mp$l$k(B) + ($BBg0-;J$N@oF.%7!<%s%"%K%a!<%7%g%s$G?'$,H4$1$J$$(B) + * Gpx.BrightDestOnly+MMX$B$GL@$k$5;XDj$,$*$+$7$+$C$?$N$r(B fix + ($B%j%/%k%9$N(BCG$B%b!<%I$GHsA*Br(BCG$B$,0E$/$J$i$J$$(B) + * dataGetWORD $B$,(B BigEndian $B%^%7%s$G@5$7$/$J$+$C$?$N$r(B fix + * add cdGetMaxTrack command ($BBg0-;J$N%7%J%j%*%P!<%8%g%s(B 1.05 $B$GLdBj$,$G$F$$$?(B) + * F $B%3%^%s%I$r(B data* $B%3%^%s%I7O$K9g$o$;$F=q$-D>$7$?(B + +pre2 + * image.c: image_putRegion $B$KHO0O%A%'%C%/$r$$$l$?(B + * message.c: $B8=:_;HMQCf$N%a%C%;!<%8(BWindow$B>pJs$K4X$7$FB`Hr>pJs$,@5$7$/H?1G(B + $B$5$l$F$$$J$+$C$?$N$r(B fix ($B%G%#%"%\%j%+$G(Bsegv$B$C$F$$$?(B) + * sel/msg: $B%&%#%s%I>pJs$K4X$9$kl9g$K$*$+$7$+$C$?$N$r(B fix + * font_freetype2.c $B$G%U%)%s%H$N%(%s%3!<%IJ}<0$r$G$O$J$/!"H>2sE>$K$7$?(B + + +Version 1.5.1 -> Version 1.5.2 (2002.04.30) + +final + * automake $B4XO"$N(B cleanup + * CDROM_LINUX $BEy$r(B ENABLE_CDROM_LINUX $B$XJQ99(B + * struct _message $B$,Dj5A$:$_$N4D6-$,$"$C$?$N$G(B __message $B$KJQ99(B + +pre5 + * oDEMO $B%G%#%l%/%H%j$r(B commit $B$7K:$l$?(B + +pre4 + * font_freetype2.c $B$G%"%s%A%(%j%"%9(BOFF$B;~$d>.$5$$%U%)%s%H%5%$%:$GKd$a9~$_%S%C%H(B + $B%^%C%W%U%)%s%H$,$"$k>l9g$O$=$A$i$r;H$&$h$&$K$7$?!#(B(by TAJIRI Yasuhiro) + * gtk-1.3$B7O$X$NBP1~(B(by Fumihiko Murata) + * $B%;!<%V%U%!%$%k$N%P%C%/%"%C%W$r:n@.$9$k$H$-$K!"%P%C%/%"%C%W85$,6u$N>l9g$K(B + $B$*$+$7$+$C$?$N$r(B fix (by Fumihiko Murata) + * SDL HAVE_SDLRALPHA $B4X78(B clean up (by Fumihiko Murata) + * $B%j%/%k%9$N%W%m%m!<%0$GN.9kE4$K>!$D$H%2!<%`$,Mn$k$N$r(B fix + (by matuyama_takaaki) + * JIS0213 $B%(%s%3!<%IJ}<0$N(B TrueType Font $B$KBP1~!#(B(by TAJIRI Yasuhiro) + * TrueType Font $B$N%(%s%3!<%IJ}<0Kh$N@ZBX$(J}<0$rJQ99(B + * add empty oDEMO.dll + * Gpx.dll: surface $B$r0lEY$b:n$i$J$$$&$A$K(B find_null_surface $B$r8F$V$HM=Ls$7$F(B + $B$"$C$?(B surface0 $B$rJV$7$F$7$^$C$F$$$?$N$r(B fix + * $BF.?@ET;T#2$G(B CD-DA $B$N6J$,@Z$jBX$o$i$J$$$N$r(B fix (by OKUMURA N. Shin-ya) + * OSS $B$G%5%&%s%I$,8G$^$k$N$r(B fix (by OKUMURA N. Shin-ya) + * ShSound.dll: $B0lIt$N4X?t$rDI2C(B + * Gpx.dll: misc clean + +pre3 + * add ShArray.ChangeEquArray command + * Gpx.LoadCG$B$G(B PMS8 $B$rFI$_9~$s$@;~$O&ANN0h$KE83+$9$k$h$&$K$7$?(B + * xcore_setForeground $B$G%Q%l%C%HHV9f$,JQ2=$;$:!"%Q%l%C%H$NCf?H$,JQ2=$7$?$H$-$K(B + $B8E$$?'$GEI$i$l$F$$$?$N$r(B fix + * ShGraph.dll: $B%Q%i%a!<%?$N2r agsurface_t $B$KL>A0$H0lIt%a%s%P$rJQ99(B + * pre1 $B$G$N(B alpha plane $B$NJQ99$K(B SDL $B$,0lItDI=>$G$-$F$$$J$+$C$?$N$r(B fix + * -noantialias $B%*%W%7%g%s$r$D$1$?!#(B + * ags.c: region check $B$G(B width,height $B$,(B 0 $B0J2<$K$J$C$?$H$-$N=hM}$rDI2C(B + * alpha blend $B$N(B MMX $BBP1~$,$A$c$s$HF0$$$F$$$J$+$C$?$N$r(B fix + * ShGraph.dll: $B%"%K%a!<%7%g%s4XO"$N4X?tDI2C(B + * menuReduce $B$G;XDj$5$l$??t$h$j$b/$J$$>l9g$K(B + $B$*$+$7$+$C$?$N$r(B fix + +pre1 + * SJIS->UNICODE$BJQ49%F!<%V%k$K(BIBM$B3HD%4A;z$N9`$,L5$+$C$?$?$a!"(Bunicode $B%^%C%W$N(B + TrueType font $B$G(BIBM$B3HD%4A;z$,I=<($G$-$J$+$C$?$N$r(B fix (by TAJIRI Yasuhiro) + * MZ0 $B%3%^%s%I$GJ8;zNsD9$5$,(B 0 ($B!g!)(B)$B$N>l9g$KBP1~(B + * ShCalc.dll, ShArray.dll, ShString.dll, Gpx.dll $B$N4X?t$N$&$A!"Bg0-;J$G(B + $B;H$o$l$F$$$k$b$N$NDI2C!#(B + * font_freetype2.c $B$N%U%)%s%H$N%Y!<%9%i%$%s$r$=$m$($k$h$&$K$7$?!#(B + * $B%a%$%s2>A[2hLL(B(GetDIB()$B$G$H$l$k$b$N(B)$B$N(B alplha plane $B$rE}9g$7$F2>A[2hLL$N(B + $BG[2<$K$7$?!#(B + * Gpx.dll: $BFI$_9~$s$@(B CG $B$K(B alpha $B>pJs$,L5$$>l9g$O!"(B0 $B%/%j%"$5$l$?(B alpha plane + $B$rJV$9$h$&$K$7$?!#(B + * add menuReduce, menuGetNumof, menuGetText, menuGoto, menuReturnGoto command + * selection.c, message.c $B$N%0%m!<%P%kJQ?t$r(B nact $B9=B$BN$N2<$X(B + + +Version 1.5.0 -> Version 1.5.1 (2001.11.30) + +final + * RandMT.dll($B2&;R$5$^(Blv1)$B$KBP1~(B + * .gr$B%U%!%$%k$,L5$$>l9g$K(B *RA.ALD $B$bC5$9$h$&$K$7$?!#(B + * libtool$B$N4XO"$G(Bmodule$B$,%3%s%Q%$%k$G$-$J$$$N$r(B fix + * qnt.c $B$GE83+%P%C%U%!ITB-$N$?$a(B zlib $B$NE83+$K<:GT$7$F$$$?$N$r(B fix + * $BBg0-;J$N(B DLL $B$N%(%s%H%j$rDI2C(B + * QNT format version 1 $B$KBP1~(B + * update doc/TECH.TXT + * update doc/README.music + +pre4 + * pre2$B$G$$$l$?(B sysVar $B$N:GBgCM$NJQ99$G$3$l$^$G$N%;!<%V%G!<%?$,FI$a$J$/(B + $B$J$C$F$$$?$N$r(B fix + * G$B%3%^%s%I$G%U%!%$%k$,B8:_$7$J$$>l9g!"(BJ$B%3%^%s%I$N@_Dj$r99?7$7$F$$$J$+$C$?(B + $B$N$r(Bfix($B54C\2&$NLB5\C58!$GE($N(BCG$B$NItJ,$,$*$+$7$+$C$?(B) + * SDL $B%U%k%9%/%j!<%s;~$K2hA|$NI=<(NN0h$,$+$o$k$H$*$+$7$+$C$?$N$r(Bfix + ($B%G%#%"%\%j%+$N(BBAD-END$B$G:F8=(B) + * update doc/TECH.TXT + * system39.ain $B$X$N%a%C%;!<%8Kd$a9~$_$X$NBP1~(B + * add patchEC, patchENEM command + * $B$+$($k$K$g9q$K$g%"%j%9$GA*Br%&%#%s%I$NA*Br;h$,8+$($K$/$$$N$r2~A1(B + * add Gpx.EffectCopy{7,11,12,13} command + * add WZ 1,e command + +pre3 + * libtool-1.4 $B0J30$,%$%s%9%H!<%k$5$l$F$$$J$$$H%3%s%Q%$%k$G$-$J$+$C$?$N$r(B fix + * newer config.sub/guess + * gexttext(0.10.39) automake(1.4p5), autoconf(2.52) $B$K$=$l$>$l(B up + * .gr $B%U%!%$%k$,$J$$>l9g$K<+F0E*$K@8@.$9$k%;!<%V%U%!%$%k$r(B 26 $B8D$K(B + * $B!V(BOnly You $B%j%/%k%9!W(B Math.dll $B$KBP1~(B + * $B!V(BOnly You $B%j%/%k%9!W(B Gpx.dll $B$N4X?t$rDI2Co=*N;$7$F$$$?$N$r(B fix + * add PT2 command + * add FAQ about gmake + * $BL488K"1F$G:G=i$KMn$A$k$N$r(B fix (QD 0: $B$H$$$&%3%^%s%I$,$"$C$?(B) + * Q/L command $B$G(B $BB8:_$7$J$$%U%!%$%k$N%A%'%C%/9T$&$h$&$K$7$?!#(B + * $B$Q$9$F$k%A%c%$%`!"%7%J%j%*%Q%C%A$N%I%-%e%a%s%H$N=$@5$HDI2C!#(B + * gettext $B$,%$%s%9%H!<%k$5$l$F$$$J$/$F$b(B build $B$G$-$k$h$&$K$7$?!#(B + * QNT cg format $B$KBP1~(B + * $B!V(BOnly You $B%j%/%k%9!W$N(BDLL$B$K0lItBP1~(B + +pre1 + * system39.ain $B$r%+%l%s%H%G%#%l%/%H%j$+$i$bC5$9$h$&$K$7$?(B + * $BLk$N(BDLL$B$N%(%s%H%j!<$@$1DI2C(B + * Darcrows $BEy$G%a%C%;!<%8$N2~9T$,0lIt$*$+$7$+$C$?$N$r(B fix + * FreeBSD $BEy$G(B libintl.h $B$,E,@Z$K(B include $B$G$-$F$$$J$+$C$?$N$r(B fix + (by Tamura Toshimichi) + * WV$B%3%^%s%I$G(B x/y $B$N$_$,JQ2=$7$?;~0[>oF0:n$7$F$$$?$N$r(B fix + ($B$+$($k$K$g$Q$K$g$s(B etc) + * CE $B%3%^%s%I$GIA2h@h$,(B view area $B$N30$N>l9g$K0[>oF0:n$7$F$$$?$N$r(B fix + ($B$+$($k$K$g$Q$K$g$s(B/ProStudent-Good etc) + * $BNw2AHG$+$($k$K$g$Q$K$g$s$G!"(BPCM$B1iAU$,(Bloop$B$7$F$7$^$&$N$r(B fix + (by TAJIRI Yasuhiro) + * DLL $B$NFI$_9~$_%Q%98uJd$r$$$/$D$+DI2C(B + + +Version 1.4.0 -> Version 1.5.0 (2001.05.09) + + * $B%7!<%s@D$N2;3Z4U>^$J$I$G2hLL99?7$,0lIt$*$+$7$+$C$?$N$r(B fix (xcore/sdl) + * $B%i%s%9#4$G!"0lIt$N(BCG$B$N?'$,$*$+$7$/$J$k$N$r(B fix (By matuyama_takaaki) + * $B!V$+$($k$K$g9q$K$g%"%j%9!W$N(B DLL $B$KBP1~(B + + +Version 1.3.4 -> Version 1.4.0 (2001.05.01) + +final + * --disable-debug $B$N;~0U?^DL$jF0$$$F$$$J$+$C$?$N$r(B fix + * cdrom.Linux.c $B$N(B LinuxPPC workaround $B$,$*$+$7$$$+$C$?$N$r(B fix + * -antialias $B%*%W%7%g%s$r$D$1$?(B + * Rance4 $B$N%-!<%&%(%$%HD4@0(B + +pre5 + * command2F60 $B4X78$r(B remove + * $B!VME@:(B(AliceCD 2.02)$B!W$G1&%/%j%C%/%a%K%e!<$rJD$8$?$"$H0[>o=*N;$7$F$$$?(B + $B$N$r(B fix + * $B%a%C%;!<%8$NJ8;z$NBg$-$5$r:GBg(B100$B%I%C%H$K@)8B!#(B + * add grBlt command + +pre4 + * SDL + joystick $B$N;~%3%s%Q%$%k$G$-$J$+$C$?$N$r(B fix (By matuyama_takaaki) + * $BJ8;zNsF~NO(B Window $BEy$NI=<(;~$NF0:n2~A1(B + * F1$B%-!<(B $B$G%a%C%;!<%8%9%-%C%W!"(BF4$B%-!<$G(B Fullscreen <-> Window $BI=<($N9T$-Mh(B + $B$r=PMh$k$h$&$K$7$?!#(B + +pre3 + * .gr $B%U%!%$%k$K6uGr9T$r4^$s$G$b6/@)=*N;$7$J$$$h$&$K$7$?!#(B + * $B%a%K%e!<$+$i(B cd/midi/pcm $B$rL58z2=$7$?$H$-!"LD$C$F$$$l$P;_$a$k$h$&$K$7$?!#(B + * CE36-38 command $B$G2hLL99?7$,0lIt$*$+$7$+$C$?$N$r(B fix + * CD44-47,50-52 command $B$G2hLL99?7$,0lIt$*$+$7$+$C$?$N$r(B fix + * PMS8 $B$G$O%Q%l%C%H$N(B 250-255 $B$rE>Aw$7$J$$$h$&$K$7$?!#(B + * savedata $B$N3JG<(B path $B$,IT@5$J;~$K0[>o=*N;$9$k$N$r(B fix + * $BJQ?t$X$NBeF~$G(B NULL ($BHO0O30(B) $B$N>l9g!"BeF~$7$J$$$h$&$K$7$?!#(B + * $BBg$-$$%5%$%:(B(96)$B$N%U%)%s%H$rFI$_9~$`;~$K%P%C%U%!0n$l$r5/$3$7$F$$$?$N$r(B fix + * $BFC$KBg$-$5%5%$%:$N%U%)%s%H$GJ8;z$N2<$,@Z$l$F$7$^$C$F$$$?$N$r(B fix + (font_freetype2.c) + +pre2 + * configure $B$,(B {freetype-prefix}/freetype.h $B$rH/8+=PMh$J$+$C$?$N$r(B fix + * Txx $B%3%^%s%I$G%9%?%C%/$K@Q$`%5%$%:$,$*$+$7$+$C$?$N$r(B fix + * Txx $B%3%^%s%I$GA*Br;h%&%#%s%I$N?'$H%5%$%:$rJ]B8$7$F$$$J$+$C$?$N$r(B fix + * add strMessageBox command + * $B%b%N%/%m%+!<%=%k0J30$OFI$_9~$^$J$$$h$&$K$7$?!#(B + +pre1 + * $B%F%s%]%i%j%G%#%l%/%H%j$K4X$9$k(B Warning $B$r:o=|(B + * gettext $B2=(B ($B%a%K%e!<$N$_(B) + * spec $B%U%!%$%k$N(B cleanup + * AFMT_S16_NE $B$,Dj5A$5$l$F$$$J$$>l9g%3%s%Q%$%k=PMh$J$+$C$?$N$r(B fix + * .xsys35rc $B$G%U%)%s%HL>$,@_Dj$5$l$F$$$J$$>l9g!"(Bsegv. $B$C$F$$$?$N$r(B fix + * SQ $B%3%^%s%I$G(B 16bit $B$N(B wav $B$,(B mix $B$G$-$F$$$J$+$C$?$N$r(B fix + * $B2&F;M&oJQ?t$r(B POP $B$9$k$H$-!"IT@5$J%"%I%l%9$r;2>H(B + $B$7$F$$$?$N$r(B fix + + +Version 1.3.3 -> Version 1.3.4 (2001.04.01) + +final + * $B%a%C%;!<%8$N:G8e$,(B `\0` $B$G=*$C$F$$$k$HMn$A$F$$$?$N$r(B fix + * snprintf $B$r(B g_snprintf $B$X(B + * DigitalUNIX/Irix$BEy(B $B$G?'$,$*$+$7$+$C$?$N$r(B fix + * cdrom.Irix.c $B$,%3%s%Q%$%k=PMh$J$+$C$?$N$r(B fix + * freetype library $B$,%$%s%9%H!<%k$5$l$F$$$k>l=j$r(B configure + --with-freetpe-prefix=PFX $B$G;XDj$G$-$k$h$&$K$7$?!#(B + * --disable-bgr $B$,5!G=$7$F$$$J$+$C$?$N$r(B fix + * $B%7%J%j%*%U%!%$%k$,8+$D$+$i$J$$$H(B segv. $B$C$F$?$N$r(B fix + +pre5 + * ResourceFile(ICON file) $B$r$A$c$s$HF0$/$h$&$K$7$?!#(B(xcore.c) + * ViewArea $B$,0\F0$7$?$H$-$N%^%&%9$N0LCVu$NJQ99$r$A$c$s$HF0$/$h$&$K$7$?!#(B + * SDL $B$G1&%\%?%s$r2!$9$H0[>o=*N;$9$k$3$H$,$"$C$?$N$r(B fix + * SDL + freetype $B$GJ8;z$,$A$c$s$H=P$J$$$N$r(B fix + * cdrom/midi $B$,L58z$N>l9g!"=*N;;~$KMn$A$k$N$r(B fix + * midi $BKd$a9~$_%U%i%0$r@5$7$/=hM}$7$F$$$J$+$C$?$N$r(B fix + +pre4 + * midi.raw.c/midifile.h: compile fix for FreeBSD + * audio_oss $B$G(B channel $B$N@_Dj$,$*$+$7$+$C$?$N$r(B fix + * fix more compile warning + * audio_oss $B$G(B fragment size $B$ND4@0(B + * MUS_PCM_STOP $B$G$O(B flush $B$;$:$K(B stop $B%3%^%s%I$rH/9T$9$k$3$H$K$7$?(B + * OSS sequencer device $B$KBP1~(B + * Mixer $B$N(B volume $B$,(B 0 $B$N;~$K%U%'!<%I$5$;$k$HMn$A$F$$$?$N$r(B fix + * midi/mp3 $B$N%W%m%;%9$,;D$C$?$^$^$^$J$N$r(B fix + * ALSA small cleanup + +pre3 + * add xsystem35.spec.in (from JRPM by Toshiya Takagi) + * $B%U%'!<%I>uBV$NoF0:n$7$F$$$?$N$r(B fix + * raw midi mode $B$G(B pause/unpause $B$,$*$+$7$+$C$?$N$r(B fix + * MJ $B%3%^%s%I$NF~NO(B Window $B$NI}$,C;$+$C$?$N$r(B fix + +pre2 + * $B?tCMF~NO%&%#%s%I$G%-%c%s%;%k$r2!$7$?$H$-$NF0:n$N(Bfix + * raw midi $B%$%s%?!<%U%'%$%9$r2p$7$?(B midi file $B$N1iAU$KBP1~(B + * freetype version 2 $B$KBP1~(B + * cdrom.mp3/midi.* $B$N6&M-%a%b%jIt$r(B music $B$N6&M-%a%b%jIt$X(B + * play_pipe.c $B$N(B write bytes $B?t$r%a%C%;!<%8BP1~(B (-fullscreen option) + * add ZW command. + + +Version 1.3.2 -> Version 1.3.3 (2000.11.26) + +final + * fix message typo in audio_oss.c (by NABETANI Masaki) + * enable audio framgemt in audio_oss.c + * cleanup key release wait + * popup menu $B$N=hM}$N;EJ}$NJQ99(B + * fix some include file dependency + * fix double link -lxpg4 for FreeBSD (by NABETANI Masaki) + * SDL + ttf $B;~$NJ8;z$N(Bfore/background$B$NH?E>$N(B fix (by Fumihiko Murata) + +pre5 + * Ctrl-C $B%-!<$G=*N;$7$?$H$-2;3Z$,=*N;$7$J$$$N$r(B fix + * music fadeout $B$G(B $B;~4V$,(B 0 $B$N;~(B fade $B$,=*$C$?$N$r8!CN$G$-$J$$$N$r(B fix + * optimaize wait for fade in / out and CE command. + * fix CE32 command. + * add CD5 command. + * $B:G=i$N(B midi start $B$,;O$^$i$J$$$3$H$,$"$k$N$r(B fix + * $B$^$l$K(B music_server/wav_server $B$N%W%m%;%9$,;D$k;v$,$"$k$N$r(B fix + * fix scaled copyarea in SDL + * add CE43 command for SDL + * disable SDL_RLEACCEL + * cleanup sdl related include file + * $BNw2AHG%2!<%`$N(B install$BMQ(B .inf $B%U%!%$%k$NDI2C(B (by hachkun-lucifer2 and + TAJIRI Yasuhiro) + +pre4 + * $B%U%'!<%I%"%&%H$G6J$r;_$a$?>l9g!"F1$86J$,1iAU$G$-$J$$$N$r=$@5(B + * some cleanup music server. + * fix CE43 command. + * some error message cleanup + * SDL cleanup (by Fumihiko Murata) + * xcore.c remove unused code + +pre3 + * add x86 cpu capability checker from GOGO-no-coda + * fix segv. in sys_getMouseInfo() (by TAJIRI Yasuhiro) + * scaled copy area 1/2 $B$r#1$D$K(B (xcore) + * fix eCopyUpdateArea() + * more mmx-ize in alpha blend + * fix segv. in mmx-ed alpha blend + * $BA*Br;h(B Window $B$NOH$N2#I}$r7h$a$k;~$N1i;;;R$NM%@h=g0L$N4V0c$$$N(B fix + (by TAJIRI Yasuhiro) + * check cdrom device is block or character device. + * fix ZZ13 (missed fontsize and fonttype) + * fix $B?tCMF~NO%&%#%s%I(B + * modify ecopy skip_mask (by Fumihiko Murata) + * SDL 1.1.5 $B$N(B RLE accel $B$KBP1~(B (by Fumihiko Murata) + * revive [ESC + SPC + RET] to exit game + * fix compile problem for non-x86 + * CG $B$N%m!<%I$K<:GT$7$?;~!"(BCG $B$NH$7$h$&$H$7$FMn$A$F$$$?$N$r(B fix + (by TAJIRI Yasuhiro) + * fix segv. when display 16bit-cg with alpha level + * modify so that ZI command affects IK0/1 command (by Fumihiko Murata) + +pre2 + * mv flood from sdl/xcore.c to ags.c + * change save/put/copy region not to use Xlib (xcore) + * small change interface between ags and graphicsdevice + * use mmx for alpha blend (nasm is required) + +pre1 + * rewrite dri.c to use mmap, and related modification + * keep extracted cg in memory using cache.c + * change interface to cg related above (rewrite vsp/pms/bmp) + * add CE24/32 command(xcore) + * add CE43(xcore/sdl) + * separate alpha plane operation + + +Version 1.3.1 -> Version 1.3.2 (2000.9.13) + +final + * fix segv. when --enable-ttf (by TAJIRI Yasuhiro) + * more debug message cleanup + * View $BNN0h$,JQ$o$C$?;~$N%^%&%9<+F00\F0$N0LCV$N=$@5(B + +pre5 + * fix wavXXX command + * fix white fader and sdl more (by Fumihiko Murata and me) + * fix antialias sting in 15/16 bpp screen + * modify MIDI play no check (by Fumihiko Murata) + * add MHH command (by Fumihiko Murata) + * add wave server for wavXXXX command (by Fumihiko Murata) + * modify ML command + * kconv.c -> eucsjis.c $B$H(B $B4XO"4X?t$r$^$H$a(B & $B4XO"=$@5(B + * debugging $B2s$j$N(B clean up (in progress) + * 15/16bpp $B$G(B antialiase$BJ8;z$,$*$+$7$+$C$?$N$r=$@5(B(xcore) + * LE/QE filename $B%5!<%A$NJQ99(B + +pre4 + * pcm device $B$,L5$$;~$N(B mixer read $B$G0[>o=*N;$9$k$N$r=$@5(B + * white fader $B$N=$@5(B (xcore) + * View$BNN0h$,JQ$o$C$?;~$N(B mouse $B$N0LCV$NJs9p$N=$@5(B + * fix ZR command + * fix CE 27-30/16 command (by Fumihiko Murata and me) + * $BA*Br(B Window $B$GA*Br;h$N0LCV$K%^%&%9$r;}$C$FMh$?;~$K!"0O$_$,2#J}8~$X(B + $B?-$S$F$7$^$&;v$N=$@5!#(B + * add some 2Fxx commands more. (by Fumihiko Murata and me) + * dri.c $B$GEPO?$7$F$$$J$$%G!<%?%U%!%$%k$K%"%/%;%9$9$k$HMn$A$k$N$r=$@5(B + * add ZC 15 command + * fix ZT10 command when base == 0 (by TAJIRI Yasuhiro and Fumihiko Murata) + * add copyarea with white level (sdl) (by Fumihiko Murata) + * $BA*Br(B Window $B$GA*Br;h$N0O$_$N0LCV$N$:$l$r=$@5(B + * fix LL command when data is shortage. + +pre3 + * fix alsa compile failfure (by TAJIRI Yasuhiro) + * check NULL in NB command (by TAJIRI Yasuhiro and me) + * $B%7!<%s@D$N2;3Z4U>^$G(B MIDI $B$,LD$i$J$$$3$H$,$"$k$N$r=$@5(B (by Fumihiko Murata) + * ttf $B$N%"%s%A%(%j%"%7%s%0MQ$N%Q%l%C%HCM$N:F=$@5(B (by Fumihiko Murata) + * $BA*Br(B Window $B$K$^$D$o$k(B callback $B%3%^%s%IBP1~(B + * add B12-14 command, fix B21-B24 command. + * LE/QE/new-LE,QE command fix (by Fumihiko Murata and me) + * add some 2Fxx commands. (by Fumihiko Murata,TAJIRI Yasuhiro and me) + * $B1F(B(alpha)$B$D$-(B copy $B$K(B $B1F$N3d9g$r$+$1$k0z?t$NDI2C$H$=$l$KH<$&JQ99(B + (by Fumihiko Murata and me) + +pre2 + * copyRegion (xcore) $B$N=$@5(B + * $BH>3Q(B->$BA43QJQ49$G(B ASCII $BJ8;z$OJQ49$NBP>]30$X(B + * new QE/LE/MT/MS/F comannd $B$NBP1~(B (by Fumihiko Murata and me) + * antialiase $BJ8;z(B(TAA/TAB$B%3%^%s%I(B) $BBP1~(B (sdl) (by Fumihiko Murata) + * window title $B$r$D$1$k$HMn$A$k%P%0$N=$@5(B + * TOx/TPx $B%3%^%s%IBP1~(B($BB?J,(B) + * ttf.c $BH>3Q$+$JBP1~(B (by TAJIRI Yasuhiro) + * $B$+$($k$K$g$Q$K$g$s$G!"L#J}%f%K%C%H$r(B2$B2s%/%j%C%/$7$?;~$N@oF.$G(B + $B%"%K%a$,@5$7$/$J$$$3$H$N=$@5(B (by Tamura Toshimichi) + * packed 24bpp $B$N=$@5(B + * ALSA $B$NH?1~8~>e(B($BLD$j;O$a$rAa$/$7$?(B) (by Fumihiko Murata) + * ALSA $B$G(B fragmentsize $B$,6-3&$r$^$?$062$l$,$"$C$?$N$r=$@5(B (by Fumihiko Murata) + * mp3 $B$G%W%l%$%d!<$N;XDj$G%U%!%$%k$r=q$/>l=j$K(B %s $B$r;XDj$G$-$k$h$&$K$7$?(B + (by Fumihiko Murata) + * sysGetOsName,HH,ZZ14 $B%3%^%s%IBP1~(B (by Fumihiko Murata) + * ttf $B$N%"%s%A%(%j%"%7%s%0MQ$N%Q%l%C%HCM$N=$@5(B (by Fumihiko Murata) + +pre1 + * packed 24bpp (3bytes/pixel) Xserver $BBP1~(B + * ttf on $B;~$K(B 256 $B%2!<%`$G?'$,2=$1$k$3$H$N=$@5(B + * $BA43Q!&H>3QI=<((B (ZH) $B$N5sF0$,$*$+$7$$$3$H$N=$@5(B + * midi/mp3 piped play $B$N=$@5(B (by Fumihiko Murata) + * CE$B%3%^%s%I$NDI2C$H=$@5(B (add dunction 33-42,48,49. modify 32) + (by Fumihiko Murata) + * $B9b@:EY%+%&%s%?$N=i4|CM$r(B 1 $B$K(B (by Fumihiko Murata) + * -devcd $B%*%W%7%g%s$GB8:_$7$J$$(B($B%*!<%W%s$G$-$J$$(B)$B%U%!%$%k$r;XDj$7$?>l9g$G$b(B + CD $B$,(B enable $B$K$J$k$N$r=$@5(B (by Fumihiko Murata) + * midi/mp3 piped play $B$N=$@5(B $B$=$N#2(B (by Fumihiko Murata) + * pipe_play $B$G%*!<%G%#%*%P%C%U%!$N0LCV$r8!=P$9$k$N$O(B ALSA $B$N$_(B,$BB>$O%+%&%s%?!<(B + $B$G7WB,(B (by Fumihiko Murata) + * LE $B%3%^%s%I$GJ8;zNs$rFI$_9~$`0LCV$,$:$l$F$$$?$3$H$N=$@5(B + (by Fumihiko Murata) + * $BF1$82;NL$G2;3Z$N%U%'!<%I$r9T$J$&$H(B0$B=|;;$G$*$A$k$3$H$N=$@5(B + (by Fumihiko Murata) + * antialiase $BJ8;z(B(TAA/TAB$B%3%^%s%I(B) $BBP1~(B (xcore) + + +Version 1.3.0 -> Version 1.3.1 (2000.8.12) + + * configure $B2=$7$^$7$?!#(B + * SDL $B$KBP1~$7$^$7$?!#(B + * $B=*N;3NG'(B Window $B$J$I$N(B popup menu $B$rA4LLE*$K=q49$($^$7$?!#(B + * OSS/ALSA/ESD $B$r5/F0;~$KA*Br$7$F;H$($k$h$&$K$J$j$^$7$?!#(B + * FreeType library $B$r;H$C$F(B TrueType font $B$rD>@\$"$D$+$($k$h$&$K$7$^$7$?!#(B + * $B$=$NB>!":Y$+$$(B fix $B$H?7$?$J%P%0$NKd$a9~$_!#(B + + +Version 1.2.5 -> Version 1.3.0 (2000.3.06) + + * $B3+H/%V%i%s%A(B 1.3.x $B$r3+;O$7$^$7$?!#(B + * $BIA2h4X?t$r(B graigics.c $B$+$i(B ags.c $B$X!#4X?tL>$NJQ99(B(ags_XXX) + * Eventdriven$B$K$7$^$7$?!#(B diff --git a/doc/ChangeLog.1 b/doc/ChangeLog.1 new file mode 100644 index 0000000..8a5f7f9 --- /dev/null +++ b/doc/ChangeLog.1 @@ -0,0 +1,342 @@ +Version 1.2.4 -> Version 1.2.5 (2000.01.09) + + * ALSA-pcmV2 $B$KBP1~$7$^$7$?!#(B(by $BB$7$^$7$?!#(B + $B%(%i!<$,$G$F5/F0$G$-$J$$>l9g$O(B 32 bpp $B$G(B X $B$r5/F0$7$F2<$5$$!#(B + * (1.2.5-1) + doc/README.color updated + $B>e$N(B 3ybtes/1pixel $B$N%A%'%C%/$GMn$A$F$$$?$N$rD>$7$^$7$?!#(B + + +Version 1.2.3 -> Version 1.2.4 (1999.11.20) + + * $B%^%^%H%H$G$N%5%&%s%I2s$j$NIT6q9g$rD>$7$^$7$?!#(B(by $BBBP1~(B + * $B%;!<%V%G!<%?$N%Q%9$N$_(B ~ $B$rI>2A$9$k$h$&$K$7$^$7$?!#>\$7$/$O(B + doc/GRFMT.TXT $B$r8fMw2<$5$$!#(B + * DARCROWS $B2>BP1~(B($B Version 1.2.3 (1999.8.3) + + * $B%^%^%H%H$G%2!<%`%*!<%P!o=*N;$9$k$N$rD>$7$^$7$?!#(B + * ALSA Ver 0.3.2 $B$N%_%-%5!<$^$o$j$,%3%s%Q%$%k=PMh$J$+$C$?$N$rD>$7$^$7$?!#(B + (thanx $BB Version 1.2.2 (1999.7.18) + + * $B%^%^%H%H$KBP1~$7$^$7$?!#(B + * $B>r7o<0$G??56$,$*$+$7$/$J$k$H$-$,$"$C$?$N$rD>$7$^$7$?!#(B + (very thanx $BED?,$5$s(B) + * BGR $B$J(B X Server $B$G(BCG$B$NL@EY;XDj$,$*$+$7$+$C$?$N$r$J$*$7$^$7$?!#(B + * for loop $B$G0lEY$b2s$i$J$$;~$N5sF0$r%*%j%8%J%k$HF1$8$K$7$^$7$?!#(B + * $B$+$($k$K$g$Q$K$g!<$s$G!"%*!<%W%K%s%0$N8e$N%[%o%$%H%U%'!<%@$,(B + $B$*$+$7$+$C$?$N$r$J$*$7$^$7$?!#(B + * ALSA$B$N%_%-%5!<2s$j$r2~NI$7$^$7$?!#(BVer 0.3.2$B$G$b(BOK$B$G$9!#(B(thanx $BB Version 1.2.1 (1999.6.5) + + * CX1$B%3%^%s%I$r;H$C$?%2!<%`$r(B24bpp$B$GF0$+$7$?;~!"$*$+$7$+$C$?$N$rD>$7$^$7$?!#(B + * 8bit$B$N%2!<%`$r(B24bpp$B$GF0$+$7$?;~!"%[%o%$%H%U%'!<%@$,$*$+$7$+$C$?$N$r(B + $B$J$*$7$^$7$?!#(B + * RGB$B$N%T%/%;%k$NJB$S$,(B BGR $B$J(B X Server (SGI/Sparc$B7O(B)$B$KBP1~$7$^$7$?!#(B + (see README.color) + * $B$Q$9$A$c$N%*!<%W%K%s%0$,%+%/%+%/$7$F$?$N$rD>$7$^$7$?!#(B + * $B$Q$9$A$c$N%9%?%C%U%m!<%k$,!"$^$@0lIt$N(BX$B$N?<$5$G$*$+$7$+$C$?$N$rD>$7$^$7$?!#(B + * XF68_FBDev$B$N(B16bpp($B Version 1.2 (1999.5.23) + + * MIDI$B$,;HMQIT2D$N>l9g$K!"L$Dj5A%3%^%s%I%(%i!<$GMn$A$k;v$,$"$C$?$N$r(B + $BD>$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * music.c $B$N6&M-%a%b%j$N$H$3$m$r>/$7JQ99$7$^$7$?!#(B + * DefaultDepth=8$B$G$b(B15/24bit$B$N(BWindow$B$,:n$l$k(BX$B%5!<%P!<$KBP1~$7$^$7$?!#(B + + +Version 1.1.8 -> Version 1.1.9 (1999.5.17) + + * 8bpp$B$N%2!<%`$r(BX$B$,(B8bit$B0J30$N2hLL%b!<%I$GF0$+$9;~!">/$79bB.2=$7$^$7$?!#(B + * $B$Q$9$F$k%A%c%$%`$N%9%?%C%U%m!<%k$,$*$+$7$+$C$?$N$rD>$7$^$7$?!#(B + * $BFC$K(B system3.5 $B$N%2!<%`$G!"$$$m$$$m$HIT6q9g$,=P$F$$$?$N$rD>$7$^$7$?!#(B + + +Version 1.1.7 -> Version 1.1.8 (1999.5.15) + + * OSS mixer $B$G:81&$N%A%c%s%M%k$N@_Dj$,$A$c$s$H$G$-$F$$$J$$$N$rD>$7$^$7$?!#(B + * Message Skip $B$r(B ON $B$K$9$k$H%-!<$,8z$-$K$/$/$J$C$F$$$?$N$rD>$7$^$7$?!#(B + * $B%G!<%?%U%!%$%k$K$J$$%G!<%?$rFI$_=P$=$&$H$9$k$HMn$A$k$N$rD>$7$^$7$?!#(B + * $B%a%C%;!<%8Fb$rF)2a$K$7$?$H$-$K!"%a%C%;!<%8NN0h$NJ]B8$,$*$+$7$+$C$?$N$r(B + $BD>$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * X $B$,(B 256$B?'%b!<%I$N;~$K!"(B6$BK|?'%b!<%I$N%2!<%`$r5/F0$G$-$J$$$h$&$K$7$^$7$?!#(B + * 1.1.7 $B$G$?$^$K(B sigterm $B$G%W%m%;%9$,Mn$A$k;v$,$"$k$N$rD>$7$^$7$?!#(B + + +Version 1.1.6 -> Version 1.1.7 (1999.5.9) + + * esd $B4X78$N(B config $B$r(B clean up $B$7$^$7$?!#(B + * music.c $B$r(B polling $B$+$i(B message queue $B$K$h$k%W%m%;%94VDL?.$r9T$J$&$h$&$K(B +$B$7$^$7$?!#(B + * cdrom.mp3.c $B$^$o$j$r(B clean up $B$7$^$7$?!#(B + * cdrom_stop() $B$r(B STOP $B$G$O$J$/(B PAUSE $B$r9T$J$&$h$&$K$7$^$7$?!#(B + * X $B$N%$%Y%s%H<~$j$r$A$g$C$H$@$1JQ$($F$_$^$7$?!#(B + + +Version 1.1.5 -> Version 1.1.6 (1999.5.5) + + * MIDI pause/unpause $B$KBP1~$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * 1.1.5 $B$N(B MG $B%3%^%s%I7O$G%(%s%P%0$7$F$$$F!"$Q$9$F$k%A%c%$%`$GI=<($,$*$+$7$/(B + $B$J$C$F$$$?$N$r$J$*$7$^$7$?!#(B + * TOTO$B$5$s$N%i%s%9(B 4.1 $B0\?"%-%C%H$,F0$/$h$&$K$J$C$?$+$J!)(B(thanx TOTO$B$5$s(B) + * $B9b@:EY%+%&%s%?$,;EMM$H0c$C$F$$$?$N$r$J$*$7$^$7$?!#(B(ZT 10,0) + * $B$Q$9$F$k%A%c%$%`$G!"%-!<%\!<%IA`:n$9$k$H0[>o=*N;$9$k%7%J%j%*$N%P%0$KBP1~(B + $B$7$^$7$?!#(B + * Linux$B0J30$N(BaudioIO*.c$B$,%3%s%Q%$%k$G$-$J$/$J$C$F$$$?$N$rD>$7$^$7$?!#(B + * X$B$,(B 15bit $B%b!<%I$N;~!"?'$,$*$+$7$+$C$?$N$r$J$*$7$^$7$?!#(B + * AmbivalenZ for Win95$BHG$G%Q%l%C%H$,$*$+$7$+$C$?$j!"%2!<%`$N?J9T$,$*$+$7(B + $B$+$C$?$N$rD>$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * $B$Q$9$F$k%A%c%$%`$G!"(B12/25$B$N%;%l%9$H$N%$%Y%s%H$G;_$^$k;v$,$"$k$N$r(B + $BD>$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * 256$B?'(BBMP$B%U%!%$%k$rFI$_9~$s$@;~%Q%l%C%H$,GK2u$5$l$k;v$,$"$k$N$r(B + $BD>$7$^$7$?!#(B(thanx $BED?,$5$s(B) + + +Version 1.0.6 -> Version 1.0.7 (1999.4.29) + + * 1.0.6 $B$G$N(B MG $B%3%^%s%I$,%(%s%P%0$7$F$$$k2DG=@-$,$"$k$N$GD>$7$^$7$?!#(B + * X $B$,(B 15bit $B%b!<%I$N;~!"?'$,$*$+$7$+$C$?$N$r$J$*$7$^$7$?!#(B + * AmbivalenZ for Win95$BHG$G%Q%l%C%H$,$*$+$7$+$C$?$j!"%2!<%`$N?J9T$,$*$+$7(B + $B$+$C$?$N$rD>$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * TOTO$B$5$s$N%i%s%9(B 4.1 $B0\?"%-%C%H$,F0$/$h$&$K$J$C$?$+$J!)(B(thanx TOTO$B$5$s(B) + + +Version 1.1.4 -> Version 1.1.5 (1999.4.18) + + * $B$W$m$9$A$e!<$G$s$H(BGOOD$B$G%*!<%W%K%s%0$,0lIt$*$+$7$$$N$r$J$*$7$^$7$?!#(B + * $B8+$?(BCG$B$H$O0c$&(BCG$B$,EPO?$5$l$F$7$^$&$N$rD>$7$^$7$?!#(B + * Enlightened Sound Daemon(esd)$B$KBP1~$7$^$7$?!#>\$7$/$O(B config.h $B$r(B + $B8fMw2<$5$$!#(B(thanx $BED?,$5$s(B) + * CD-DA $B$NBe$o$j$K(B mp3 file $B$rLD$i$9$3$H$,=PMh$k$h$&$K$J$j$^$7$?!#(B + $B>\$7$/$O(B cdrom.mp3.c $B$r8fMw2<$5$$!#(B(thanx $BB$7$^$7$?!#(B + * MG$B%3%^%s%I$r6n;H$9$k%2!<%`$G(B(NV-mini$B$J$I(B)$B!"0lIt$*$+$7$/$J$k$N$rD>$7$^$7$?!#(B + * $B0lIt$N5!G=(B(MIDI pause/unpause, $BL>A0$NJQ99(B)$B$r=|$$$F!" Version 1.0.6 (1999.4.18) + + * $B8+$?(BCG$B$H$O0c$&(BCG$B$,EPO?$5$l$F$7$^$&$N$rD>$7$^$7$?!#(B + * MG$B%3%^%s%I$r6n;H$9$k%2!<%`$G(B(NV-mini$B$J$I(B)$B!"0lIt$*$+$7$/$J$k$N$rD>$7$^$7$?!#(B + + +Version 1.0.4 -> Version 1.0.5 (1999.4.5) + + * Ver 1.0.4$B$G(Bcontrib/ doc/ $B0J2<$N%U%!%$%k$,H4$1$F$$$?$N$rD>$7$^$7$?!#(B + * $BItJ,%;!<%V(B/$BItJ,%m!<%I$G@x:_E*$J%P%0$r$J$*$7$^$7$?!#(B + + +Version 1.1.3 -> Version 1.1.4 (1999.3.28) + + * $B54C\2&%i%s%9$G!"(BPCM$B$N:81&9g@.$r$7$?8e%a%b%j$r2rJ|$7K:$l$F$$$?$N$rD>$7$^$7$?!#(B + * $B$Q$9$F$k%A%c%$%`$N%7%J%j%*$N%P%0$KBP1~$7$^$7$?!#(B(README.pastel $B;2>H(B) + * ALSA$B$G%3%s%Q%$%k$,DL$i$J$+$C$?$N$rD>$7$^$7$?!#(B + * $B$W$m$9$A$e!<$G$s$H(BGOOD$B$G@oF.$,0lIt$*$+$7$$$N$r$J$*$7$^$7$?!#(B + * mixer$B$^$o$j$r$A$g$C$HJQ$($^$7$?!#(B + * NVSYSTEM-mini$B$r;HMQ$7$?%2!<%`$G=i4|2=$NJ8;zNs$,$*$+$7$/$J$k$N$rD>$7$^$7$?!#(B + + +Version 1.0.3 -> Version 1.0.4 (1999.3.25) + + * NetBSD$B$G%3%s%Q%$%k=PMh$J$+$C$?$N$rD>$7$^$7$?!#(B + * $B54C\2&%i%s%9$G!"(BPCM$B$N:81&9g@.$r$7$?8e%a%b%j$r2rJ|$7K:$l$F$$$?$N$rD>$7$^$7$?!#(B + + +Version 1.1.2 -> Version 1.1.3 (1999.3.8) + + * $B$W$m$9$A$e!A$G$s$H(BGOOD$B$G!"%_%-%5!<$d(BCG$B%5%$%:$J$I!"$$$m$$$m$HIT6q9g$,5/$-$k(B + $B$N$r$J$*$7$^$7$?!#(B + + +Version 1.0.2 -> Version 1.0.3 (1999.2.27) + + * $BNm<0!&F.?@ET;T#2!&$Q$K$g$s$K$F!"$*$=$i$/(BND?$B$N1i;;$,$*$+$7$/$J$C$F$$$k$H;W$&(B + $B$N$rD>$7$^$7$?!#(B + * $BF.?@ET;T#2$G!"(BPCM$B$N8e$G:F$S8G$^$k$N$rD>$7$^$7$?!#(B + + +Version 1.1.1 -> Version 1.1.2 (1999.2.23) + + * $BF.?@ET;T#2$G!"(BPCM$B$N8e$G:F$S8G$^$k$N$rD>$7$^$7$?!#(B + * Mixer$BA`:n$rDI2C$7$^$7$?!#(B($BL$%F%9%H(B) + * $B%2!<%`Cf$K(BWindowManager$B$N(BClose$B%\%?%s$r2!$9$H=*N;3NG'$N%&%#%s%I$r=P$9$h$&$K(B + $B$7$^$7$?!#(B + + +Version 1.1.0 -> Version 1.1.1 (1999.2.14) + + * $BNm<0$d%"%H%i%/%J%/%"$G!"A*Br%&%#%s%I$K$F%+!<%=%k$,A*Br;h0J30$N>l=j$K$"$k;~$K(B + $B1&%/%j%C%/$GH4$1$k$HMn$A$k%P%0$r$J$*$7$^$7$?!#(B + * $BNm<0!&F.?@ET;T#2!&$Q$K$g$s$K$F!"$*$=$i$/(BND?$B$N1i;;$,$*$+$7$/$J$C$F$$$k$H;W$&(B + $B$N$rD>$7$^$7$?!#(B + * $BF0:n3NG'4D6-$K(B NetBSD(1.3I) $B$rDI2C$7$^$7$?!#(B + * X$B$N%$%Y%s%H%O%s%I%j%s%0$r(BVer1.0$B$N>uBV$K$b$I$7$^$7$?!#(B + * $B$Q$9$F$k%A%c%$%`(B $B$H(B $B$W$m$9$A$e!<$G$s$H(BGood $B$,$H$j$"$($:F0$/$h$&$K$J$j(B + $B$^$7$?!#(B(Mixer$BA`:n$O$^$@(B) + * ALSA $B$KBP1~$7$^$7$?!#(B(config.h$B$r8+$F2<$5$$(B) + * $B%2!<%`Cf$K%^%&%9$N??Cf$N%\%?%s$r2!$9;v$G!"%a%C%;!<%8%9%-%C%W$J$I$,=PMh$k(B + $B$h$&$K$J$j$^$7$?!#(B + + +Version 1.0.1 -> Version 1.0.2 (1999.2.13) + + * $BNm<0$d%"%H%i%/%J%/%"$G!"A*Br%&%#%s%I$K$F%+!<%=%k$,A*Br;h0J30$N>l=j$K$"$k;~$K(B + $B1&%/%j%C%/$GH4$1$k$HMn$A$k%P%0$r$J$*$7$^$7$?!#(B + * $BF0:n3NG'4D6-$K(B NetBSD(1.3I) $B$rDI2C$7$^$7$?!#(B + + +Version 1.0 -> Version 1.1.0 (1999.1.28) + + * $B54C\2&%i%s%9$N%*!<%W%K%s%0$G%Q%l%C%H$,$*$+$7$+$C$?$N$rD>$7$^$7$?!#(B + * ATLACH-NACHA $B$J$I$G(B PCM $B$N8e%O%s%0%"%C%W$9$k$N$rD>$7$^$7$?!#(B + * 1.0pre3$B$N(Bbmp256.c$B$X$N=$@5$,A4A35!G=$7$F$$$J$+$C$?$N$r$J$*$7$^$7$?!#(B + * X$B$N%$%Y%s%H%O%s%I%i$r2~NI(B($B!)(B)$B$7$F$_$^$7$?(B + * $B3+H/HG(B(1.1.x)$B$H0BDjHG(B(1.0.x)$B$K%V%i%s%A$rJ,$1$^$7$?!#(B + + +Version 1.0 -> Version 1.0.1 (1999.1.28) + + * $B54C\2&%i%s%9$N%*!<%W%K%s%0$G%Q%l%C%H$,$*$+$7$+$C$?$N$rD>$7$^$7$?!#(B + * ATLACH-NACHA $B$J$I$G(B PCM $B$N8e%O%s%0%"%C%W$9$k$N$rD>$7$^$7$?!#(B + * 1.0pre3$B$N(Bbmp256.c$B$X$N=$@5$,A4A35!G=$7$F$$$J$+$C$?$N$r$J$*$7$^$7$?!#(B + * $B3+H/HG(B(1.1.x)$B$H0BDjHG(B(1.0.x)$B$K%V%i%s%A$rJ,$1$^$7$?!#(B + + +Version 1.0pre3 -> Version 1.0 (1999.1.23) + + * 256$B?'$N%2!<%`$r(B16/24bpp$B$G$d$C$?$H$-!"%U%'!<%I%$%s$N:G=*%l%Y%k$,$A$g$C$H(B + $B0E$+$C$?$N$rD>$7$^$7$?!#(B + * $B%^%&%9%+!<%=%k$N%9%`!<%:0\F0$r%5%]!<%H$7$^$7$?!#(B + * $B2&F;M&$7$^$7$?!#(B + * $BF.?@ET;T$J$I!"%U%'!<%I;~$K$*$+$7$$F0:n$r$9$k$N$rD>$7$^$7$?!#(B + + +Version 1.0pre2 -> Version 1.0pre3 (1999.1.16) + + * $B%I%-%e%a%s%H$KL>A0$N4V0c$$$,$"$C$?$N$r$J$*$7$^$7$?!#(B + * Imakefile$B$N4V0c$$$G(B xmkmf -a $B$,$&$^$/F0$+$J$+$C$?$N$r$J$*$7$^$7$?!#(B + * $B30It(BMIDI$B%W%l%$%d!<$N@_Dj$r(B .xsys35 $B$G$b;XDj$G$-$k$h$&$K$J$j$^$7$?!#(B + (thanx $BB$7$^$7$?!#(B + * $B%0%i%U%#%C%/7O%3%^%s%I$NHO0O%A%'%C%/$r6/2=$7$^$7$?!#(B + * $B$+$($k$K$g$Q$K$g!A$s$G!VJa3M%m!<%W!W$,$d$C$Q$jGc$($J$+$C$?$N$rD>$7$^$7$?!#(B + * $BF.?@ET;T(BII$B$J$I$GA*BrJ8;zNs$,$A$g$C$H$:$l$k$N$rD>$7$^$7$?!#(B + + +Version 1.0pre1 -> Version 1.0pre2 (1999.1.13) + + * WindowsBMP$B$NFI$_9~$_$KBP1~$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * Rance1$B$N(BMIDI$B$H(BCG$B$N%G!<%?$r5U$K%$%s%9%H!<%k$7$F$$$?(B(rance1.inf)$B$N$rD>$7$^(B + $B$7$?!#(B + * $B30It(BMIDI$B1iAU$NJ}K!$r$h$jHFMQE*$J$b$N$K$7$^$7$?!#(B(thanx $BB$7$^$7$?!#(B + * pre1$B$G%U%'!<%@$r2~NI$7$?;~$K$$$/$D$+Kd$a9~$s$@%P%0$rD>$7$^$7$?!#(B + * -gamefile $B$r;XDj$7$J$$>l9g!"%+%l%s%H$+$i%G!<%?%U%!%$%k$rFI$_9~$`$h$&$K(B + $B$7$^$7$?!#(B(thanx $BED?,$5$s(B) + * cdrom$B$N%G%U%)%k%H$N1iAU%b!<%I$r(B TRKIND $B$+$i(B MSF $B;XDj$KLa$7$^$7$?!#(B + * Imakefile$B$KBP1~$7$^$7$?!#(B + + +BETA-19981227 -> Version 1.0pre1 (1999.1.6) + + * COPYING$B$,(BGPL$B$G$O$J$/(BLGPL$B$@$C$?$N$r$3$C$=$j:9$7BX$($^$7$?!#(B ;-) + * ATLACH-NACHA$B!"?M4Vo%7%J%j%*$NBP:v$r$7$^$7$?!#(B + * 16/24/32bpp$B$G%U%'!<%I%$%s%"%&%H$NJ}K!$rJQ$($^$7$?!#(B + * MIDI$B%U%!%$%k$,%F%s%]%i%j$K;D$C$F$$$?$N$r>C$9$h$&$K$7$^$7$?!#(B + + +BETA-19981114 -> BETA-19981227 + + * $B0[$J$k%(%s%G%#%"%s4V$G%G%#%9%W%l%$$rHt$P$7$?;~$NIT6q9g$rD>$7$^$7$?!#(B + * $B@oV`=w$H!"%"%j%9$N4[#4#5#6$KF~$C$F$$$k0\?"%2!<%`#6K\$KBP1~$7$^$7$?!#(B + * $BF.?@ET;T(BII$B$G2H6q$r9XF~$7$?;~!"0lIt$*$+$7$/$J$k$N$rD>$7$^$7$?!#(B + * $B$+$($k$K$g$Q$K$g!A$s$G!VJa3M%m!<%W!W$,Gc$($J$+$C$?$N$rD>$7$^$7$?!#(B + * $B$$$1$J$$$+$D$_@h@8$G%a%C%;!<%8%&%#%s%I$NB`Hr$,$*$+$7$+$C$?$N$rD>$7$^$7$?!#(B + + +BETA-19981024 -> BETA-19981114 + + * $B%U%)%s%H$N@_Dj$r!"(BXSystem35.ad $B$H$$$&%j%=!<%9%U%!%$%k$+$i!"(B.xsys35rc $B$X$H(B + $BJQ99$7$^$7$?!#B>$K$b$$$/$D$+$N@_Dj$r(B .xsys35rc$B$G9T$J$&$h$&$K$7$^$7$?!#(B + * Xt$B$r;H$o$J$/$J$j$^$7$?!#$h$C$F$$$/$D$+$N%W%i%C%H%U%)!<%`MQ$N(BMakefile$B$+$i(B + -lSM -lICE$B$,$J$/$J$j$^$7$?!#(B + * $B=*N;3NG'$N%&%#%s%I$,3+$/;~!"(B8bit$B$G$b?'2=$1$7$J$$$h$&$K$7$^$7$?!#(B + * CD-ROM$B$N(Bioctl$B%(%i!<$N:]$N%j%H%i%$$N4V3V$r;XDj$G$-$k$h$&$K$7$^$7$?!#(B + (see cdrom.h) + * $B54C\2&%i%s%9$dF.?@ET;T(BII$B$J$I!"(B8bit$B$G$7$+@5>o$K%W%l%$$G$-$J$+$C$?%2!<%`$b(B + 16/24bit$B$G@5>o$K=PMh$k$h$&$K$J$j$^$7$?!#(B + * $B$+$($k$K$g$Q$K$g!A$s$KBP1~$7$^$7$?!#(B + * 16bit$B$N(BFadeIn/Out$B$,$9$3$7$@$1B.$/$J$j$^$7$?!#(B + * $BF.?@ET;T(BII$B$GL>A0$NJQ99$,$G$-$k$h$&$K$J$j$^$7$?!#(B($B0lIt@)8B$"$j(B see README) + * $BF.?@ET;T(BII$B$N%m!<%I$NA*Br;h$G!":G8e$NJ}$,@Z$l$F$$$?$N$rD>$7$^$7$?!#(B + * -devcd/-devdsp$B%*%W%7%g%s$K!"L@<(E*$K$=$N%G%P%$%9$r;HMQ$7$J$$%-!<%o!<%I(B(none) + $B$r;XDj$G$-$k$h$&$K$7$^$7$?!#(B + * music.c$B$G%W%m%;%94VDL?.$,6%9g>uBV$K$J$k$N$rD>$7$^$7$?!#(B + +BETA-19981011 -> BETA-19981024 + + * xsystem35$B$N(B window$B>e$KB>$N(Bwindow$B$,=E$J$C$F$$$?;~!"(Bxsystem35$B$NJ}$K(B + $B%U%)!<%+%9$,Ev$?$C$F$$$J$/$F$b%^%&%9$N%/%j%C%/>pJs$,(Bxsystem35$B$KEO$C$F$7$^$&(B + $BIT6q9g$rD>$7$^$7$?!#(B + * cd-rom$B$H(Bdsp$B$N%G%P%$%9L>$r;XDj$G$-$k%*%W%7%g%s$r$D$1$^$7$?!#(B(-devcd, -devdsp) + * $B0lItJ8;z$,H>3Q%+%?%+%J$GI=<($5$l$k$N$r=$@5$7$^$7$?!#(B + * 24bpp$B$G%U%'!<%I%$%s$H%[%o%$%H%$%s$,$*$+$7$+$C$?$N$r=$@5$7$^$7$?!#(B + * cdrom device$B$G(B ioctl err $B$N:]!"2?2s$+(Bretry$B$9$k$h$&$K$7$^$7$?!#(B + * cdrom $B$N1iAU%b!<%I$r%G%U%)%k%H$G(B MSF$B;XDj$+$i(B TRKIND$B;XDj$K$7$^$7$?!#(B + (see cdrom.h) + * $BF.?@ET;T(BII$B$G%i%0%J!<%ILB5\(B28F$B$K9T$/$H!"$=$N$"$H@h$K$9$9$^$J$/$J$kIT6q9g$r(B + $BD>$7$^$7$?!#(B + + +BETA-19981001 -> BETA-19981011 + + * FreeBSD$B$G(B dsp.c $B$,%3%s%Q%$%k$G$-$J$$%P%0$rD>$7$^$7$?!#(B + * FreeBSD/OpenBSD $B$G(BOS$B0MB8$N%i%$%V%i%j$,%j%s%/$5$l$J$+$C$?$N$rD>$7$^$7$?!#(B + * $B$$$/$D$+$N%U%!%$%k$NB0@-$,$*$+$7$+$C$?$N$rD>$7$^$7$?!#(B + * FreeBSD$B$G(BPCM$B$,LD$i$J$$%P%0$r=$@5$7$^$7$?!#(B + * $BF.?@ET;T(BII$B$G;q3JLB5\$KF~$k;~(B <$B%3%D(B $B%3%D(B $B%3%D(B> $B$H6&$K8G$^$k%P%0$r=$@5$7$^$7$?(B + * -no-shm$B$G5/F0$7$?$j(BSharedMemory$B$,==J,$G$J$$>l9g!"(B** ERROR **: sigsegv caught + $B$GMn$A$k$N$r=$@5$7$^$7$?!#(B + * BigEndian$B7O$G$N$$$/$D$+$NIT6q9g$rD>$7$^$7$?!#(B + * SharedMemory$B$,==J,$GL5$$>l9g!"=*N;;~$K(BIPC$B%-!<$,;D$k>l9g$,$"$k$N$r=$@5$7$^$7(B + $B$?!#(B + * FreeBSD 2.2.1R$B$J$I$G(B dsp.c $B$,%3%s%Q%$%k$G$-$J$$$N$r=$@5$7$^$7$?!#(B + + +BETA-19981001 + + * $B:G=i$N&B%j%j!<%9(B + + +ALPHA-19980705 + + * $B:G=i$N&A%j%j!<%9(B diff --git a/doc/FAQ b/doc/FAQ new file mode 100644 index 0000000..0d446de --- /dev/null +++ b/doc/FAQ @@ -0,0 +1,13 @@ + +Q. FreeBSD $B$G%3%s%Q%$%k$G$-$J$$!#(Bmake $B$H$9$k$H%(%i!<$,=P$k!#(B +A. gmake (GNU make) $B$r;H$C$F$/$@$5$$!#(B + + +Q. cant load font JISX0201.1976-0 $B$H=P$F=*N;$7$F$7$^$&!#(B +A. ~/.xsys35rc $B$K<+J,$N%7%9%F%`$K%$%s%9%H!<%k$5$l$F$$$k%U%)%s%H$r;XDj$7$F(B + $B$$$^$9$+!)(B + + % xlsfonts | grep 0-0-0-0 | grep jisx0201.1976 + + $B$H$d$C$FI=<($5$l$k%U%)%s%HL>$r(B ~/.xsys35rc $B$N(B font_gothic $B$H(B font_mincho + $B$K=q$-$^$9!#:#$N=j$3$N#2$D$7$+;HMQ$7$F$$$^$;$s!#(B diff --git a/doc/GAMES.TXT b/doc/GAMES.TXT new file mode 100644 index 0000000..a92ca5b --- /dev/null +++ b/doc/GAMES.TXT @@ -0,0 +1,191 @@ + それぞれのゲームに付いての注意書き + + [鬼畜王ランス] + + [ランス4(for Win95)] + = マウスのクリック反応が悪い (fixed ?) + + [闘神都市2(for Win95)] + + [いけないかつみ先生] + = 外字データには対応していません + + [かえるにょぱにょ〜ん] + = フロアデータ(floor_1.map 〜 floor_16.map) はセーブデータと同じディレク + トリに置いてください。 + = 一部のキャラの絵と説明が違う(金魚と????) + + [戦巫女] + = 戦巫女は2枚組のCDで、Windows版では一部のデータをCD-ROMに置いたままゲーム + することになっていますが、xsystem35 では CD-Audio と CD-ROM上のデータを + 同時に使用することは出来ません。ハードディスク等に全てのデータをインス + トールするか、あるいは CD-Audio 以外の演奏方法(MP3等)を使用してください。 + CD-Audio を使う場合は2枚目の CD に音楽データが入っています。 + + [零式(アリスの館456版)] + = マップデータ(MAP_DATA.DAT, UR_DATA.DATA)はセーブデータと同じディレクトリに + 置いてください。 + + [ATLACH=NACHA(アリスの館456版)] + + [人間狩り(アリスの館456版)] + + [アリスの館456] + - DALK + + - 闘神都市 + + - DrStop! + + - ランス1 + + - ランス2 + + - ランス3 + + [王道勇者] + + [ディアボリカ] + + [AmbivalenZ(for Win95)] + + [夢幻泡影 (for Win95)] + + [ぱすてるチャイム] + = ぱすてるチャイムでは明らかにシナリオにおかしいところがあります。 + そこで、これに対するパッチを作成しました。 + + patch というディレクトリの下に pastel.diff というパッチ当てのスクリプト + がありますので、ゲームのシナリオデータのあるディレクトリにコピーして + そのディレクトリに移動した後、 ./pastel.diff (シナリオファイル名) と + 実行してください。 + (例) + > ./pastel.diff pastel_sa.ald + + 古いデータは pastel_sa.ald.org として保存されます。 + シナリオデータは Ver 1.00 と Ver 1.01 に適用できます。 + + (廉価版では直っている?) + + [ぷろすちゅーでんとGood] + + [守り神様] + + [ママトト] + + [HushByBaby] + + [Darcrows] + + [PERSIOM] + = DirectSound(3D Sound) には対応していません。 + + [隠れ月] + + [SeeIn青] + + [廉価版・デアボリカ] + + [廉価版・アトラクナクア] + + [廉価版・かえるにょ・ぱにょん] + + [廉価版・零式] + + [かえるにょ国にょありす(20世紀アリス)] + = 外部MIDIプレイヤーモードでは音楽がリピートされません。 + + [これDPS?(20世紀アリス)] + + [夜が来る!] + = 動きません + + [王子さま Lv1] + = 動きません + + [Only You 〜リ・クルス〜] + + [大悪司] + = オープニングが動かない + + [王子さま Lv1.5] + + [妻みぐい] + = オープニングが動かない + + [エスカレイヤー] + = オープニングが動かない + + [Rance5D] + + [妻みぐい2] + = オープニングが動かない + + [DALK外伝] + [ままにょにょ] + = System4につき動きません + + +/* + * その他 + */ + + * センチメンタルシーズン (Aliceの館 CDをベースに UNITBASE が移植したもの) + = http://www4.big.or.jp/~unitbase/sys35sdk/games.html + + * Intruder (Aliceの館 CDをベースに UNITBASE が移植したもの) + = まだ完了していません + + * Crecent Moon がぁる (Aliceの館 CDをベースに UNITBASE が移植したもの) + = http://www4.big.or.jp/~unitbase/sys35sdk/games.html + + * あぶない天狗伝説 (Aliceの館 CD2をベースに UNITBASE が移植したもの) + = 掲載許可が下りません + + * OnlyYou (system3版をベースに TOTOさんが移植したもの) + = http://www1.interq.or.jp/t-takeda/index.html + + * ランス4.1 (system3版をベースに TOTOさんが移植したもの) + = http://www1.interq.or.jp/t-takeda/index.html + = スプライトの色がおかしい + + * ランス4.2 (system3版をベースに TOTOさんが移植したもの + = http://www1.interq.or.jp/t-takeda/index.html + = スプライトの色がおかしい + + * アリスの館3 (system3版をベースに TOTOさんが移植したもの) + = http://www1.interq.or.jp/t-takeda/index.html + + * 乙女戦記 (system3版をベースに TOTOさんが移植したもの) + = http://www1.interq.or.jp/t-takeda/index.html + + * 闘神都市2外伝 (system3版をベースに TOTOさんが移植したもの) + = http://www1.interq.or.jp/t-takeda/index.html + + * DPS全部 (system3版をベースに TOTOさんが移植したもの) + = http://www1.interq.or.jp/t-takeda/index.html + + * ProStudentG (system3版をベースに TOTOさんが移植したもの) + = http://www1.interq.or.jp/t-takeda/index.html + + * 学園KING (AliceCD Ver 1.??) + = CDが鳴らない + -> TOTOさんが、CD-DAに対応するためのシナリオパッチをつくっています。 + http://www1.interq.or.jp/t-takeda/midi.html + + + * メイドのススメ (AliceCD Ver 1.02) + + * ぶろぶろ (AliceCD Ver 1.02) + + * 学園漂流戦記 (AliceCD Ver 1.02) + + * 扉 (AliceCD Ver 2.02) + + * 妖精 (AliceCD Ver 2.02) + +/* + * 3rd party 製作 ゲーム +*/ + +#include "MISCGAME.TXT" diff --git a/doc/GRFMT.TXT b/doc/GRFMT.TXT new file mode 100644 index 0000000..2c69273 --- /dev/null +++ b/doc/GRFMT.TXT @@ -0,0 +1,80 @@ + $B%2!<%`%j%=!<%9%U%!%$%k(B(*.gr)$B$N=q$-J}(B + + + xsystem35$B$G$O%2!<%`%G!<%?$NCV$->l=j$r%F%-%9%H%U%!%$%k$KJ]B8$7$F$*$-!"(B + $B$=$l$r(Bxsystem35$B$K;XDj$7$F$d$k;v$G%G!<%?$NCV$->l=j$rCN$i$;$^$9!#(B + +# $B$3$N%U%!%$%k$N%U%!%$%kL>$O(Bxsystem35$B$r5/F0$9$k;~$K;XDj$G$-$^$9$N$G!"(Bhoge.gr +# $B$G$"$kI,MW$OL5$/!"<+M3$K$D$1$k;v$,=PMh$^$9!#(B + + $B$3$3$G$O!"$3$N%F%-%9%H%U%!%$%k(B($B%2!<%`%j%=!<%9%U%!%$%k(B)$B$N=q<0$r@bL@$7$^$9!#(B + + + $B#1$D$N%G!<%?$K$D$-#19T$G5-=R$7$^$9!#Nc$r8+$F2<$5$$!#(B + + ScenarioA /home/chikama/game/rance4/rance4_sa.ald + + $B%-!<%o!<%I(B $B%G!<%?$N%U%k%Q%9(B + + $B$N=g$K=q$-$^$9!#%-!<%o!<%I$O9T$N@hF,$+$i=q$-!"%G!<%?$N%U%k%Q%9$H$N4V$OH>3Q(B + $B%9%Z!<%9$G$9!#(B($B%;!<%V%G!<%?$N$_!"%[!<%`%G%#%l%/%H%j$rI=$9(B ~ $B$rI>2A$7$^$9!#(B) + + $B%-!<%o!<%I$K$O%G!<%?(B + Save : $B%;!<%V%G!<%?(B + Resouce : $B%j%=!<%9%U%!%$%k(B($B%^%&%9%+!<%=%k7A>u(B) + Ain : DLL $B$H$=$N4X?t$N>pJs$N$+$+$l$?(B System39.ain + BGM : BGM$B%G!<%?(B($B%(%9%+%l%$%d!<0J9_$N(BBGM$B%G!<%?%U%!%$%k(B) + WAI : PCM$B%G!<%?$NDI2C>pJs(B (mixer channel $B>pJsEy(B) + BGI : BGM$B%G!<%?$NDI2C>pJs(B ($B%k!<%W0LCVEy(B) + SACT01 : SACT.DLL$BMQ%G!<%?(B (SACTEFAM.KLD) + ALK : $B%G%bMQ%"!<%+%$%V%U%!%$%k(B + Init : System39.ini + + $BF1$8l9g$O%-!<%o!<%I$Ne$N$I$l$,$I$N$GH=JL$7$^$9!#(B + *SA.ALD $B$J$i%7%J%j%*$N#1HVL\!"(B*GA.ALD$B$O%0%i%U%#%C%/!"(B*WA.ALD$B$O(BPCM$B!"(B + *MA.ALD $B$O(BMIDI$B!"(B*DA.ALD$B$O$=$NB>%G!<%?$G$9!#(B + + Ain $B$O(B System39.ain $B$X$N%Q%9$r=q$-$^$9!#Nc$($P(B + Ain /home/chikama/game/20cKaeru/System39.ain + $B$N$h$&$K=q$-$^$9!#(B + + Init $B$O(B System39.ini $B$X$N%Q%9$r=q$-$^$9!#Nc$($P(B + Init /home/chikama/game/esuka/System39.ini + $B$N$h$&$K=q$-$^$9!#(B + + WAI/BGI $B$ODL>o#1%U%!%$%k$@$1$G$9$N$G(B + WAIA /home/chikama/game/esuka/DOKI_WA.WAI + BGIA /home/chikama/game/esuka/DOKI_BA.BGI + $B$N$h$&$K=q$-$^$9!#(B + + SACT01 $B$O(B SACT$B%7%9%F%`8GM-$N%G!<%?%U%!%$%k(B(SACTEFAM.KLD)$B$X$N%Q%9$r(B + $B;XDj$7$^$9!#(B + SACT01 /home/chikama/game/rance5d/SACTEFAM.KLD + + ALK $B$O%G%bMQ$N%G!<%?$,F~$C$?%"!<%+%$%V%U%!%$%k$G$9!#(B + ALK01 /home/chikama/game/nd/NightDemonDemo1.alk + ALK02 /home/chikama/game/nd/NightDemonDemo2.alk + ALK03 /home/chikama/game/nd/NightDemonDemo3.alk + $B$N$h$&$K=q$-$^$9!#(B + + + $B$^$?!"$3$l$i$NHOaF$K$O$$$i$J$$%G!<%?!"$?$H$($P!"$+$($k$K$g$Q$K$g$s$N(B + floor_1.map$B$J$I$O%j%=!<%9%U%!%$%k$r2p$7$^$;$s$N$G!"%2!<%`%j%=!<%9(B + $B%U%!%$%k$K$O=q$+$:!"!V%;!<%V%G!<%?$rCV$$$?%G%#%l%/%H%j$HF1$8>l=j!W$K(B + $B%3%T!<$7$F2<$5$$!#(B + + $B$^$?!"(BSave? $B$N$_!"(B'~' ($B%[!<%`%G%#%l%/%H%j(B)$B$rI>2A$7$^$9$N$G!"(B + SaveA ~/savedata/kichiku/kichiku_sa.ald + $B$N$h$&$K=q$/;v$,=PMh$^$9!#(B + + $B%3%a%s%H$r=q$/>l9g$O9TF,$K(B # $B$r$D$1$^$9!#$^$?6uGr9T$OL5;k$5$l$^$9!#(B + diff --git a/doc/MISCGAME.TXT b/doc/MISCGAME.TXT new file mode 100644 index 0000000..aef4fbb --- /dev/null +++ b/doc/MISCGAME.TXT @@ -0,0 +1,58 @@ + + $B$=$NB>$N(B SYSTEM 3.5 $B$N%2!<%`$K$D$$$F(B + + README $B$K$"$kF0:n3NG'%2!<%`0J30$K$b!"%M%C%H>e$G8x3+$5$l$F$$$k(BSYSTEM3.5$BBP1~(B + $B$N%2!<%`$N$&$A4v$D$+$OF0$/;v$,3NG'$5$l$F$$$^$9!#$3$3$G$O(B 1.4.0 preX $B$G$NF0:n(B + $B>u67$G$9!#(B1.4.0 $B8x3+;~E@$GpJs$b$*$h$;$/$@$5$$!#(B + + OK$B$OLdBj$J$/F0$/!#(BGOOD$B$,B?>/$NLdBj$"$k$b$N$N%2!<%`$r$d$k$V$s$G5$$K$O$J$k$1$I(B + $BBQ$($i$l$kHO0O$N$b$N!#(BBAD$B$OF0$+$J$$$b$N$G$9!#(B + + +($B:nNN,(B) +$B!Z(B $B%=%U%HL>(B $B![(B $B!Z(B $B%U%!%$%kL>(B $B![!Z(B $B:n(B $B![!Z(B $BF0:n(B $B![(B +$B9qN)%U%!!<%V%k?^(B +$B=q4[;J=q!A(B +$B%V%C%/%k$A$c$s!A(B SSYO_100.LZH $BBgDM%R%m(B OK +$B%P%k!<%s$]$C$W(B BPOP_093.LZH $BBgDM%R%m(B OK + +Self self.lzh $B$h$3$d$^$J$*$-(B OK +$B$*$;$m$C$H(B othellotto.exe $B$h$3$d$^$J$*$-(B OK +$B%-%c%m%k(B carol.lzh $B$h$3$d$^$J$*$-(B GOOD(1) + +$B@QAX;ML\JB$Y(B Te1.lzh $B?>pJs(B + 6.a. SYSV IPC + 6.b. SharedMemory$B$NBg$-$5$K$D$$$F(B + 6.c. locale $B$H(B X + 7. $BCx:n8"$H%i%$%;%s%9(B + 8. $B%5%]!<%H(B + + +1. $B$O$8$a$K(B + + $B$3$N%=%U%H$O(B AliceSoft $B$N(B Syetem3.5/3.6/3.8/3.9 $B>e$GF0$/%2!<%`$r(B + X Window System $B>e$GF0$+$9$?$a$N%W%m%0%i%`$G$9!#(B + + * $BF0:n3NG'%2!<%`(B + + $B54C\2&%i%s%9(B + $B%i%s%9#4(B (for Win95) + $BF.?@ET;T(BII (for Win95) + $BL488K"1F(B (for Win95) + $B$+$($k$K$g$Q$K$g!A$s(B ($B=iHG!"Nw2AHG(B) + $B$$$1$J$$$+$D$_@h@8(B + $B@oV`=w(B ($B=iHG!"Nw2AHG(B) + $BNm<0(B ($B4[#4#5#6HG!"Nw2AHG(B) + ATLACH=NACHA ($B4[#4#5#6HG!"Nw2AHG(B) + $B?M4Ve$G8x3+$5$l$F$$$k(BSYSTEM3.5$BMQ$N%2!<%`$N$&$A!"$$$/$D$+$O(B + $BF0:n$,3NG'$5$l$F$$$^$9!#$/$o$7$/$O(B MISCGAME.TXT $B$r8fMw2<$5$$!#(B + + +2. $B3+H/4D6-$HF0:n3NG'4D6-(B + + 2.a. $B3+H/4D6-(B + + Kondara-1.2 (Linux/i386) + + 2.b. $BF0:n3NG'4D6-(B + + DigitalUnix 4.0F (alpha) + SunOS 5.8 (sparc) + + 2.c. $BB?J,F0$/$H;W$o$l$k4D6-(B + + Linux(!i386) + FreeBSD/NetBSD/OpenBSD (i386 etc) + Irix 6.X + Solaris 2.X $B0J9_(B (sparc/i386) + + +3. xystem35$B$N@_Dj%U%!%$%k(B + + xsystem35$B$G$O%U%)%s%H$N@_Dj$J$I$r(B .xsys35rc$B$H$$$&%U%!%$%k$+$iFI$_9~$_$^$9!#(B + $B%G%U%)%k%H$G$O!"%[!<%`%G%#%l%/%H%j$r$^$:C5$7!"@\I=<($9$kJ}K!$N#2l=j$K%U%)%s%H%U%!%$%k$r(B + $B;XDj$7!"(Bfont_device: ttf $B$H;XDj$7$F$/$@$5$$!#>\$7$/$O%5%s%W%k%U%!%$%k(B + (xsys35rc.sample)$B$r8+$F2<$5$$!#(B + + +4. $B%2!<%`$Ne$K(B ???????.gr $B$H$$$&%U%!%$%k(B($B%2!<%`%j%=!<%9%U%!%$%k(B) + $B$,<+F0E*$K:n@.$5$l$^$9$N$G(B + + % xsystem35 -gamefile ~/game/???????.gr + + $B$N$h$&$Kl9g$O!"%+%l%s%H%G%#%l%/(B + $B%H%j$N(B xsystem35.gr $B$r;2>H$7$^$9!#(B + + $B$^$?$$$:$l$b8+$D$+$i$J$$>l9g$O!"%+%l%s%H%G%#%l%/%H%j$K$"$k%U%!%$%k$r%2!<%`(B + $B%G!<%?$H$7$F@_Dj$7$^$9!#Nc$($P(B testSA.ALD $B$H$$$&%U%!%$%k$,%+%l%s%H%G%#%l%/(B + $B%H%j$K$"$k$H!"$=$l$r%7%J%j%*%G!<%?$H$7$F;H$$$^$9!#$^$?%;!<%V%G!<%?$OE,Ev$J(B + $BL>A0$G(B 10$B8D3NJ]$5$l$^$9!#(B + + $B%2!<%`%j%=!<%9%U%!%$%k$N=q$-J}$K$D$$$F$O!"(Bdoc/GRFMT.TXT $B$r8fMw2<$5$$!#(B + + 4.b. $B%2!<%`$N=*N;(B + + * $B5/F0$7$?Cl9g$b$"$j$^$9!#(B + + $B%^%&%9%+!<%=%k0\F0(B(MouseAutoMove): + $BA*Br%&%#%s%I$J$I$G%^%&%9$,<+F0E*$K0\F0$9$k$N$r@)8f$7$^$9!#(B + + $B%\%j%e!<%`%P%i%s%9(B(VolumeValance): + SACT$B%7%9%F%`$G2;@<$N?MJ*Kh$K2;NL$rJQ$($k$3$H$,$G$-$^$9!#(B + ($B%2!<%`$,$=$&=PMh$k$h$&$KBP1~$7$F$$$k>l9g$N$_(B) + + $B>pJs(B(About): + $B$3$N%2!<%`$K$D$$$F!#(B + + $B=*N;(B(Exit): + $B%2!<%`$r=*N;$7$^$9!#(B + + 4.d. $B%-!<%\!<%IA`:n(B + + $B%"%j%9%=%U%H$N%2!<%`$OM-;KMh!"4pK\E*$K>e2<:81&%-!<$K(B SPACE, RET, ESC, TAB + $B%-!<$7$+;H$$$^$;$s(B($B0lIt$N%2!<%`$O$=$l0J30$N%-!<$r;H$&$3$H$b$"$j$^$9(B)$B!#(B + XSystem35 $B$G$O Window$BI=<($N@ZBX$((B + + $B$^$?!"5l$-NI$-;~Be$N(B DOS $B$X$NI|5"%-!<(B (ESC + SPACE + RET) $B$G%2!<%`$r3NG'$J$7(B + $B$G=*N;=PMh$^$9!#(B + + +5. $B%3%^%s%I%i%$%s%*%W%7%g%s(B + + -h : $B%X%k%W$rI=<($7$^$9!#(B + + -gamefile file : $B%2!<%`%j%=!<%9%U%!%$%k$r(B file $B$+$iFI$_9~$_$^$9!#(B + + -no-shm : $B%M%C%H%o!<%/1[$7$K5/F0$9$k>l9g$K;XDj$7$^$9!#(B + + -devcd name : CD-ROM device$BL>$r(B name $B$K$7$^$9!#(B + -devmidi name : MIDI device$BL>$r(B name $B$K$7$^$9!#(B + -devdsp name : DSP device$BL>$r(B name $B$K$7$^$9!#(B + + -O? : PCM $B$N=PNO$N$r(Bname $B$K$7$^$9!#(B + + -devjoy name : joystick $B$N%G%P%$%9L>$r(B name $B$K$7$^$9(B + + -savekanji # : $B%2!<%`Fb$G%U%!%$%kL>$r;XDj$7$F%;!<%V%G!<%?$r5-O?$9$k$H$-!"(B + $BF|K\8l$N%U%!%$%kL>$r(B EUC $B$H(B SJIS $B$N$I$A$i$GJ]B8$9$k$+$r(B + $B;XDj$7$^$9!#(B(# $B$O(B 0 $B$^$?$O(B 1 ... 0:euc, 1:sjis) + + -version : $B%P!<%8%g%s>pJs$rI=<($7$^$9!#(B + + -fullscreen : $B%U%k%9%/%j!<%s$G%2!<%`$ro$KJ8;z$K%"%s%A%(%j%"%9$r$+$1$^$9!#(BHushaby Baby $B$h$j$bA0$N(B + $B%2!<%`$N$&$A(B 256$B?'$G$J$$$b$N$KBP$7$FM-8z$G$9!#(B + + -noantialias : $B>o$KJ8;z$K%"%s%A%(%j%"%9$r$+$1$^$;$s!#%7%J%j%*>e$G%"%s%A(B + $B%(%j%"%9$N;XDj$,$"$C$F$bL5;k$7$^$9!#(B + + -devfont : $B%U%)%s%H%G%P%$%9$r;XDj$7$^$9!#(Bx11/gtk/ttf $B$N$$$:$l$+$,(B + $B;H$($^$9!#(B + + -noimagecursor : $B%j%=!<%9%U%!%$%k$K$h$k%+!<%=%k7A>u$NJQ99(B(Darcrows$BEy(B)$B$rL58z(B + $B$K$7$?$$>l9g$K;XDj$7$^$9!#(B + + +6. $B$=$NB>>pJs(B + + 6.a. SYSV IPC + + $B%+!<%M%k$K(B SYSV IPC (SharedMemory/MessageQueue/Semaphore)$B$N5!G=$,(B + $BAH$_9~$^$l$F$$$kI,MW$,$"$j$^$9!#(B + + 6.b. SharedMemory$B$NBg$-$5$K$D$$$F(B + + $B%+!<%M%k$N(BSharedMemory$B$NBg$-$5$,==J,Bg$-$$>l9g!"(BMIT-SHM$B$rMxMQ$7$F2hLL$r(B + $B9bB.$KIA2h$9$k;v$,=PMh$^$9!#5/F0;~$K%(%i!<$,=P$k>l9g!"%+!<%M%k%Q%i%a!<%?$r(B + $BJQ99$7$F$_$F2<$5$$!#(B(BSD $B7O$O%G%U%)%k%H$N(B SharedMemory $B$NBg$-$5$,>.$5$$(B + $B$h$&$G$9(B) + + 6.b.1. FreeBSD$B$N>l9g(B /usr/src/sys/i386/conf/LINT $BCf$N(B + + options SHMALL=1025 + options "SHMMAX=(SHMMAXPGS*PAGE_SIZE+1)" + options SHMMAXPGS=1025 + options SHMMIN=2 + options SHMMNI=33 + options SHMSEG=9 + $B!V(BSHMMAXPGS$B!W$,4XO"9`L\$G$9!#(B + + 24bpp$B$G5/F0$9$k>l9g$O(B SHMMAXPGS=4096 $B$/$i$$$K$9$k$H$h$$$h$&$G$9!#(B + $B$b$A$m$s@_Dj8e$O%+!<%M%k$N:F9=C[$,I,MW$G$9!#(B + + 6.c. locale $B$H(B X + + libc $B$K(B locale $B5!9=$,AH$_9~$^$l$F$$$J$$4D6-$N>l9g!"(Blibxpg4 $B$J$I$N(B + $B%i%$%V%i%j(B(FreeBSD) $B$d(B X $B$N(B locale $B$r;H$&$3$H$K$J$j$^$9!#(B + + linux $B$N(B libc5 $B$J4D6-$G$O(B configure $B;~$K(B --with-locale=ja_JP.ujis $B$H$7$F(B + $B%3%s%Q%$%k$7$F$/$@$5$$!#(B + + $B$=$l0J30$N$[$H$s$I$N4D6-$G$O9MN8$9$kI,MW$O$J$$$G$7$g$&!#(B + + +7. $BCx:n8"$H%i%$%;%s%9(B + + $B%W%m%0%i%`$NCx:n8"$O:n\$7$/$O!"%=!<%9%3!<%I$r8fMw(B + $B2<$5$$(B) + + $B%2!<%`Fb$G;H$o$l$F$k%+!<%=%k%U%)%s%H$N0lIt$r(Bqvwm(Windows95$B$=$C$/$j$N(BWindow + Manager)$B$+$i$$$?$@$-$^$7$?!#(B + + +8. $B%5%]!<%H(B + + $BF0:nJs9p!&%P%0Js9p$J$I$O0J2<$N%a!<%k%"%I%l%9$^$G$*4j$$$7$^$9!#(B + + E-Mail: chikama@nabal.aist-nara.ac.jp (private) + masaki-c@is.aist-nara.ac.jp (official) + + $B$^$?:G?7HG$O0J2<$N(BURL$B$+$i%@%&%s%m!<%I$G$-$^$9!#(B + + http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/index.html + + $B%P%0%l%]!<%H$N:]$O!"$*;H$$$N4D6-$r=PMh$k$@$1$/$o$7$/=q$$$F2<$5$$!#(B + $B$^$?FCDj$N%2!<%`$GF0$+$J$$>l9g$O!"=PMh$k$@$1%;!<%V%G!<%?$bE:IU$7$F2<$5$$!#(B + + $B%W%m%0%i%`$d%7%J%j%*%G!<%?$N%P%0$G(B 'sigsegv caught @xxx,xxxxx' $B$H$$$C$F(B + $B=*N;$9$k>l9g$O!"$=$N%a%C%;!<%8$NItJ,(B(xxx,xxxx)$B$bAw$C$F2<$5$$!#(B + + $B2DG=$J$i$P!"(B./configure $B$G(B --enable-debug $B$rIU$1$F%3%s%Q%$%k$7$F$*$-!"(B + $B%G%P%C%,>e$G!)!)!)(B + + + $B5/F0$7$F$_$F?'$,$*$+$7$$$H;W$C$?J}$O$3$N%I%-%e%a%s%H$rFI$_?J$a$F2<$5$$!#(B + + +1. i386$B7O(B + + $B?'$,$*$+$7$$$H8@$&$3$H$O$^$:L5$$$H;W$$$^$9$,!"%S%G%*%+!<%I$NCf$K$O(B packed24 + $B$H8F$P$l$k(B 1pixel $B$K$D$-(B 3byte $B$r;H$C$F(B 1600$BK|?'%b!<%I$ro$O(B 1pixel $B$K$D$-(B 4byte + $B$r;H$C$F(B 1600$BK|?'%b!<%I$r)$7$^$9!#(B + + +2. PPC$B7O(B + + linuxPPC$B$G$O(B X server $B$H$7$F(B Xpmac $B$H(B XF68_FBDev $B$N$I$A$i$+$,;H$o$l$F(B + $B$$$^$9!#(BLinuxPPC R4 $B$"$?$j$N(B X Server $B$G$OpJs$rl9g$,$"$j$^$9!#$3$N>l9g!"(Bconfigure $B$K(B --disable-bgr $B$r$D$1$F(B + $B%3%s%Q%$%k$7$F$/$@$5$$!#(B + diff --git a/doc/README.joystick b/doc/README.joystick new file mode 100644 index 0000000..1f57659 --- /dev/null +++ b/doc/README.joystick @@ -0,0 +1,17 @@ + + Joystick $B$N;H$$J}$K$D$$$F(B + + $B8=:_(B linux $B$N(B kernel 2.2.x $B0J9_$N(B Joystick $B%$%s%?!<%U%'%$%9$KBP1~$7$F(B +$B$$$^$9!#BP1~4D6-$r$*$b$A$NJ}$O(B configure --enable-joy $B$H$7$F%3%s%Q%$%k(B +$B%3%s%Q%$%k$7$F2<$5$$!#(B + + Joystick $B$N%G%P%$%9L>$O%G%U%)%k%H$G$O(B /dev/js0 $B$G!"4D6-$G$NF0:nJs9p!"%Q%C%A$J$I$*BT$A$7$F$$$^$9!#08@h$O0J2<$NN>J}$K(B +$B$*4j$$$7$^$9!#(B + + chikama (masaki-c@is.aist-nara.ac.jp) + linux $BHG$N:nl9g(B + midi_player: timidity -A 100 -s 44100 -Oe + + 2a) xsystem35$B$X$N%j%@%$%l%/%H(B ($B%*%W%7%g%s(B) + TiMidity $B$r;H$C$F$$$k>l9g!"(BTiMidity $B$N(B PCM $B=PNO$r(B xsystem35 $B$X$H%j%@(B + $B%$%l%/%H$7$F(B xsystem35 $BB&$G4IM}$7$F$$$k(BPCM $B%G%P%$%9$KN.$9;v$,=PMh$^$9!#(B + ~/.xsys35rc $B$N(B MIDI $B%W%l!<%d!<$N@_Dj$N:]$K@hF,$K(B '-' $B$r$D$1$F2<$5$$!#(B + + ($BNc(B) + midi_player: -timidity -A 100 -s 44100 -Or -o- + + $B$3$N>l9g(B timidity $B$N=PNO$O(B 44.1kHz, Stereo, 16bit $B8GDj$G$9!#(B + + 3) $B@)8B;v9`(B + $B30It%W%l%$%d!<$r(B $B;HMQ$9$k>l9g!"(BMIDI$B%U%!%$%k$KKd$a9~$^$l$?(B system35 $BMQ$N(B + $B@)8f%3%^%s%I$rc$,=P$k$3$H$,$"$j$^$9!#(B + + + b) $B30It(B MIDI $B2;8;$r(B /dev/midi $B7PM3$G@)8f$9$kJ}K!(B + + 1) xsystem35 $BB&$N=`Hw(B + xsystem35 $B$N(B configure $Be$G(B SB-Live $B$N(B MIDI $BC<;R$K@\B3$7$?(B SC-88 $B$G$NF0:n$r(B + $B3NG'$7$F$$$^$9!#(B + + c) Synthesizer $B2;8;$r(B /dev/sequencer $B7PM3$G@)8f$9$kJ}K!(B + + 1) xsystem35 $BB&$N=`Hw(B + xsystem35 $B$N(B configure $Be$K(B soundfont $B$r(B load $B$9$k$+(B + TiMidity $B$r(B ALSA sequencer server $B$H$7$F>oCs$5$;$F$*$$$F$/$@$5$$!#(B + + TiMidity $B$r(B ALSA sequencer server $B$K$9$k$K$O!"%3%s%Q%$%k;~$K$=$N5!G=$r(B + $BM-8z$K$7$F$*$-!"(Btimidity -iA $B$G>oCs$5$;$^$9!#(B + + d) $B%*%W%7%g%s0lMw(B + + MIDI $B=PNO$K4X$9$k!"(B .xsys35rc $B$N@_Dj9`L\(B(A)$B$H%3%^%s%I%i%$%s%*%W%7%g%s(B(B) + $B$r$^$H$a$^$9!#(B + + 1) MIDI $B%W%l%$%d!<$N@_Dj(B + (A) ----> midi_player: + (B) ----> -midiplayer + + 2) MIDI $B%G%P%$%9%U%!%$%k$N@_Dj(B (default: /dev/midi or /dev/sequencer) + (A) ----> midi_device: + (B) ----> -devmidi + + 3) MIDI $B=PNOJ}K!$NA*Br(B (default: e) + (A) ----> midi_output_device: ? + (B) ----> -M? + + ? .... e : $B30It%W%l!<%d(B + r : midi device $B7PM3(B + sX: sequencer device $B7PM3(B (X$BHVL\$N%]!<%H(B) + 0 : ($B%<%m(B) $BL58z2=(B + + $B%3%s%Q%$%k;~$K(B --enable-midi=extp,raw,seq $B$H$9$k$3$H$G!"J#?t$NJ}<0$rM-8z(B + $B$K$7!"$N%3%s%Q%$%k%*%W%7%g%s$O(B + INSTALL $B%I%-%e%a%s%H$r8fMw$/$@$5$$!#(B + + sequencer device $B$N(B X $BHVL\$N%]!<%H$ODL>o!"(B0 $B$G$9$,!"J#?t$N%]!<%H$,$"$k(B + $B>l9g$O$=$N%]!<%HHV9f$r;XDj$7$F$/$@$5$$!#(BALSA $B$N(B OSS emu $B$G$O!"(B + $ cat /proc/asound/seq/oss + $B$Hl9g$O(B + -midiplayer "timidity -A 100 -s 44100 -Oe" $B$N$h$&$K$7$^$9!#(B + + +2. $B8z2L2;(B(WAV)$B$K$D$$$F(B + + xsystem35$B$G$O%*!<%G%#%*%$%s%?!<%U%'%$%9$H$7$F!"(BLinux/*BSD $B$J$I$GNI$/;H$o$l$F(B + $B$$$k(B OSS $B$*$h$S$=$N8_49%$%s%?!<%U%'%$%9$K2C$($F!"(BALSA(Advanced Linux Sound + Architecture) $B$H(B ESD(Enligtened Sound Daemon)$B$KBP1~$7$F$$$^$9!#(B + + a) OSS $B=PNO(B + + 1) $B%3%s%Q%$%k(B + configure $B;~$K(B --enable-audio=oss $B%*%W%7%g%s$rIU$1$F%3%s%Q%$%k$7$^$9!#(B + + 2) $B@\@)8f$9$kB>$K!"30It%W%l%$%d$r;H$C$F(B mp3 file $B$J$I(B + $B$rLD$i$9$3$H$b=PMh$^$9!#(B + + a) CD-ROM $B%3%s%H%m!<%k$K$h$k1iAU(B + $B4D6-$K$h$C$F<+F0E*$KE,@Z$J%I%i%$%V$,A*Br$5$l%3%s%Q%$%k$5$l$^$9!#(B + + b) $B30It%W%l%$%d(B(mp3$B$J$I(B)$B$K$h$k1iAU(B + $B$"$i$+$8$a(B CD $B$r(B MP3/WAV $B2=$7$F5/$-$^$9!#$^$?(B mpg123 $B$J$I$N%W%l%$%d(B + $B$rMQ0U$7!"%Q%9$rDL$7$F$*$-$^$9!#(B + + 1) $B%3%s%Q%$%k(B + configure $B;~$K(B --enable-cdrom=mp3 $B%*%W%7%g%s$rDI2C$7$^$9!#(BCD-ROM + $B%3%s%H%m!<%k$r$H%U%!%$%k%j%9%H$r=q$$$?e$N(B kichiku.playlist $B%U%!%$%k$N%W%l%$%d$N@_Dj$G@hF,$K(B '-' $B$r$D$1$F(B + $B$/$@$5$$!#(B + + ($BNc(B) + -mpg123 -q -s + + $B$3$N>l9g(B mpg123 $B$N=PNO$O(B 44.1kHz, Stereo, 16bit $B8GDj$G$9!#(B + + 4) $Be$G:n@.$7$?%U%!%$%k(B + $B$r;XDj$7$^$9!#(B + + + + CD-ROM $B$K4X$9$k(B .xsys35rc $B$N@_Dj9`L\(B(A) $B$H(B $B%3%^%s%I%i%$%s%*%W%7%g%s(B(B) $B$r(B + $B$^$H$a$^$9!#(B + + 1) CD $B=PNOJ}K!$NA*Br(B + (A) ----> cdrom_device: ??? + (B) ----> -devcd ???? + + MP3 $B=PNO(B => ???? $B$K%W%l%$%j%9%H$r;XDj(B + CD-ROM => ???? $B$K%G%P%$%9%U%!%$%k$r;XDj(B + + 2) CD-ROM $B%G%P%$%9%U%!%$%k$N@_Dj(B (defult /dev/cdrom) + (A) ----> cdrom_device: ??? + (B) ----> -devcd: ???? + + +4. PCM & MIDI(timidity) & CD-ROM(MP3) $B$r#1Kg$N%5%&%s%I%+!<%I$GF1;~$K;H$&J}K!(B + (special thanks to Fumihiko Murata) + + $B%5%&%s%I%+!<%I$rA*$P$J$$J}K!$H$7$F$O(B esd $B$r;H$&$3$H$G$9!#(Besd $B$OBP1~$7$?J#?t(B + $B$N%W%m%0%i%`$N2;$N=PNO$r9g@.$7$F%5%&%s%I%+!<%I$K=PNO$9$k%W%m%0%i%`$G$9!#(B + xsystem35/timidity/mp3 player $B$r(B esd $BBP1~$K%3%s%Q%$%k$9$k$3$H$G9g@.$,2DG=(B + $B$G$9!#(B + + $B$^$?!"(BTrident 4DWave DX/NX$B!"(BSoundBlaster Live/ YAMAHA YMF724$B0J9_(B $B$J$I$N%5%&(B + $B%s%I%+!<%I$O(B PCM $B%A%c%s%M%k$rJ#?t;}$C$F$$$F!"BP1~$N%5%&%s%I%I%i%$%P!<$,$"$l$P(B + PCM$B$H(BMIDI(SoftwareMIDI)$B$H(BMP3 $B$rF1;~$KLD$i$9$3$H$,=PMh$^$9!#$?$H$($P(B + SoundBlaster Live + ALSA $B$G$O(B + + $ cat /proc/asound/pcm + 00-00: emu10k1 : EMU10K1 : playback 32 : capture 1 + 00-01: emu10k1 mic : EMU10K1 MIC : capture 1 + 00-02: emu10k1 efx : EMU10K1 EFX : capture 1 + + $B$N$h$&$K(B PCM $B$r(B 32 $B%A%c%s%M%k;}$C$F$$$k$3$H$,J,$+$j$^$9!#$3$l$O(B OSS $B$G$$$&$H(B + $B$3$m$N(B /dev/dspN $B$K:GBg(B 32 $B$N(B PCM $B$,$V$i2<$,$C$F$$$k$h$&$K8+$(!"F1;~$K(B 32 $B2s(B + /dev/dspN $B$r3+$/$3$H$,=PMh$^$9!#(B + + $B$^$?(B Trident 4DWave DX/NX + ALSA $B$G$OA4It$G(B64ch$B$"$j!":GBg$G(B32ch$B$r(B PCM playback + $B$K3d$jEv$F$k;v$,$G$-$^$9!#:GBg%A%c%s%M%k$O%b%8%e!<%k%m!<%I;~$K(B $B@_Dj$5$l!"@_Dj(B + $B?t$r;H$$$-$k$^$GF1;~$K(B /dev/dspN $B$r3+$/;v$,$G$-$^$9!#(B + + $B;D$j$N(B 32ch $B$O(B MIDI $BMQ$K@_$1$i$l$F$$$F!"(BPCM $B$H(B MIDI $B$N#2$D$N%P%s%/$KJ,$1$k;v(B + $B$,$G$-$^$9!#8D!9$N%A%c%s%M%k$K$O(B PCM front volume $B$,$"$j$^$9$,!"#2$D$N%P%s%/(B + $B$r$=$l$>$lE}3g$9$k(B Wave/Music Volume $B$,$"$j(B $B$5$i$K$=$l$i$r9g$o$;$k(B PCM volume + $B$,$"$j$^$9!#(B($B:G8e$K(B Master Volume) + + $B?^$K$9$k$H$N%+!<%I$G$bB?%A%c%s%M%k=PNO$r;}$C$F$$$k$b$N$b$"$j$^$9$N$G!"(B + $B%I%i%$%P!<$N%I%-%e%a%s%H$r8fMw2<$5$$!#(B + + +(2003.1.23 $BDI5-(B) + $BDI5-$r=q$$$F$$$k;~E@$Gpacked + の変換の際に上位4bitにpalletを置いた場所の bitを立てます。bank=1 なら '| 0x10' + という具合です。シナリオ側からパレットバンクを指定することもできます。しかし、 + シナリオ側から1度もパレットバンクの指定が無い場合はこのヘッダ内の情報が使用 + されます。(これは実装依存かもしれません) + + パレット + パレットは 3バイト*16 個のデータで、B,R,G の順に16個格納されています。 + 下位4bitのみが使用されます。 + + + VSP 圧縮コード + VSP の圧縮コードは次のようになっています。圧縮方向は左から右へ、上から下へ + です。 + + 00, len; + 一つ上のプレーンと(len+1)の長さだけ同じ + + 01, len, pic; + 1バイト(pic)の繰り返し。長さは(len+1) + + 02, len, pic1, pic2; + 2バイト(pic1, pic2)の繰り返し、長さは (2*(len+1)) + + 03, len; + 青のプレーンと(len+1)の長さだけ同じ。 + + 04, len; + 赤のプレーンと(len+1)の長さだけ同じ。 + + 05, len; + 緑のプレーンと(len+1)の長さだけ同じ。 + + 06; + 上の 03, 04, 05 のパターンについて、この後に続く 03,04,05 のパターンは + 反転したものと同じとする。 + + 07, pic + picそのもの。コードと重なるデータ (00-07) に対して適用。 + + 08-255 + そのデータそのもの。 + + + 4.2 PMS フォーマット + + PMS は最初 256色データを扱うために登場しましたが、後に 64k色も扱えるように + SYSTEM 3.5 に移行した際に拡張されました。256色の場合はパックドピクセル型の + データを扱い、64k色の場合はダイレクトカラー型のデータを扱います。 + + PMS ヘッダ + PMS のヘッダは次のようになっています。 + + char sig[2]; 'PM' + int16 ver + int16 hdr_size; + int8 bpp; + int8 bppS; + int8 trans_pal; + int16 palett_bank; + int32 rsv; + int32 x0; + int32 y0; + int32 width; + int32 height; + int32 data_ptr; + int32 pallet_ptr; + int32 comment_ptr; + + sig はデータのマジックナンバーで 'PM' というデータが入っています。 + + ver はデータのバージョンで、現在は 1 が入っています。 + + bpp はデータの bit per pixel で 8または16です。256色データの場合は 8、64k色 + の場合は 16です。 + + bppsはαチャンネルの bit per pixel で通常は8です。 + + trans_pal は透過するパレットの番号です。通常はシナリオから指定が来るので + 使用しません。 + + pallet_bank は データの中のパレットのどの部分をシステムに転送するかを + 表します。通常は 256個全部転送するのですが、CGデータがそれ以下しか色を使って + ない場合には、一部のみ転送することができます。pallet_bank は 16bit の情報を + 持ち 256個を 16個づつに分割してどの部分を転送するかを指定します。bit-on で + 転送です。LSB が0-15, MSB が 240-255 です。 + + (x0, y0) は CG の表示位置です。VSP と違って8で割った大きさではなく実際の + 大きさが入ります。表示位置はシナリオ側からも変更可能です。 + + (width, height) は CG の大きさです。こちらも実際の大きさが入っています。 + + data_ptr はデータ先頭からピクセルデータへの相対アドレスが入ります。 + + pallet_ptr は bppが8の場合にはパレットへの相対アドレスが入りますが、 + 16の場合にはαチャンネルデータへの相対アドレスが入ります。 + + comment_prt はデータにコメントをつける事ができて、そのデータへの相対アドレス + を指定します。 + + パレット + パレットは RGB 各 8bit で RGB の順に 256 個入ります。 + + PMS 圧縮コード + PMS の圧縮コードは次のようになっています。圧縮方向は左から右へ、上から下へ + です。 + + 0xff, len; + 1つ上のラインと同じ。長さは (len+3:8bit, len+2:16bit) + 16bitの場合は、長さはピクセル単位(2byte)で、以下同様です。 + + 0xfe, len; + 2つ上のラインと同じ。長さは (len+3:8bit, len+2:16bit) + + 0xfd, len, pic, + 1byte の picデータの連続。長さは (len+4:8bit, len+3:16bit) + + 0xfc, len, pic1, pic2 + 2byte (pic1, pic2) データの連続。長さは ((len+3)*2:8bit, ((len+2)*2):16bit)) + + 0xfb + 左上のデータと同じ。(PMS16専用) + + 0xfa + 右上のデータと同じ。(PMS16専用) + + 0xf9, len, pic_h, pic_l1, pic_l2, .... (PMS16専用) + ピクセル間の色の差が小さいものの連続。長さは(len+1) + 各ピクセルのうち、R の上位 3bit, G の 2bit, B の 2bit が同じで、R の下位 + 2bit, G の 4bit, B の 2bit が異なるとき、下位の異なる部分のみを pic_l2, + pic_l3... で表す。( RGB は 5bit, 6bit, 5bit で表される) + pic_h, pic_l1 で最初のピクセルを構成し、ここから、RGB の上位が同じで、下位の + 異なる部分を pic_l2, pic_l3... で構成する + + 0xf8, pic + picそのもの。コードと同じピクセル用。8bit では pic は 1byte, 16bit では 2byte. + + 0xf7-0x00 + データそのもの 8bitでは 1byte, 16bit では 00-f7 の次のコードはすべて(00-ff) + 使用してピクセルを構成。 + + + 4.3 QNT フォーマット + + QNT は Only You 〜リ・クルス〜 から導入されたCGフォーマットです。24bit + カラーを扱うことができます。LZ77 圧縮 + ピクセルの並び変え・差分 という + 形をしています。LZ77 圧縮(Zlib)については RFC1950,1951 で定義されています + ので、ここでは説明しません。 + + QNT ヘッダ + + 現在のところ、リクルスで使われた Version 0、大悪司の Version 1 があります。 + + QNT ヘッダ Version 0 + + char sig[4]; 'QNT\0' + int32 0; + int32 x0; + int32 y0; + int32 width; + int32 height; + int32 bpp; + int32 rsv(?) + int32 pixel_size; + int32 alpha_size; + + QNT ヘッダ Version 1 + + char sig[4]; 'QNT\0' + int32 1; + int32 header_size; + int32 x0; + int32 y0; + int32 width; + int32 height; + int32 bpp; + int32 rsv; (?) + int32 pixel_size; + int32 alpha_size; + + QNT ヘッダ Version 2 + + char sig[4]; 'QNT\0' + int32 2; + int32 header_size; + int32 x0; + int32 y0; + int32 width; + int32 height; + int32 bpp; + int32 rsv; (?) + int32 pixel_size; + int32 alpha_size; + FILETIME lastmake; ? + FILETIME lastchange; ? + FILETIME lastaccess; ? + + sig はデータのマジックナンバーで 'QNT\0' が入っています。(\0 はヌル文字) + + header_size はヘッダの大きさをバイト数で表しています。Version 0 では 48 + バイト固定です。 + + (x0, y0) は CG の表示位置の指定です + + (width, height) は CG の大きさの指定です。 + + bpp はデータの色の大きさで通常 24(bpp) です。 + + rsv は不明で現在は 1 です。 + + pixel_size は LZ77 圧縮後のピクセルデータサイズです。 + + alpha_size は LZ77 圧縮後のアルファピクセルデータサイズです。 + + pixel_size と alpha_size は 0 の場合はそのデータは存在しません。 + + + pixel データの圧縮 + + pixel データはピクセルの並べ換えを行った後、LZ77 圧縮で圧縮されています。 + まず zlib の uncompress 等で展開します。展開したデータは次のようにピクセル + が並んでいますので並び換えます。 + B(x,y), B(x,y+1), B(x+1,y), B(x+1,y+1), G(x,y), G(x,y+1), G(x+1,y), + G(x+1,y+1), R(x,y), R(x,y+1), R(x+1,y), R(x+1,y+1) + + 次に、左(x-1,y)と上(x,y-1)の平均から 現在のピクセル(x,y)を引いたものが正しい + ピクセルデータになります。 + + PIC(x,y) = (PIC(x-1,y) + PIC(x,y-1)) / 2 - pic(x,y) + + alpha データの圧縮 + + alpha データも並び換えと LZ77 圧縮です。uncompress で展開したあと、次の + ように並び換えます。 + + ALPHA(x,y) = (ALPHA(x-1,y) + ALPHA(x,y-1)) / 2 - alpha(x,y) + + +5. シナリオデータのフォーマット + + 以下にシナリオデータのヘッダ情報を示します。 + + char sig[4]; + int32 data_ptr; + int32 size; + int32 no; + int16 fn_len; + + char fn[?]; + + sig はシナリオデータのバージョンで、SYSTEM 3.5 初期の鬼畜王ランスで'S350'、 + 最新のものでは 'S380' となっています。途中混乱した時期があってこれと異なる + 場合もあります。 + + dat_prt は実際のシナリオデータの先頭への相対アドレスです。また、シナリオ中の + ジャンプ命令のアドレスは、上のヘッダの最初からの相対アドレスを使用します。 + + size はヘッダを含めたデータのサイズを示しています。 + + no はこのデータの番号で、0番が最初のデータです。 + + fn[] はこのシナリオデータのコンパイル前のファイル名で、その長さは fn_len に + 格納されます。コンパイル前のシナリオデータでのページジャンプは &#TEST.ADV + のように書きます。このファイル名が fn に格納され、no に番号付けされます。 + + シナリオデータで扱われるデータは次のようなものです。 + * コマンド (1-3byte) + * 1バイトデータ。コマンド引数の1つ。getc。 + * 2バイトデータ。データテーブル内数値データ。WORD。getw。 + * 4バイトデータ。ジャンプ等のアドレス。DWORD。getdw。 + * 計算式(0x7fで終了)。コマンド引数。cali。 + * 文字列(':'で終了)。コマンド引数。 + * 文字列(0x00で終了) テーブルデータ内文字列データ。コマンド引数。 + + + 5.1 計算式について + 計算式はコマンドに与える数値や変数などの引数を作成するのに使われます。 + 数値や変数の値に加減乗除などの演算を加えることもできます。 + + 1byteめ 2byteめ + 00h [2バイトコード] + 00h 予約 + 01h〜33h (3.51)拡張コード + 34h〜FFh word定数(0034h〜00FFh) + 01h〜3Fh [2バイトコード] + 00h〜FFh word定数(0100h〜3FFFh) + 40h〜73h byte定数(00h〜33h) + 74h〜7Eh 基本演算子(&|^*/+-=<>\) + 7Eh : 等しくない(!=) + 7Dh : より大きい(>) + 7Ch : より小さい(<) + 7Bh : 等しい(==) + 7Ah : 減算(-) + 79h : 加算(+) + 78h : 除算(/) + 77h : 乗算(*) + 76h : 排他論理和(XOR) + 75h : 論理和(OR, |) + 74h : 論理積(AND, &) + 7Fh 終了コード + 80h〜BFh byte変数番号(00h〜3Fh) + C0h [2バイトコード] + 00h 予約 + 01h〜3Fh (3.51)拡張コード + 40h〜FFh word変数番号(0040h〜00FFh) + C1h〜FFh [2バイトコード] + 00h〜FFh word変数番号(0100h〜3FFFh) + + (3.51)拡張コード + C0h + 01h wordベース変数番号 + caliインデックス + 02h 演算子(% 剰余) + 03h 演算子(<= 以下) + 04h 演算子(>= 以上) + + 数値は0から65535までの正の整数を扱えます。しかし、計算式上では word 定数は + 3FFFh しかあつかえませんので、それ以上の値を扱う場合は演算子を使います。 + 65536 以上の数値を扱ったり、浮動小数を扱う場合は、64ビット変数を使用します。 + + 配列を除く変数の最大は論理的には、16384 個ですが、実際には 2000 以下に実装上 + の限界があります。1000 以上になる場合は、配列変数を有効に使うと良いでしょう。 + (xsystem35 の場合は 1024, 1.5.1pre1から 8192) + + 変数には、数値変数と配列変数があります。配列変数は、index 変数を用いた + アクセス方法と、var[]のようなアクセス方法があります。var[]では上の 3.51拡張 + コードを使用して C0, 01, base_h, base_l, cali: というコーディングがなされま + す。配列のベースとなる変数が (base_h << 8) + base_l で表され、インデックスは + cali で指定されます。インデックスは配列変数も使用可能です。ex. var10[var20[5]] + + 計算式は逆ポーランド記述で格納されますので、基本的な処理はスタックから2つの + 数値または変数と1つの演算子を取り出して演算し、結果をスタックに戻します。 + この操作を 0x7f が出現するまで繰り返します。0x7f が来たら、スタックに残って + いる数値を取り出します。コマンドの引数として変数を要求している場合の計算式 + は、変数へのポインタを返します。 + + 比較演算子は結果が真であれば 1 を、偽であれば、0 を返します。また演算の結果 + オーバーフロー・アンダーフローした場合は次のような値が返ります。 + * 加算・乗算で63355を越えた時 → 65535 + * 減算でマイナスになった時。 → 0 + * 0で除算したとき、 → 0 + + + 5.2 for 文のエンコード + + for文はつぎのようにエンコードされます。 + + !var:?!,3c,00,3c,01,end address(DWORD),var(cali),last(cali),direction(cali), + step(cali), (operation)... ,3e,loop address(DWORD) + + !var:?! : 使用する変数を初期化します + 3c,00 : 繰り返しのマークです。 + 3c,01 : 繰り返しのマークです。loop address(DWORD)はこのアドレスをさします。 + end address : 繰り返しブロックをぬけた後のアドレスです。 + loop address(DOWRD)の次のアドレスをさします。 + var : このループで使用するカウンタ変数です。 + last : カウンタ変数の値がこの値になるまで繰り返します。 + direction : カウンタ変数の増加方向(0:-, 1:+) + step : カウンタ変数の1回の増減分 + ここから 3e までのブロックを繰り返します。 + loop address : 繰り返しをするときの戻りアドレスです。 + + + 5.3 while 文のエンコード + + while 文はコンパイルされると、条件分岐とループとジャンプの組合せと同等に + なります。 + + コンパイル前 + <@ cali: operation> + コンパイル後 + {cali: + operation: + @loop: + } + + + 5.4 ラベルコールと返り値( ~label と ~0, cali: と ~~cali:) + + ~label で任意のシナリオファイルの指定のラベルに far call します。そのために + label はシナリオ中で一意である必要があります。 + + ~0, cali: で、far call から戻る際に値 (cali) を1つ返す事ができます。その値を + ~~cali: で変数 (cali) に受け取る事ができます。これらのコードは次のようになって + います。 + + ~label : ~, page(int16), address(int32) + ~0, cali: ~, 0, 0, cali + ~~cali : ~, 0xff, 0xff, cali + + + 5.5 G コマンドのエンコード + + G コマンドはシナリオ上では CGロードが G cali: スプライトロードが + G cali, cali: になっています。これらは次のようにエンコードされます。 + + G cali: G, 0, cali + G cali, cali: G, 1, cali, cali + + + 5.6 代入演算子 + + !var+:10! などです。 !var:var+10! よりも短いコードを生成します。 + + !var+=cali! : 0x10, var, cali + !var-=cali! : 0x11, var, cali + !var*=cali! : 0x12, var, cali + !var/=cali! : 0x13, var, cali + !var%=cali! : 0x14, var, cali + !var&=cali! : 0x15, var, cali + !var|=cali! : 0x16, var, cali + !var^=cali! : 0x17, var, cali + + + 5.7 0x2f コマンド拡張 + + エンコードした結果、0x2f で始まるコマンドです。system 3.6 以降のコマンド + 拡張はこの方法を主に使用しています。 + + 5.7.1 Txx コマンド + + TAA cali: 0x2f, 0x08, cali: + TAB var: 0x2f, 0x09, cali: + TOC: 0x2f, 0x00: + TOP: 0x2f, 0x04: + TOS: 0x2f, 0x01: + TPC cali: 0x2f, 0x02, cali: + TPP: 0x2f, 0x05: + TPS cali: 0x2f, 0x03, cali: + + + 5.7.2 inc/dec + + inc var: 0x2f,0x06,cali + dec var: 0x2f,0x07,cali + + 5.7.3 小文字コマンドとその他 2F command + + wav** など小文字系のコマンドはすべて 0x2f, 0x??, にエンコードされます。 + また引数として文字列を含むもの(ファイル名など)は、従来は ':' で終っていました + が、system 3.8 以降では '\0' で終わるようになり、これらコマンドは新規に 0x2f + コマンドとして新規に割り当てられました。 + + 0x2f, 0x0a, cali *2: [wavLoad] + 0x2f, 0x0b, cali *2: [wavPlay] + 0x2f, 0x0c, cali: [wavStop] + 0x2f, 0x0d, cali: [wavUnload] + 0x2f, 0x0e, cali *2: [wavIsPlay] + 0x2f, 0x0f, cali *4: [wavFade] + 0x2f, 0x10, cali *2: [wavIsFade] + 0x2f, 0x11, cali: [wavStopFade] + 0x2f, 0x12, str(\0): [trace] + 0x2f, 0x13, cali *4: [wav3DSetPos] + 0x2f, 0x14: [wav3DCommit] + 0x2f, 0x15, cali *4: [wav3DGetPos] + 0x2f, 0x16, cali *3: [wav3DSetPosL] + 0x2f, 0x17, cali *3: [wav3DGetPosL] + 0x2f, 0x18, cali *5: [wav3DFadePos] + 0x2f, 0x19, cali *2: [wav3DIsFadePos] + 0x2f, 0x1a, cali: [wav3DStopFadePos] + 0x2f, 0x1b, cali *4: [wav3DFadePosL] + 0x2f, 0x1c, cali: [wav3DIsFadePosL] + 0x2f, 0x1d: [wav3DStopFadePosL] + 0x2f, 0x1e, cali *2: [sndPlay] + 0x2f, 0x1f: [sndStop] + 0x2f, 0x20, cali: [sndIsPlay] + 0x2f, 0x21, str(\0): [半角OKの文字列表示 'TEST', msg 'hoge':] + 0x2f, 0x22, getc, cali: [HH] + 0x2f, 0x23, cali, cali, str(\0): [new LC] + 0x2f, 0x24, getc, str(\0), cali, cali: [new LE] + 0x2f, 0x25, cali, str(\0), str(\0): [LXG] + 0x2f, 0x26, cali, cali, str(\0): [new MI] + 0x2f, 0x27, cali, str(\0): [new MS] + 0x2f, 0x28, str(\0): [new MT] + 0x2f, 0x29, str(\0): [new NT] + 0x2f, 0x2a, getc, str(\0), cali, cali: [new QE] + 0x2f, 0x2b, getc, str(\0), str(\0): [new UP] + 0x2f, 0x2c, getc, cali, cali: [new F1-F11] + 0x2f, 0x2d, cali *2: [wavWaitTime] + 0x2f, 0x2e, cali *2: [wavGetPlayPos] + 0x2f, 0x2f, cali: [wavWaitEnd] + 0x2f, 0x30, cali *2: [wavGetWavTime] + 0x2f, 0x31, page, offset: [menuSetCbkSelect] + 0x2f, 0x32, page, offset: [menuSetCbkCancel] + 0x2f, 0x33: [menuClearCbkSelect] + 0x2f, 0x34: [menuClearCbkCancel] + 0x2f, 0x35, cali *2: [wav3DSetMode] + 0x2f, 0x36, cali *9: [grCopyStretch] + 0x2f, 0x37, cali *5: [grFilterRect] + 0x2f, 0x38: [iptClearWheelCount] + 0x2f, 0x39, cali *2: [iptGetWheelCount] + 0x2f, 0x3a, cali: [menuGetFontSize] + 0x2f, 0x3b, cali: [msgGetFontSize] + 0x2f, 0x3c, cali *3: [strGetCharType] + 0x2f, 0x3d, cali *2: [strGetLengthASCII] + 0x2f, 0x3e: [sysWinMsgLock] + 0x2f, 0x3f: [sysWinMsgUnlock] + 0x2f, 0x40, cali *4: [aryCmpCount] + 0x2f, 0x41, cali *6: [aryCmpTrans] + 0x2f, 0x42, cali *9: [grBlendColorRect] + 0x2f, 0x43, cali *4: [grDrawFillCircle] + 0x2f, 0x44, cali *3: [MHH] + 0x2f, 0x45, page, offset: [menuSetCbkInit] + 0x2f, 0x46: [menuClearCbkInit] + 0x2f, 0x47, getc: [new ']'] (**1) + 0x2f, 0x48, str(\0): [sysOpenShell] + 0x2f, 0x49, str(\0), str(\0): [sysAddWebMenu] + 0x2f, 0x4a, cali: [iptSetMoveCursorTime] + 0x2f, 0x4b, cali: [iptGetMoveCursorTime] + 0x2f, 0x4c, cali *6: [grBlt] + 0x2f, 0x4d, cali, str(\0): [LXWT] + 0x2f, 0x4e, cali *2: [LXWS] + 0x2f, 0x4f, cali *2: [LXWE] + 0x2f, 0x50, cali, getc, cali: [LXWH] + 0x2f, 0x51, cali, getc, cali: [LXWHH] + 0x2f, 0x52, cali: [sysGetOSName] + 0x2f, 0x53, cali: [patchEC] + 0x2f, 0x54, cali *4: [mathSetClipWindow] + 0x2f, 0x55, cali *6: [mathClip] + 0x2f, 0x56, cali, str(\0), str(\0): [LXF] + 0x2f, 0x57, str(\0), cali *3: [strInputDlg] + 0x2f, 0x58, cali *2: [strCheckASCII] + 0x2f, 0x59, cali *2: [strCheckSJIS] + 0x2f, 0x5a, str(\0): [strMessageBox] + 0x2f, 0x5b, cali: [strMessageBoxStr] + 0x2f, 0x5c, cali *7: [grCopyUseAMapUseA] + 0x2f, 0x5d, cali *2: [grSetCEParam] + 0x2f, 0x5e, cali *4: [grEffectMoveView] + 0x2f, 0x5f, cali: [cgSetCacheSize] + 0x2f, 0x60, cali, cali, (任意): [DLL call] (**2) + 0x2f, 0x61, cali *2: [gaijiSet] + 0x2f, 0x62: [gaijiClearAll] + 0x2f, 0x63, cali: [menuGetLatestSelect] + 0x2f, 0x64, cali *3: [lnkIsLink] + 0x2f, 0x65, cali *3: [lnkIsData] + 0x2f, 0x66, cali *2: [fncSetTable] + 0x2f, 0x67, cali *3: [fncSetTableFromStr] + 0x2f, 0x68, cali: [fncClearTable] + 0x2f, 0x69, cali: [fncCall] + 0x2f, 0x6a, cali: [fncSetReturnCode] + 0x2f, 0x6b, cali: [fncGetReturnCode] + 0x2f, 0x6c, cali: [msgSetOutputFlag] + 0x2f, 0x6d, cali *2: [saveDeleteFile] + 0x2f, 0x6e, cali: [wav3DSetUseFlag] + 0x2f, 0x6f, cali *4: [wavFadeVolume] + 0x2f, 0x70, cali: [patchEMEN] + 0x2f, 0x71, cali: [wmenuEnableMsgSkip] + 0x2f, 0x72, cali: [winGetFlipFlag] + 0x2f, 0x73, cali: [cdGetMaxTrack] + 0x2f, 0x74, str(\0), cali: [dlgErrorOkCancel] + 0x2f, 0x75, cali: [menuReduce] + 0x2f, 0x76, cali: [menuGetNumof] + 0x2f, 0x77, cali *2: [menuGetText] + 0x2f, 0x78, cali *2: [menuGoto] + 0x2f, 0x79, cali *2: [menuReturn] + 0x2f, 0x7a: [menuFreeShelterDIB] + 0x2f, 0x7b: [msgFreeShelterDIB] + 0x2f, 0x7c, dword: + 0x2f, 0x7d, getdw, getc, cali: + 0x2f, 0x7e, getdw, getc, cali: + 0x2f, 0x7f, getdw, cali: + 0x2f, 0x80, getw, getdw: [dataSetPointer] + 0x2f, 0x81, cali *2: [dataGetWORD] + 0x2f, 0x82, cali *2: [dataGetString] + 0x2f, 0x83, cali: [dataSkipWORD] + 0x2f, 0x84, cali: [dataSkipString] + 0x2f, 0x85, cali: [varGetNumof] + 0x2f, 0x86, cali: [patchG0] + 0x2f, 0x87, cali *4 [regReadString] + 0x2f, 0x88, cali *2: [fileCheckExist] + 0x2f, 0x89, cali *5: [timeCheckCurData] + 0x2f, 0x8a, const*2: [dlgManualProtect] + 0x2f, 0x8b, const, cali, cali, const, cali: [fileCheckDVD] + 0x2f, 0x8c: [sysReset] + + + (**1) System 3.8 では以降では選択肢ウィンドを開く場合は 0x2f, 0x47, 0x5d + となりました。これは menuSetCbkInit等の menu* 系コマンドを使うに当たって + 変更されたものと思われます。 + + (**2) SYSTEM 3.9 の拡張で DLL 呼び出しが可能になりました。そのインター + フェイスが 0x2f, 0x60 です。最初の cali で DLL の種類、次の cali で DLL + 内の関数の番号を指定します。それ以降は DLL によって引数の数が異なります。 + + + 5.8 未解説コマンド + + ここでは、コマンド表に載っていないけど、ゲームに出て来るものを紹介します。 + + 5.8.1 VA + * 機能: ユニットアニメーション (かえるにょ・ぱにょん初出) + * フォーマット: VA getd, cali, cali, cali: + + * VA0 : 制御用コマンド + + VA0, no, 0, 0: + no番のアニメーション停止。停止後ユニットを消す。 + + VA0, no, 0, 1: + no番のアニメーション停止。停止後ユニットを描画。 + + VA0, no, 1, num: + no番のアニメーション開始。すぐに制御を戻す。 + numはコマ数, 0の場合と開始位置と終了位置が同じな時はアニメーションは + 動かずにコマ数だけが無限にされるカウント。 + + VA0, no, 2, num: + no番のアニメーション開始。終るまで制御を戻さない。 + numはコマ数で、0は指定できない。またキーが押されても制御を戻さない。 + + VA0, no, 3, num: + no番のアニメーション開始。終るまで制御を戻さない。 + numはコマ数で、0は指定できない。またキーが押されたら制御を戻す。 + 押されたキーをRNDに返す。 + + * VA1, no, x0, y0: + no番のアニメーションの表示座標(x0,y0)の指定。 + + * VA2, no, x0, y0: + no番のアニメーションの移動先(最終座標(x,y0))の指定。この位置まで来たら + 自動的にアニメーション停止。 + + * VA3, no, width, height: + no番にアニメーションユニットの大きさ(width,height)の指定。 + + * VA4, no, num, interval: + no番アニメーションのパターン数(num)、描画間隔(interval, 1/100sec)の指定 + + * VA5, no, x0, y0: + no番のアニメーションのユニットの初期取得座標(x0,y0)の指定 + + * VA6, no, x0, y0: + no番のアニメーションの背景退避座標(x0,y0)の指定 + + * VA7, no, type, col: + no番のアニメーションのスプライト方法、色等の指定。 + type = 0: 通常コピー + 1: 色指定(col)スプライト + 2: 影データスプライト(?) + + * VA10, no, var1, var2: + no番のアニメーションの状態取得。停止中ならva1=0、動作中ならva1=1。 + var2に経過したカット数を保存。 + + * VA11, no, varX, varY: + no番アニメーションの現在位置を(varX,varY)に取得。 + + 5.8.2 ZK + * 機能: CD-ROMの入れ換えを促すメッセージ (戦巫女専用?) + * フォーマット: ZK, p1, p2, str: + + メッセージ(str)を表示してCD-ROMの入れ換えを待つ。 + + +6. SYSTEM 3.6 extension + + SYSTEM 3.6 での主な拡張はコマンドの追加です。また、DARCROWS から 0x2f + コマンド (TAA など) の導入が始まりました。MIDIスクリプトの導入もこのへん + からです。 + + +7. SYSTEM 3.8 extension + + SYSTEM 3.8 では小文字コマンド、すなわち 0x2f コマンドが大量に追加されま + した。また、計算式にも新しい演算子が追加されました。 + + +8. SYSTEM 3.9 extension + + SYSTEM 3.9 ではコマンドの拡張を DLL という形で行うようになりました。 + ドキュメントも少ないのでまだ全貌は明らかではありませんが、すこしずつ情報を追加 + していきます。 + + 8.1 System39.ain フォーマット + + System 3.9 で使用される DLL の関数名や、fncXXXX コマンドで使用されるラベルを + 保存しているファイルです。最初の 4バイト以外は上位 2bit と下位 6bit の入れ換え + を行っています。 + + char ID[4]; /* AINI */ + int32 IDlen; /* 4 */ + char IDdll[4]; /* HEL0 */ + int32 rsv1; /* 0 */ + int32 DLLnum; /* DLL の数 */ + char *DLLname; /* DLLファイル名, \0 で終る文字列 */ + int32 funcnum; /* DLL内の関数の数 */ + char *funcname; /* 関数名, \0 で終る文字列 */ + int32 argc; /* 引数の数 */ + int32 *argv; /* 引数の種類 0: 変数 (cali value) + 1: 計算式 (cali variable) pword + 2: ISurface + 3: 文字列 (文字列番号) IString + 4: IWinMsg + 5: ITimer + 6: IUI + 7: ISys3xDIB + 9: ISys3xCG + 10: ISys3xStringTable + 13: ISys3xSystem + 14: ISys3xMusic + 15: ISys3xMsgString + 16: ISys3xInputDevice + 17: ISys3x + */ + + char IDfunc[4]; /* FUNC, シナリオ上のジャンプラベル */ + int32 rsv2; /* 0 */ + int32 FUNCnum; /* FUNC の数 */ + char *FUNCname; /* FUNC名, \0 で終る文字列 */ + int16 fncPage; /* 関数のシナリオ上の位置 (1~) */ + int32 fncIndex; + + char IDvari[4]; /* VARI, シナリオ上の変数名 */ + int32 rsv3; /* 0 */ + int32 VARInum; /* 変数名の数 */ + char *VARIname; /* 変数名, \0 で終る文字列 */ + + char IDmsgi[4]; /* MSGI, シナリオメッセージ(2f7c〜2f7fコマンドで使用) */ + int32 rsv4; /* 0 */ + int32 MSGInum; /* メッセージの数 */ + char *MSGIname; /* メッセージ, \0 で終る文字列 */ + + + 8.2 ゲームメッセージの System39.ain への格納 + + ゲーム中のメッセージの一部が番号づけされて System39.ain に格納され、シナリオ + 上では番号で管理されるようになりました。基本的にシナリオテキストデータ1行に + 1つのインデックスが割り当てられます。シナリオデータでは 0x2f,0x7c,getdw で + エンコードされ getdw がインデックス番号となります。また、H,HH,Xコマンド + + メッセージも同様にエンコードされます。 + + 'てすとてすと' -> 0x2f, 0x7c, gwtdw: + H?, cali: 'てすと' -> 0x2f, 0x7d, getdw, getc, cali: + HH?, cali: 'てすと' -> 0x2f, 0x7e, getdw, getc, cali: + X?: 'てすと' -> 0x2f, 0x7f, getdw, cali: + + + 8.3 汎用 DLL と専用 DLL + + +[EOF] diff --git a/doc/THANKS b/doc/THANKS new file mode 100644 index 0000000..917af1d --- /dev/null +++ b/doc/THANKS @@ -0,0 +1,44 @@ + +Special Thanks To ... + + + +$BF`NILZ$5$s$K$O%2!<%`$N%$%s%9%H!<%kMQ$N%9%/%j%W%H$r:n@.$7$FD:$-$^$7$?!#(B +$B$^$?!"(BDebian$B$N%Q%C%1!<%82=$r$7$F$$$?$@$-$^$7$?!#(B + + +$BFiC+$5$s$K$O(BFreeBSD$B$X$N%]!<%F%#%s%0$K$D$$$F>pJs$d%F%9%H$r$7$FD:$-$^$7$?!#(B + + +$B$4$&$5$s$K$O%W%m%0%i%`$N;v$d(BOpenBSD$B$K$D$$$F$$$m$$$m$H%"%I%P%$%9$rD:$-$^$7$?!#(B + + +$B8eF#$5$s$K$O(BLinuxPPC/MkLinux$B$K4X$9$k>pJs$r$$$?$@$-$^$7$?!#(B + + +$BED?,$5$s$K$O%Z%$%s%H%k!<%A%s$re$N(BSYSTEM3.5$BBP1~%2!<%`$NF0:n>u67$r$^$H$a$F$$$?$@$-$^$7$?!#(B +$B%^%&%9%+!<%=%k7A>uJQ99$KBP1~$7$FD:$-$^$7$?!#(B + + +$BB + +$BJ?2,$5$s$K$O(BFreeBSD$B$N(Bport$B$r:n@.$7$FD:$-$^$7$?!#(B + +$B8=:_$N(Bports$B$N4IM}$OF#Eg$5$s$,9T$J$C$F$$$^$9!#(B + + +$B9bLZ$5$s$K$O(Brpm$B$N%Q%C%1!<%82=$r$7$FD:$-$^$7$?!#(B + + + +$B$=$NB>!"%F%9%H%W%l%$$r$7$FD:$$$?3'$5$s$K46 diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..98ce235 --- /dev/null +++ b/doc/TODO @@ -0,0 +1,57 @@ +TODO (順番は特に無し) + + * メンテナンス + +-- obsolete + + * TODOを増やさない + * SYSTEM3の3.5への移植ものや、ネット上にあるSYSTEM3.5のデータへの対応 + * system 3.9への対応 + * Xのイベントハンドリングの改良 + * oringinal の savedata(v1/v2/v3?) を convert する tool + * savedata を lt/bg でどっちでも読めるようにする + * XIM 対応? + * 関数/変数名の統一 + * 技術情報のドキュメント化 + * GUI付 installer (っていうか、CD-ROMの中の setup.infを直接使う) + * 異常終了時に出来るだけプロセスが残らないようにする + * global変数を減らす + * 意図的な異常シナリオデータでもsegv.らないよう努力する + * Tab/Spaceの混在などソースの見直し(随時) + * CEの残りのコマンドをさっさと実装する + * SDL を理解して cleanup + * キー入力まわりの cleanup + * UNIX+X 以外の環境へ移植しやすくする + + + * 王子様1/16 + + スケジュールを組む時に「もどる」「クリア」「OK!」の選択がうまくで + きない。 + * ランス4 + + プチハニーの爆風に巻き込まれると、キャラの上に「防」マークがつきっぱ + なしになる。 + + 戦闘シーンでたまに左上にモンスターのかけらが表示されることがある。 + + +DONE + + * configure 化 + * gtk_setup.c rewrite + * keyboard操作対応 + * cd/mp3の切替えをオプションで切替えられるようにする + * packed 24bpp対応 (rewrite xcore.c) + * music server cleanup + * dri mmap化 + * 汎用 data cache 処理を作る。TTF フォントと展開済み CG で使おうか。 + * alphabelnd asm化 + * imgae.c をもうちょっとすっきりと。(depthで関数のテーブル化 + * ecopy のタイミングの最適化 + * wav が鳴らない事がしばしばある(open err)のを調査&修正 + * *.h の依存関係 cleanup, 特に xsystem35.h + * xcore/imageの統合とcleanup + * MIDIの自前のハンドリング(/dev/sequener ?) + * FullScreen対応(with DGA) + * 古いドキュメントをなんとかする。(FAQ/BUGS etc) + * 大悪司 + + SDLの時、MAP選択が正常に動かない。 + diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..4d4a951 --- /dev/null +++ b/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/libltdl/COPYING.LIB b/libltdl/COPYING.LIB new file mode 100644 index 0000000..ba2be48 --- /dev/null +++ b/libltdl/COPYING.LIB @@ -0,0 +1,515 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. +^L + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. +^L + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. +^L + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. +^L + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. +^L + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. +^L + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. +^L + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS +^L + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper +mail. + +You should also get your employer (if you work as a programmer) or +your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James +Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am new file mode 100644 index 0000000..969ed3d --- /dev/null +++ b/libltdl/Makefile.am @@ -0,0 +1,32 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies foreign + +if INSTALL_LTDL +include_HEADERS = ltdl.h +lib_LTLIBRARIES = libltdl.la +else +noinst_HEADERS = ltdl.h +endif + +if CONVENIENCE_LTDL +noinst_LTLIBRARIES = libltdlc.la +endif + +## Make sure these will be cleaned even when they're not built by +## default. +CLEANFILES = libltdl.la libltdlc.la + +libltdl_la_SOURCES = ltdl.c +libltdl_la_LDFLAGS = -no-undefined -version-info 4:4:1 +libltdl_la_LIBADD = $(LIBADD_DL) + +libltdlc_la_SOURCES = ltdl.c +libltdlc_la_LIBADD = $(LIBADD_DL) + +## Because we do not have automatic dependency tracking: +ltdl.lo: ltdl.h config.h + +$(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS): libtool +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck diff --git a/libltdl/Makefile.in b/libltdl/Makefile.in new file mode 100644 index 0000000..e3c7e1f --- /dev/null +++ b/libltdl/Makefile.in @@ -0,0 +1,645 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \ + $(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config-h.in \ + $(top_srcdir)/configure COPYING.LIB config.guess config.sub \ + install-sh ltmain.sh missing +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libltdl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libltdl_la_OBJECTS = ltdl.lo +libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS) +@INSTALL_LTDL_TRUE@am_libltdl_la_rpath = -rpath $(libdir) +libltdlc_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libltdlc_la_OBJECTS = ltdl.lo +libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS) +@CONVENIENCE_LTDL_TRUE@am_libltdlc_la_rpath = +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libltdl_la_SOURCES) $(libltdlc_la_SOURCES) +DIST_SOURCES = $(libltdl_la_SOURCES) $(libltdlc_la_SOURCES) +am__include_HEADERS_DIST = ltdl.h +includeHEADERS_INSTALL = $(INSTALL_HEADER) +am__noinst_HEADERS_DIST = ltdl.h +HEADERS = $(include_HEADERS) $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +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@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +AUTOMAKE_OPTIONS = no-dependencies foreign +@INSTALL_LTDL_TRUE@include_HEADERS = ltdl.h +@INSTALL_LTDL_TRUE@lib_LTLIBRARIES = libltdl.la +@INSTALL_LTDL_FALSE@noinst_HEADERS = ltdl.h +@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = libltdlc.la +CLEANFILES = libltdl.la libltdlc.la +libltdl_la_SOURCES = ltdl.c +libltdl_la_LDFLAGS = -no-undefined -version-info 4:4:1 +libltdl_la_LIBADD = $(LIBADD_DL) +libltdlc_la_SOURCES = ltdl.c +libltdlc_la_LIBADD = $(LIBADD_DL) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +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 config.h +$(srcdir)/config-h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + 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) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + 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 + +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 +libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) + $(LINK) $(am_libltdl_la_rpath) $(libltdl_la_LDFLAGS) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS) +libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) + $(LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_LDFLAGS) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" + @list='$(include_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ + $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ + rm -f "$(DESTDIR)$(includedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + @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"; \ + $(mkdir_p) "$(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 + -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 + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | 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 + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + 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 | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && 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 ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${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-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-includeHEADERS uninstall-info-am \ + uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES ctags dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES 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-includeHEADERS uninstall-info-am \ + uninstall-libLTLIBRARIES + + +ltdl.lo: ltdl.h config.h + +$(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS): libtool +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status --recheck +# 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/libltdl/NO-AUTO-GEN b/libltdl/NO-AUTO-GEN new file mode 100644 index 0000000..e69de29 diff --git a/libltdl/README b/libltdl/README new file mode 100644 index 0000000..da0a449 --- /dev/null +++ b/libltdl/README @@ -0,0 +1,10 @@ +This is GNU libltdl, a system independent dlopen wrapper for GNU libtool. + +It supports the following dlopen interfaces: +* dlopen (Solaris, Linux and various BSD flavors) +* shl_load (HP-UX) +* LoadLibrary (Win16 and Win32) +* load_add_on (BeOS) +* GNU DLD (emulates dynamic linking for static libraries) +* dyld (darwin/Mac OS X) +* libtool's dlpreopen diff --git a/libltdl/acinclude.m4 b/libltdl/acinclude.m4 new file mode 100644 index 0000000..8831cbd --- /dev/null +++ b/libltdl/acinclude.m4 @@ -0,0 +1,6835 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This file is free software; the Free Software Foundation gives +## unlimited permission to copy and/or distribute it, with or without +## modifications, as long as this notice is preserved. + +# serial 48 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])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_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)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 +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +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 + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_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 MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +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 "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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 "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# 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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# 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_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--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 + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _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], +[_LT_AC_SHELL_INIT([ +# 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 </dev/null 2>&1 && unset CDPATH + +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. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + 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="$lt_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) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([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) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _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], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-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" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = 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 +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# 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], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# 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_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# 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], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# 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_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# 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], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# 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_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# 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_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [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]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&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="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_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* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_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 + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL 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, lt_dlinit, + [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 + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + 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]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + 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 + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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 + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | 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, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# 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=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# 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=$lt_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_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# 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_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# 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_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +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_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# 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_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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=$_LT_AC_TAGVAR(hardcode_action, $1) + +# 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_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# 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=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# 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="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# 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_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +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" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# 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 from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (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 + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -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 +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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 + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_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= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&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 + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II 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't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&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 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|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. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + 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. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$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. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #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 +# 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 */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# 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]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) +## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- +## Copyright (C) 1999-2000 Free Software Foundation, Inc. +## +## This file is free software; the Free Software Foundation gives +## unlimited permission to copy and/or distribute it, with or without +## modifications, as long as this notice is preserved. + +# serial 7 AC_LIB_LTDL + +# AC_WITH_LTDL +# ------------ +# Clients of libltdl can use this macro to allow the installer to +# choose between a shipped copy of the ltdl sources or a preinstalled +# version of the library. +AC_DEFUN([AC_WITH_LTDL], +[AC_REQUIRE([AC_LIB_LTDL]) +AC_SUBST([LIBLTDL]) +AC_SUBST([INCLTDL]) + +# Unless the user asks us to check, assume no installed ltdl exists. +use_installed_libltdl=no + +AC_ARG_WITH([included_ltdl], + [ --with-included-ltdl use the GNU ltdl sources included here]) + +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_LIB([ltdl], [lt_dlcaller_register], + [with_included_ltdl=no], + [with_included_ltdl=yes]) + ]) +fi + +if test "x$enable_ltdl_install" != xyes; then + # If the user did not specify an installable libltdl, then default + # to a convenience lib. + AC_LIBLTDL_CONVENIENCE +fi + +if test "x$with_included_ltdl" = xno; then + # If the included ltdl is not to be used. then Use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], [1], + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl +fi + +# Report our decision... +AC_MSG_CHECKING([whether to use included libltdl]) +AC_MSG_RESULT([$with_included_ltdl]) + +AC_CONFIG_SUBDIRS([libltdl]) +])# AC_WITH_LTDL + + +# AC_LIB_LTDL +# ----------- +# Perform all the checks necessary for compilation of the ltdl objects +# -- including compiler checks and header checks. +AC_DEFUN([AC_LIB_LTDL], +[AC_PREREQ(2.50) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_C_CONST]) +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_HEADER_DIRENT]) +AC_REQUIRE([_LT_AC_CHECK_DLFCN]) +AC_REQUIRE([AC_LTDL_ENABLE_INSTALL]) +AC_REQUIRE([AC_LTDL_SHLIBEXT]) +AC_REQUIRE([AC_LTDL_SHLIBPATH]) +AC_REQUIRE([AC_LTDL_SYSSEARCHPATH]) +AC_REQUIRE([AC_LTDL_OBJDIR]) +AC_REQUIRE([AC_LTDL_DLPREOPEN]) +AC_REQUIRE([AC_LTDL_DLLIB]) +AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) +AC_REQUIRE([AC_LTDL_DLSYM_USCORE]) +AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS]) +AC_REQUIRE([AC_LTDL_FUNC_ARGZ]) + +AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ + stdio.h unistd.h]) +AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h]) +AC_CHECK_HEADERS([string.h strings.h], [break]) + +AC_CHECK_FUNCS([strchr index], [break]) +AC_CHECK_FUNCS([strrchr rindex], [break]) +AC_CHECK_FUNCS([memcpy bcopy], [break]) +AC_CHECK_FUNCS([memmove strcmp]) +AC_CHECK_FUNCS([closedir opendir readdir]) +])# AC_LIB_LTDL + + +# AC_LTDL_ENABLE_INSTALL +# ---------------------- +AC_DEFUN([AC_LTDL_ENABLE_INSTALL], +[AC_ARG_ENABLE([ltdl-install], + [AC_HELP_STRING([--enable-ltdl-install], [install libltdl])]) + +AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) +AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno) +])# AC_LTDL_ENABLE_INSTALL + + +# AC_LTDL_SYS_DLOPEN_DEPLIBS +# -------------------------- +AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_CACHE_CHECK([whether deplibs are loaded by dlopen], + [libltdl_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + libltdl_cv_sys_dlopen_deplibs=unknown + case "$host_os" in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + aix[[45]]*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + libltdl_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + interix*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + irix[[12345]]*|irix6.[[01]]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + osf[[1234]]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explictly say `no'. + libltdl_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) +if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) +fi +])# AC_LTDL_SYS_DLOPEN_DEPLIBS + + +# AC_LTDL_SHLIBEXT +# ---------------- +AC_DEFUN([AC_LTDL_SHLIBEXT], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +AC_CACHE_CHECK([which extension is used for loadable modules], + [libltdl_cv_shlibext], +[ +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + ]) +if test -n "$libltdl_cv_shlibext"; then + AC_DEFINE_UNQUOTED([LTDL_SHLIB_EXT], ["$libltdl_cv_shlibext"], + [Define to the extension used for shared libraries, say, ".so".]) +fi +])# AC_LTDL_SHLIBEXT + + +# AC_LTDL_SHLIBPATH +# ----------------- +AC_DEFUN([AC_LTDL_SHLIBPATH], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +AC_CACHE_CHECK([which variable specifies run-time library path], + [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"]) +if test -n "$libltdl_cv_shlibpath_var"; then + AC_DEFINE_UNQUOTED([LTDL_SHLIBPATH_VAR], ["$libltdl_cv_shlibpath_var"], + [Define to the name of the environment variable that determines the dynamic library search path.]) +fi +])# AC_LTDL_SHLIBPATH + + +# AC_LTDL_SYSSEARCHPATH +# --------------------- +AC_DEFUN([AC_LTDL_SYSSEARCHPATH], +[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) +AC_CACHE_CHECK([for the default library search path], + [libltdl_cv_sys_search_path], + [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) +if test -n "$libltdl_cv_sys_search_path"; then + sys_search_path= + for dir in $libltdl_cv_sys_search_path; do + if test -z "$sys_search_path"; then + sys_search_path="$dir" + else + sys_search_path="$sys_search_path$PATH_SEPARATOR$dir" + fi + done + AC_DEFINE_UNQUOTED([LTDL_SYSSEARCHPATH], ["$sys_search_path"], + [Define to the system default library search path.]) +fi +])# AC_LTDL_SYSSEARCHPATH + + +# AC_LTDL_OBJDIR +# -------------- +AC_DEFUN([AC_LTDL_OBJDIR], +[AC_CACHE_CHECK([for objdir], + [libltdl_cv_objdir], + [libltdl_cv_objdir="$objdir" + if test -n "$objdir"; then + : + else + rm -f .libs 2>/dev/null + mkdir .libs 2>/dev/null + if test -d .libs; then + libltdl_cv_objdir=.libs + else + # MS-DOS does not allow filenames that begin with a dot. + libltdl_cv_objdir=_libs + fi + rmdir .libs 2>/dev/null + fi + ]) +AC_DEFINE_UNQUOTED([LTDL_OBJDIR], ["$libltdl_cv_objdir/"], + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# AC_LTDL_OBJDIR + + +# AC_LTDL_DLPREOPEN +# ----------------- +AC_DEFUN([AC_LTDL_DLPREOPEN], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], + [libltdl_cv_preloaded_symbols], + [if test -n "$lt_cv_sys_global_symbol_pipe"; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi + ]) +if test x"$libltdl_cv_preloaded_symbols" = xyes; then + AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], + [Define if libtool can extract symbol lists from object files.]) +fi +])# AC_LTDL_DLPREOPEN + + +# AC_LTDL_DLLIB +# ------------- +AC_DEFUN([AC_LTDL_DLLIB], +[LIBADD_DL= +AC_SUBST(LIBADD_DL) +AC_LANG_PUSH([C]) + +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.])], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LIBADD_DL="$LIBADD_DL -ldld"], + [AC_CHECK_LIB([dl], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"], + [AC_TRY_LINK([#if HAVE_DLFCN_H +# include +#endif + ], + [dlopen(0, 0);], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"], + [AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LIBADD_DL="$LIBADD_DL -ldld"], + [AC_CHECK_FUNC([_dyld_func_lookup], + [AC_DEFINE([HAVE_DYLD], [1], + [Define if you have the _dyld_func_lookup function.])]) + ]) + ]) + ]) + ]) + ]) +]) + +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + AC_CHECK_FUNCS([dlerror]) + LIBS="$lt_save_LIBS" +fi +AC_LANG_POP +])# AC_LTDL_DLLIB + + +# AC_LTDL_SYMBOL_USCORE +# --------------------- +# does the compiler prefix global symbols with an underscore? +AC_DEFUN([AC_LTDL_SYMBOL_USCORE], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [ac_cv_sys_symbol_underscore], + [ac_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + ac_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC + fi + else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.c >&AC_FD_CC + fi + rm -rf conftest* + ]) +])# AC_LTDL_SYMBOL_USCORE + + +# AC_LTDL_DLSYM_USCORE +# -------------------- +AC_DEFUN([AC_LTDL_DLSYM_USCORE], +[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) +if test x"$ac_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + _LT_AC_TRY_DLOPEN_SELF( + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], + [], [libltdl_cv_need_uscore=cross]) + LIBS="$save_LIBS" + ]) + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + AC_DEFINE([NEED_USCORE], [1], + [Define if dlsym() requires a leading underscore in symbol names.]) +fi +])# AC_LTDL_DLSYM_USCORE + +# AC_LTDL_FUNC_ARGZ +# ----------------- +AC_DEFUN([AC_LTDL_FUNC_ARGZ], +[AC_CHECK_HEADERS([argz.h]) + +AC_CHECK_TYPES([error_t], + [], + [AC_DEFINE([error_t], [int], + [Define to a type to use for `error_t' if it is not otherwise available.])], + [#if HAVE_ARGZ_H +# include +#endif]) + +AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify]) +])# AC_LTDL_FUNC_ARGZ diff --git a/libltdl/aclocal.m4 b/libltdl/aclocal.m4 new file mode 100644 index 0000000..dd92cb3 --- /dev/null +++ b/libltdl/aclocal.m4 @@ -0,0 +1,863 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 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. + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# 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.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + 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])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# 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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --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 (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_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 + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -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"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_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 -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# 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. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# 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_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# 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 +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [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], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# 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 +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# 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 +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_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. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# 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)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/libltdl/config-h.in b/libltdl/config-h.in new file mode 100644 index 0000000..b864071 --- /dev/null +++ b/libltdl/config-h.in @@ -0,0 +1,195 @@ +/* config-h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `argz_append' function. */ +#undef HAVE_ARGZ_APPEND + +/* Define to 1 if you have the `argz_create_sep' function. */ +#undef HAVE_ARGZ_CREATE_SEP + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARGZ_H + +/* Define to 1 if you have the `argz_insert' function. */ +#undef HAVE_ARGZ_INSERT + +/* Define to 1 if you have the `argz_next' function. */ +#undef HAVE_ARGZ_NEXT + +/* Define to 1 if you have the `argz_stringify' function. */ +#undef HAVE_ARGZ_STRINGIFY + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define to 1 if you have the `closedir' function. */ +#undef HAVE_CLOSEDIR + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define if you have the GNU dld library. */ +#undef HAVE_DLD + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLD_H + +/* Define to 1 if you have the `dlerror' function. */ +#undef HAVE_DLERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DL_H + +/* Define if you have the _dyld_func_lookup function. */ +#undef HAVE_DYLD + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if the system has the type `error_t'. */ +#undef HAVE_ERROR_T + +/* Define to 1 if you have the `index' function. */ +#undef HAVE_INDEX + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have the libdl library or equivalent. */ +#undef HAVE_LIBDL + +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_O_DYLD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the `opendir' function. */ +#undef HAVE_OPENDIR + +/* Define if libtool can extract symbol lists from object files. */ +#undef HAVE_PRELOADED_SYMBOLS + +/* Define to 1 if you have the `readdir' function. */ +#undef HAVE_READDIR + +/* Define to 1 if you have the `rindex' function. */ +#undef HAVE_RINDEX + +/* Define if you have the shl_load function. */ +#undef HAVE_SHL_LOAD + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strcmp' function. */ +#undef HAVE_STRCMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_DL_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if the OS needs help to load dependent libraries for dlopen(). */ +#undef LTDL_DLOPEN_DEPLIBS + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LTDL_OBJDIR + +/* Define to the name of the environment variable that determines the dynamic + library search path. */ +#undef LTDL_SHLIBPATH_VAR + +/* Define to the extension used for shared libraries, say, ".so". */ +#undef LTDL_SHLIB_EXT + +/* Define to the system default library search path. */ +#undef LTDL_SYSSEARCHPATH + +/* Define if dlsym() requires a leading underscore in symbol names. */ +#undef NEED_USCORE + +/* 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 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to a type to use for `error_t' if it is not otherwise available. */ +#undef error_t + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif diff --git a/libltdl/config.guess b/libltdl/config.guess new file mode 100755 index 0000000..2fc3acc --- /dev/null +++ b/libltdl/config.guess @@ -0,0 +1,1411 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-06-17' + +# 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 . +# Please send patches to . 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 ." + +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. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ;' + +# 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 + +## for Red Hat Linux +if test -f /etc/redhat-release ; then + VENDOR=redhat ; +else + VENDOR= ; +fi + +# 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 + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 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 + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + 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:4.0:6*) + echo sparc-icl-nx6 + 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 /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + 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 | Synergy: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 + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + 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 + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + 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 + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + 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*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 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${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:*:*|*:GNU/FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + 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*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + 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 i586-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 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-${VENDOR:-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=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-${VENDOR:-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}-${VENDOR:-ibm}-linux-gnu + exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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-${VENDOR:-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 + #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=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-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:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + 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' /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 ;; + 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 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + 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 | SDS2:*:4.0:3.0 | SHG2:*: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 ;; + 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 + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # 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:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-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 ;; + *: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 ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + 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 < +# include +#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 + 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 +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 + +# 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 < 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/libltdl/config.sub b/libltdl/config.sub new file mode 100755 index 0000000..6b2ff9f --- /dev/null +++ b/libltdl/config.sub @@ -0,0 +1,1500 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-06-18' + +# 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 . 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 ." + +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* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + 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 \ + | c4x | 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 \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | 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-* | c55x-* | c6x-* \ + | 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-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | 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 + ;; + amd64) + basic_machine=x86_64-pc + ;; + 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 + ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; + 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 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + 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 + ;; + 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 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | 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* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -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 + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -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 + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + 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/libltdl/configure b/libltdl/configure new file mode 100755 index 0000000..2504e41 --- /dev/null +++ b/libltdl/configure @@ -0,0 +1,23257 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for libltdl 1.2. +# +# Report bugs to . +# +# Copyright (C) 2003 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 +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/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_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(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" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +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 + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# 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 </dev/null 2>&1 && unset CDPATH + +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. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + 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="$lt_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 + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +# 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='libltdl' +PACKAGE_TARNAME='libltdl' +PACKAGE_VERSION='1.2' +PACKAGE_STRING='libltdl 1.2' +PACKAGE_BUGREPORT='bug-libtool@gnu.org' + +ac_unique_file="ltdl.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#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 install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar 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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL 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_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +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_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# 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 libltdl 1.2 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 + case $ac_init_help in + short | recursive ) echo "Configuration of libltdl 1.2:";; + esac + 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 build + --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) + --enable-ltdl-install install libltdl + +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-tags[=TAGS] + include additional configurations [automatic] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +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 + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + 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 +libltdl configure 1.2 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 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 libltdl $as_me 1.2, which was +generated by GNU Autoconf 2.59. 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. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: 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 && + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## ------------------------------- ## +## Libltdl specific configuration. ## +## ------------------------------- ## + +ac_aux_dir= +for ac_dir in . $srcdir/.; 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 . $srcdir/." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in . $srcdir/." >&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. + + +if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then + if test -f ${srcdir}/ltmain.sh; then + # if libltdl is libtoolized, it is assumed to be stand-alone and + # installed unless the command line overrides it (tested above) + enable_ltdl_install=yes + else + { echo "$as_me:$LINENO: WARNING: *** The top-level configure must select either" >&5 +echo "$as_me: WARNING: *** The top-level configure must select either" >&2;} + { echo "$as_me:$LINENO: WARNING: *** A\"\"C_LIBLTDL_INSTALLABLE or A\"\"C_LIBLTDL_CONVENIENCE." >&5 +echo "$as_me: WARNING: *** A\"\"C_LIBLTDL_INSTALLABLE or A\"\"C_LIBLTDL_CONVENIENCE." >&2;} + { { echo "$as_me:$LINENO: error: *** Maybe you want to --enable-ltdl-install?" >&5 +echo "$as_me: error: *** Maybe you want to --enable-ltdl-install?" >&2;} + { (exit 1); exit 1; }; } + fi +fi + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +am__api_version="1.9" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +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/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_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 + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +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 + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# 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=libltdl + VERSION=1.2 + + +# 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"} + +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. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + ac_config_headers="$ac_config_headers config.h:config-h.in" + + + +## ------------------ ## +## C compiler checks. ## +## ------------------ ## +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 +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&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 &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $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= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].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, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more 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'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&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 b.out +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 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 \ + '' \ + '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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +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 + + + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 + + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## + + +# 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. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + +# Check whether --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. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=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. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + +# 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/'` + + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +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 + + + +# 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 $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $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. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + 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 + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +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 lds only accept -v. +case `$LD -v 2>&1 &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 +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +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 + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +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 dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent 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 extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + 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=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +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 +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Check 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 +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > 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 + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 3885 "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 + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > 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.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > 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.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +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_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + 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_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="false" +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +echo "${ECHO_T}$ac_ct_DLLTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DLLTOOL=$ac_ct_DLLTOOL +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +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_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + 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_AS" && ac_cv_prog_ac_ct_AS="false" +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +echo "${ECHO_T}$ac_ct_AS" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AS=$ac_ct_AS +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +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_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + 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_OBJDUMP" && ac_cv_prog_ac_ct_OBJDUMP="false" +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +echo "${ECHO_T}$ac_ct_OBJDUMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + OBJDUMP=$ac_ct_OBJDUMP +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; + +esac + +need_locks="$enable_libtool_lock" + + +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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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 +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&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 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ---------------------------------- ## +## Report this to bug-libtool@gnu.org ## +## ---------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + +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 &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err 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 \ + '' \ + '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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err 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=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 + +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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_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 + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/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=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + 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 + + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + 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 how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + 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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 +sed 's/^/| /' 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 \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + 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_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # 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_F77="$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 +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +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_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:5726:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +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 + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# 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 from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $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 an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (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 + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 <&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 grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_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${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_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 + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + 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 + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +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 + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_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 MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + 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_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +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 + + +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 "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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 "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# 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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# 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_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&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="$lt_save_ifs" + MAGIC_CMD="$lt_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_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&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="$lt_save_ifs" + MAGIC_CMD="$lt_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 + +enable_dlopen=no +enable_win32_dll=yes + +# 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 + + +# 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 + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +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 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:6793: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:6797: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +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 "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + 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_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + 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_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7061: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7065: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +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_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7165: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7169: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + 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_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + 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 extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # 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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&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 + 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 + + # Samuel A. Falvo II 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't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(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=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $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' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&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 | grep ': 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 + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $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" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; 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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|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. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + 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' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_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' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + 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 + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + 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 + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `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"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + 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* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$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' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + 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 $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + 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 $compiler_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 "%s %s\\n" -exported_symbol "\$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 ${output_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=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + 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) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$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 + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 8634 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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" || \ + test "X$hardcode_automatic" = "Xyes" ; 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 "$_LT_AC_TAGVAR(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 + +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 + +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 +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + 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 + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +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 + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err 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 + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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 +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* 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 (); +/* 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 +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err 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" + wl=$lt_prog_compiler_wl 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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + 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; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + 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 < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + 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; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +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 + + +# Report which library types will actually be built +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* | aix5*) + 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 + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | 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, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### 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=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# 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=$lt_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_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_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 used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# 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 >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +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" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + 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 + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# 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 $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $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. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + 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 + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +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 lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + 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 + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=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_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=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_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +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 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + 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_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11975: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:11979: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +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_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12079: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:12083: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = 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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX 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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 12615 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = 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 + + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# 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=$lt_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_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# 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_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# 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_CXX +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_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# 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_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_CXX + +# 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_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# 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_CXX + +# 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_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# 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_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +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* | aix5*) + 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 + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +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 "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + 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_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + 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_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13670: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:13674: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +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_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13774: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:13778: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = 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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$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_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&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 + fi + ;; + + amigaos*) + archive_cmds_F77='$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_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II 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't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&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 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$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_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|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. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=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_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=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_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$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_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + 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_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$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_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$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_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$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_F77=' -expect_unresolved \*' + archive_cmds_F77='$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_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$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_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$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_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$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' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 15223 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = 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 + + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# 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=$lt_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_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# 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_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# 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_F77 +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_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# 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_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_F77 + +# 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_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# 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_F77 + +# 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_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# 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_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +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 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16002: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16006: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +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 "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + 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_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + 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_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16270: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16274: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +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_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16374: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:16378: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = 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 + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$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_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_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= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&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 + fi + ;; + + amigaos*) + archive_cmds_GCJ='$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_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II 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't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&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 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$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_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|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. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=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_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=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_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$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_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + 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_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$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_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$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_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$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_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$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_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$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_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$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_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$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' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ 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 + $rm conftest* + printf "$lt_simple_compile_test_code" > 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +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= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 17843 "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 + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +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_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = 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 + + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# 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=$lt_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_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# 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_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# 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_GCJ +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_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# 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_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_GCJ + +# 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_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# 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_GCJ + +# 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_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# 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_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else 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 + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # 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 EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_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 + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# 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=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# 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=$lt_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_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# 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_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# 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_RC +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_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# 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_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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_RC + +# 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_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# 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_RC + +# 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_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# 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_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err 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_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +else + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +fi + +# Check whether --enable-ltdl-install or --disable-ltdl-install was given. +if test "${enable_ltdl_install+set}" = set; then + enableval="$enable_ltdl_install" + +fi; + + + +if test x"${enable_ltdl_install-no}" != xno; then + INSTALL_LTDL_TRUE= + INSTALL_LTDL_FALSE='#' +else + INSTALL_LTDL_TRUE='#' + INSTALL_LTDL_FALSE= +fi + + + +if test x"${enable_ltdl_convenience-no}" != xno; then + CONVENIENCE_LTDL_TRUE= + CONVENIENCE_LTDL_FALSE='#' +else + CONVENIENCE_LTDL_TRUE='#' + CONVENIENCE_LTDL_FALSE= +fi + + + +echo "$as_me:$LINENO: checking which extension is used for loadable modules" >&5 +echo $ECHO_N "checking which extension is used for loadable modules... $ECHO_C" >&6 +if test "${libltdl_cv_shlibext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +module=yes +eval libltdl_cv_shlibext=$shrext_cmds + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5 +echo "${ECHO_T}$libltdl_cv_shlibext" >&6 +if test -n "$libltdl_cv_shlibext"; then + +cat >>confdefs.h <<_ACEOF +#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext" +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking which variable specifies run-time library path" >&5 +echo $ECHO_N "checking which variable specifies run-time library path... $ECHO_C" >&6 +if test "${libltdl_cv_shlibpath_var+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_shlibpath_var="$shlibpath_var" +fi +echo "$as_me:$LINENO: result: $libltdl_cv_shlibpath_var" >&5 +echo "${ECHO_T}$libltdl_cv_shlibpath_var" >&6 +if test -n "$libltdl_cv_shlibpath_var"; then + +cat >>confdefs.h <<_ACEOF +#define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var" +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking for the default library search path" >&5 +echo $ECHO_N "checking for the default library search path... $ECHO_C" >&6 +if test "${libltdl_cv_sys_search_path+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec" +fi +echo "$as_me:$LINENO: result: $libltdl_cv_sys_search_path" >&5 +echo "${ECHO_T}$libltdl_cv_sys_search_path" >&6 +if test -n "$libltdl_cv_sys_search_path"; then + sys_search_path= + for dir in $libltdl_cv_sys_search_path; do + if test -z "$sys_search_path"; then + sys_search_path="$dir" + else + sys_search_path="$sys_search_path$PATH_SEPARATOR$dir" + fi + done + +cat >>confdefs.h <<_ACEOF +#define LTDL_SYSSEARCHPATH "$sys_search_path" +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${libltdl_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_objdir="$objdir" + if test -n "$objdir"; then + : + else + rm -f .libs 2>/dev/null + mkdir .libs 2>/dev/null + if test -d .libs; then + libltdl_cv_objdir=.libs + else + # MS-DOS does not allow filenames that begin with a dot. + libltdl_cv_objdir=_libs + fi + rmdir .libs 2>/dev/null + fi + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_objdir" >&5 +echo "${ECHO_T}$libltdl_cv_objdir" >&6 + +cat >>confdefs.h <<_ACEOF +#define LTDL_OBJDIR "$libltdl_cv_objdir/" +_ACEOF + + + +echo "$as_me:$LINENO: checking whether libtool supports -dlopen/-dlpreopen" >&5 +echo $ECHO_N "checking whether libtool supports -dlopen/-dlpreopen... $ECHO_C" >&6 +if test "${libltdl_cv_preloaded_symbols+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$lt_cv_sys_global_symbol_pipe"; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_preloaded_symbols" >&5 +echo "${ECHO_T}$libltdl_cv_preloaded_symbols" >&6 +if test x"$libltdl_cv_preloaded_symbols" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PRELOADED_SYMBOLS 1 +_ACEOF + +fi + +LIBADD_DL= + +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 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 (); +/* 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 +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SHL_LOAD 1 +_ACEOF + +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SHL_LOAD 1 +_ACEOF + + LIBADD_DL="$LIBADD_DL -ldld" +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes" +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if HAVE_DLFCN_H +# include +#endif + +int +main () +{ +dlopen(0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + libltdl_cv_func_dlopen="yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes" +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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err 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 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DLD 1 +_ACEOF + + LIBADD_DL="$LIBADD_DL -ldld" +else + echo "$as_me:$LINENO: checking for _dyld_func_lookup" >&5 +echo $ECHO_N "checking for _dyld_func_lookup... $ECHO_C" >&6 +if test "${ac_cv_func__dyld_func_lookup+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _dyld_func_lookup to an innocuous variant, in case declares _dyld_func_lookup. + For example, HP-UX 11i declares gettimeofday. */ +#define _dyld_func_lookup innocuous__dyld_func_lookup + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _dyld_func_lookup (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _dyld_func_lookup + +/* 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 _dyld_func_lookup (); +/* 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__dyld_func_lookup) || defined (__stub____dyld_func_lookup) +choke me +#else +char (*f) () = _dyld_func_lookup; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != _dyld_func_lookup; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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__dyld_func_lookup=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func__dyld_func_lookup=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func__dyld_func_lookup" >&5 +echo "${ECHO_T}$ac_cv_func__dyld_func_lookup" >&6 +if test $ac_cv_func__dyld_func_lookup = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DYLD 1 +_ACEOF + +fi + + +fi + + +fi + + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi + + +fi + + +fi + + +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + +for ac_func in dlerror +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + LIBS="$lt_save_LIBS" +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 _ prefix in compiled symbols" >&5 +echo $ECHO_N "checking for _ prefix in compiled symbols... $ECHO_C" >&6 +if test "${ac_cv_sys_symbol_underscore+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <&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. + ac_nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + ac_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&5 + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + fi + rm -rf conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_symbol_underscore" >&5 +echo "${ECHO_T}$ac_cv_sys_symbol_underscore" >&6 + + +if test x"$ac_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + echo "$as_me:$LINENO: checking whether we have to add an underscore for dlsym" >&5 +echo $ECHO_N "checking whether we have to add an underscore for dlsym... $ECHO_C" >&6 +if test "${libltdl_cv_need_uscore+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DL" + if test "$cross_compiling" = yes; then : + libltdl_cv_need_uscore=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + 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; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; + x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; + x$lt_dlunknown|x*) ;; + esac + else : + # compilation failed + + fi +fi +rm -fr conftest* + + LIBS="$save_LIBS" + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_need_uscore" >&5 +echo "${ECHO_T}$libltdl_cv_need_uscore" >&6 + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_USCORE 1 +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking whether deplibs are loaded by dlopen" >&5 +echo $ECHO_N "checking whether deplibs are loaded by dlopen... $ECHO_C" >&6 +if test "${libltdl_cv_sys_dlopen_deplibs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + libltdl_cv_sys_dlopen_deplibs=unknown + case "$host_os" in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + aix[45]*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + libltdl_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + interix*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + irix[12345]*|irix6.[01]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + osf[1234]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explictly say `no'. + libltdl_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + libltdl_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + libltdl_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + +fi +echo "$as_me:$LINENO: result: $libltdl_cv_sys_dlopen_deplibs" >&5 +echo "${ECHO_T}$libltdl_cv_sys_dlopen_deplibs" >&6 +if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then + +cat >>confdefs.h <<\_ACEOF +#define LTDL_DLOPEN_DEPLIBS 1 +_ACEOF + +fi + + +for ac_header in argz.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ---------------------------------- ## +## Report this to bug-libtool@gnu.org ## +## ---------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + + +echo "$as_me:$LINENO: checking for error_t" >&5 +echo $ECHO_N "checking for error_t... $ECHO_C" >&6 +if test "${ac_cv_type_error_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if HAVE_ARGZ_H +# include +#endif + +int +main () +{ +if ((error_t *) 0) + return 0; +if (sizeof (error_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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_error_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_error_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_error_t" >&5 +echo "${ECHO_T}$ac_cv_type_error_t" >&6 +if test $ac_cv_type_error_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_ERROR_T 1 +_ACEOF + + +else + +cat >>confdefs.h <<\_ACEOF +#define error_t int +_ACEOF + +fi + + + + + + + +for ac_func in argz_append argz_create_sep argz_insert argz_next argz_stringify +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ + stdio.h unistd.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ---------------------------------- ## +## Report this to bug-libtool@gnu.org ## +## ---------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + + + + + +for ac_header in dl.h sys/dl.h dld.h mach-o/dyld.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ---------------------------------- ## +## Report this to bug-libtool@gnu.org ## +## ---------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + + + +for ac_header in string.h strings.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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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>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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err 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 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end 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 + ac_cpp_err=$ac_cpp_err$ac_c_werror_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 +sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + 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: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ---------------------------------- ## +## Report this to bug-libtool@gnu.org ## +## ---------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&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 + break +fi + +done + + + + +for ac_func in strchr index +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi +done + + + +for ac_func in strrchr rindex +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi +done + + + +for ac_func in memcpy bcopy +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + break +fi +done + + + +for ac_func in memmove strcmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +for ac_func in closedir opendir readdir +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +## -------- ## +## Outputs. ## +## -------- ## + ac_config_files="$ac_config_files Makefile" + +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 diff $cache_file confcache >/dev/null 2>&1; 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 +if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"INSTALL_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"CONVENIENCE_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"CONVENIENCE_LTDL\" 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 +ac_cs_recheck=false +ac_cs_silent=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 +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/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_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(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" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +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 + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# 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 libltdl $as_me 1.2, which was +generated by GNU Autoconf 2.59. 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 + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +libltdl config.status 1.2 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 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) + ac_cs_recheck=: ;; + --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;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # 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 + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_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" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config-h.in" ;; + *) { { 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 + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# 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. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&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,@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,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;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,@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,@EGREP@,$EGREP,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@DLLTOOL@,$DLLTOOL,;t t +s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t +s,@AS@,$AS,;t t +s,@ac_ct_AS@,$ac_ct_AS,;t t +s,@OBJDUMP@,$OBJDUMP,;t t +s,@ac_ct_OBJDUMP@,$ac_ct_OBJDUMP,;t t +s,@CPP@,$CPP,;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,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t +s,@INSTALL_LTDL_TRUE@,$INSTALL_LTDL_TRUE,;t t +s,@INSTALL_LTDL_FALSE@,$INSTALL_LTDL_FALSE,;t t +s,@CONVENIENCE_LTDL_TRUE@,$CONVENIENCE_LTDL_TRUE,;t t +s,@CONVENIENCE_LTDL_FALSE@,$CONVENIENCE_LTDL_FALSE,;t t +s,@LIBADD_DL@,$LIBADD_DL,;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 + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + 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; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + 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 <>$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 <>$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 diff $ac_file $tmp/config.h >/dev/null 2>&1; 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 +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +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'` + { 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 + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { 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 + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -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=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/libltdl/configure.ac b/libltdl/configure.ac new file mode 100644 index 0000000..1446efb --- /dev/null +++ b/libltdl/configure.ac @@ -0,0 +1,79 @@ +## Process this file with autoconf to create configure. -*- autoconf -*- +# 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 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + + +dnl FIXME: Is this really new enough? +AC_PREREQ(2.50) + + +## ------------------------ ## +## Autoconf initialisation. ## +## ------------------------ ## +AC_INIT([libltdl], [1.2], [bug-libtool@gnu.org]) +AC_CONFIG_SRCDIR([ltdl.c]) + + +## ------------------------------- ## +## Libltdl specific configuration. ## +## ------------------------------- ## + +AC_CONFIG_AUX_DIR([.]) + +if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then + if test -f ${srcdir}/ltmain.sh; then + # if libltdl is libtoolized, it is assumed to be stand-alone and + # installed unless the command line overrides it (tested above) + enable_ltdl_install=yes + else + AC_MSG_WARN([*** The top-level configure must select either]) + AC_MSG_WARN([*** [A""C_LIBLTDL_INSTALLABLE] or [A""C_LIBLTDL_CONVENIENCE].]) + AC_MSG_ERROR([*** Maybe you want to --enable-ltdl-install?]) + fi +fi + + +## ------------------------ ## +## Automake Initialisation. ## +## ------------------------ ## +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, -) +AM_CONFIG_HEADER([config.h:config-h.in]) + + +## ------------------ ## +## C compiler checks. ## +## ------------------ ## +AC_PROG_CC +AC_C_CONST +AC_C_INLINE + + +## ----------------------- ## +## Libtool initialisation. ## +## ----------------------- ## +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) + +AC_LIB_LTDL + + +## -------- ## +## Outputs. ## +## -------- ## +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/libltdl/install-sh b/libltdl/install-sh new file mode 100755 index 0000000..0ae12c0 --- /dev/null +++ b/libltdl/install-sh @@ -0,0 +1,401 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-11-07.23 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Symbolic mode for testing mkdir with directories. +# It is the same as 755, but also tests that "u+" works. +test_mode=u=rwx,g=rx,o=rx,u+wx + +# Desired mode of installed file. +mode=0755 + +# Desired mode of newly created intermediate directories. +# It is empty if not known yet. +intermediate_mode= + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15 + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + posix_mkdir=false + if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then + posix_mkdir=true + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null + fi ;; + esac + + if + $posix_mkdir && { + + # With -d, create the new directory with the user-specified mode. + # Otherwise, create it using the same intermediate mode that + # mkdir -p would use when creating intermediate directories. + # POSIX says that this mode is "$(umask -S),u+wx", so use that + # if umask -S works. + + if test -n "$dir_arg"; then + mkdir_mode=$mode + else + case $intermediate_mode in + '') + if umask_S=`(umask -S) 2>/dev/null`; then + intermediate_mode=$umask_S,u+wx + else + intermediate_mode=$test_mode + fi ;; + esac + mkdir_mode=$intermediate_mode + fi + + $mkdirprog -m "$mkdir_mode" -p -- "$dstdir" + } + then : + else + + # mkdir does not conform to POSIX, or it failed possibly due to + # a race condition. Create the directory the slow way, step by + # step, checking for races as we go. + + case $dstdir in + /*) pathcomp=/ ;; + -*) pathcomp=./ ;; + *) pathcomp= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # Don't fail if two instances are running concurrently. + test -d "$pathcomp" || exit 1 + fi + pathcomp=$pathcomp/ + done + obsolete_mkdir_used=true + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c new file mode 100644 index 0000000..3da37c8 --- /dev/null +++ b/libltdl/ltdl.c @@ -0,0 +1,4521 @@ +/* ltdl.c -- system independent dlopen wrapper + Copyright (C) 1998, 1999, 2000, 2004, 2005 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU libtool, you may include it under the same +distribution terms that you use for the rest of that program. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA + +*/ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + +#if HAVE_STDIO_H +# include +#endif + +/* Include the header defining malloc. On K&R C compilers, + that's , on ANSI C and ISO C compilers, that's . */ +#if HAVE_STDLIB_H +# include +#else +# if HAVE_MALLOC_H +# include +# endif +#endif + +#if HAVE_STRING_H +# include +#else +# if HAVE_STRINGS_H +# include +# endif +#endif + +#if HAVE_CTYPE_H +# include +#endif + +#if HAVE_MEMORY_H +# include +#endif + +#if HAVE_ERRNO_H +# include +#endif + + +#ifndef __WINDOWS__ +# ifdef __WIN32__ +# define __WINDOWS__ +# endif +#endif + + +#undef LT_USE_POSIX_DIRENT +#ifdef HAVE_CLOSEDIR +# ifdef HAVE_OPENDIR +# ifdef HAVE_READDIR +# ifdef HAVE_DIRENT_H +# define LT_USE_POSIX_DIRENT +# endif /* HAVE_DIRENT_H */ +# endif /* HAVE_READDIR */ +# endif /* HAVE_OPENDIR */ +#endif /* HAVE_CLOSEDIR */ + + +#undef LT_USE_WINDOWS_DIRENT_EMULATION +#ifndef LT_USE_POSIX_DIRENT +# ifdef __WINDOWS__ +# define LT_USE_WINDOWS_DIRENT_EMULATION +# endif /* __WINDOWS__ */ +#endif /* LT_USE_POSIX_DIRENT */ + + +#ifdef LT_USE_POSIX_DIRENT +# include +# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +#else +# ifdef LT_USE_WINDOWS_DIRENT_EMULATION +# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +# else +# define dirent direct +# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen) +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +# endif +#endif + +#if HAVE_ARGZ_H +# include +#endif + +#if HAVE_ASSERT_H +# include +#else +# define assert(arg) ((void) 0) +#endif + +#include "ltdl.h" + +#if WITH_DMALLOC +# include +#endif + + + + +/* --- WINDOWS SUPPORT --- */ + + +#ifdef DLL_EXPORT +# define LT_GLOBAL_DATA __declspec(dllexport) +#else +# define LT_GLOBAL_DATA +#endif + +/* fopen() mode flags for reading a text file */ +#undef LT_READTEXT_MODE +#ifdef __WINDOWS__ +# define LT_READTEXT_MODE "rt" +#else +# define LT_READTEXT_MODE "r" +#endif + +#ifdef LT_USE_WINDOWS_DIRENT_EMULATION + +#include + +#define dirent lt_dirent +#define DIR lt_DIR + +struct dirent +{ + char d_name[2048]; + int d_namlen; +}; + +typedef struct _DIR +{ + HANDLE hSearch; + WIN32_FIND_DATA Win32FindData; + BOOL firsttime; + struct dirent file_info; +} DIR; + +#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ + + +/* --- MANIFEST CONSTANTS --- */ + + +/* Standard libltdl search path environment variable name */ +#undef LTDL_SEARCHPATH_VAR +#define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" + +/* Standard libtool archive file extension. */ +#undef LTDL_ARCHIVE_EXT +#define LTDL_ARCHIVE_EXT ".la" + +/* max. filename length */ +#ifndef LT_FILENAME_MAX +# define LT_FILENAME_MAX 1024 +#endif + +/* This is the maximum symbol size that won't require malloc/free */ +#undef LT_SYMBOL_LENGTH +#define LT_SYMBOL_LENGTH 128 + +/* This accounts for the _LTX_ separator */ +#undef LT_SYMBOL_OVERHEAD +#define LT_SYMBOL_OVERHEAD 5 + + + + +/* --- MEMORY HANDLING --- */ + + +/* These are the functions used internally. In addition to making + use of the associated function pointers above, they also perform + error handling. */ +static char *lt_estrdup LT_PARAMS((const char *str)); +static lt_ptr lt_emalloc LT_PARAMS((size_t size)); +static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size)); + +/* static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); */ +#define rpl_realloc realloc + +/* These are the pointers that can be changed by the caller: */ +LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)) + = (lt_ptr (*) LT_PARAMS((size_t))) malloc; +LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)) + = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc; +LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) + = (void (*) LT_PARAMS((lt_ptr))) free; + +/* The following macros reduce the amount of typing needed to cast + assigned memory. */ +#if WITH_DMALLOC + +#define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END + +#define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) + +#else + +#define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END + +#define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) + +#endif + +#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ + if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \ + } LT_STMT_END + + +/* --- REPLACEMENT FUNCTIONS --- */ + + +#undef strdup +#define strdup rpl_strdup + +static char *strdup LT_PARAMS((const char *str)); + +static char * +strdup(str) + const char *str; +{ + char *tmp = 0; + + if (str) + { + tmp = LT_DLMALLOC (char, 1+ strlen (str)); + if (tmp) + { + strcpy(tmp, str); + } + } + + return tmp; +} + + +#if ! HAVE_STRCMP + +#undef strcmp +#define strcmp rpl_strcmp + +static int strcmp LT_PARAMS((const char *str1, const char *str2)); + +static int +strcmp (str1, str2) + const char *str1; + const char *str2; +{ + if (str1 == str2) + return 0; + if (str1 == 0) + return -1; + if (str2 == 0) + return 1; + + for (;*str1 && *str2; ++str1, ++str2) + { + if (*str1 != *str2) + break; + } + + return (int)(*str1 - *str2); +} +#endif + + +#if ! HAVE_STRCHR + +# if HAVE_INDEX +# define strchr index +# else +# define strchr rpl_strchr + +static const char *strchr LT_PARAMS((const char *str, int ch)); + +static const char* +strchr(str, ch) + const char *str; + int ch; +{ + const char *p; + + for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p) + /*NOWORK*/; + + return (*p == (char)ch) ? p : 0; +} + +# endif +#endif /* !HAVE_STRCHR */ + + +#if ! HAVE_STRRCHR + +# if HAVE_RINDEX +# define strrchr rindex +# else +# define strrchr rpl_strrchr + +static const char *strrchr LT_PARAMS((const char *str, int ch)); + +static const char* +strrchr(str, ch) + const char *str; + int ch; +{ + const char *p, *q = 0; + + for (p = str; *p != LT_EOS_CHAR; ++p) + { + if (*p == (char) ch) + { + q = p; + } + } + + return q; +} + +# endif +#endif + +/* NOTE: Neither bcopy nor the memcpy implementation below can + reliably handle copying in overlapping areas of memory. Use + memmove (for which there is a fallback implmentation below) + if you need that behaviour. */ +#if ! HAVE_MEMCPY + +# if HAVE_BCOPY +# define memcpy(dest, src, size) bcopy (src, dest, size) +# else +# define memcpy rpl_memcpy + +static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr +memcpy (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + const char * s = src; + char * d = dest; + size_t i = 0; + + for (i = 0; i < size; ++i) + { + d[i] = s[i]; + } + + return dest; +} + +# endif /* !HAVE_BCOPY */ +#endif /* !HAVE_MEMCPY */ + +#if ! HAVE_MEMMOVE +# define memmove rpl_memmove + +static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +static lt_ptr +memmove (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + const char * s = src; + char * d = dest; + size_t i; + + if (d < s) + for (i = 0; i < size; ++i) + { + d[i] = s[i]; + } + else if (d > s && size > 0) + for (i = size -1; ; --i) + { + d[i] = s[i]; + if (i == 0) + break; + } + + return dest; +} + +#endif /* !HAVE_MEMMOVE */ + +#ifdef LT_USE_WINDOWS_DIRENT_EMULATION + +static void closedir LT_PARAMS((DIR *entry)); + +static void +closedir(entry) + DIR *entry; +{ + assert(entry != (DIR *) NULL); + FindClose(entry->hSearch); + lt_dlfree((lt_ptr)entry); +} + + +static DIR * opendir LT_PARAMS((const char *path)); + +static DIR* +opendir (path) + const char *path; +{ + char file_specification[LT_FILENAME_MAX]; + DIR *entry; + + assert(path != (char *) NULL); + /* allow space for: path + '\\' '\\' '*' '.' '*' + '\0' */ + (void) strncpy (file_specification, path, LT_FILENAME_MAX-6); + file_specification[LT_FILENAME_MAX-6] = LT_EOS_CHAR; + (void) strcat(file_specification,"\\"); + entry = LT_DLMALLOC (DIR,sizeof(DIR)); + if (entry != (DIR *) 0) + { + entry->firsttime = TRUE; + entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); + } + if (entry->hSearch == INVALID_HANDLE_VALUE) + { + (void) strcat(file_specification,"\\*.*"); + entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); + if (entry->hSearch == INVALID_HANDLE_VALUE) + { + LT_DLFREE (entry); + return (DIR *) 0; + } + } + return(entry); +} + + +static struct dirent *readdir LT_PARAMS((DIR *entry)); + +static struct dirent *readdir(entry) + DIR *entry; +{ + int + status; + + if (entry == (DIR *) 0) + return((struct dirent *) 0); + if (!entry->firsttime) + { + status = FindNextFile(entry->hSearch,&entry->Win32FindData); + if (status == 0) + return((struct dirent *) 0); + } + entry->firsttime = FALSE; + (void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName, + LT_FILENAME_MAX-1); + entry->file_info.d_name[LT_FILENAME_MAX - 1] = LT_EOS_CHAR; + entry->file_info.d_namlen = strlen(entry->file_info.d_name); + return(&entry->file_info); +} + +#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ + +/* According to Alexandre Oliva , + ``realloc is not entirely portable'' + In any case we want to use the allocator supplied by the user without + burdening them with an lt_dlrealloc function pointer to maintain. + Instead implement our own version (with known boundary conditions) + using lt_dlmalloc and lt_dlfree. */ + +/* #undef realloc + #define realloc rpl_realloc +*/ +#if 0 + /* You can't (re)define realloc unless you also (re)define malloc. + Right now, this code uses the size of the *destination* to decide + how much to copy. That's not right, but you can't know the size + of the source unless you know enough about, or wrote malloc. So + this code is disabled... */ + +static lt_ptr +realloc (ptr, size) + lt_ptr ptr; + size_t size; +{ + if (size == 0) + { + /* For zero or less bytes, free the original memory */ + if (ptr != 0) + { + lt_dlfree (ptr); + } + + return (lt_ptr) 0; + } + else if (ptr == 0) + { + /* Allow reallocation of a NULL pointer. */ + return lt_dlmalloc (size); + } + else + { + /* Allocate a new block, copy and free the old block. */ + lt_ptr mem = lt_dlmalloc (size); + + if (mem) + { + memcpy (mem, ptr, size); + lt_dlfree (ptr); + } + + /* Note that the contents of PTR are not damaged if there is + insufficient memory to realloc. */ + return mem; + } +} +#endif + + +#if ! HAVE_ARGZ_APPEND +# define argz_append rpl_argz_append + +static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len, + const char *buf, size_t buf_len)); + +static error_t +argz_append (pargz, pargz_len, buf, buf_len) + char **pargz; + size_t *pargz_len; + const char *buf; + size_t buf_len; +{ + size_t argz_len; + char *argz; + + assert (pargz); + assert (pargz_len); + assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); + + /* If nothing needs to be appended, no more work is required. */ + if (buf_len == 0) + return 0; + + /* Ensure there is enough room to append BUF_LEN. */ + argz_len = *pargz_len + buf_len; + argz = LT_DLREALLOC (char, *pargz, argz_len); + if (!argz) + return ENOMEM; + + /* Copy characters from BUF after terminating '\0' in ARGZ. */ + memcpy (argz + *pargz_len, buf, buf_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_APPEND */ + + +#if ! HAVE_ARGZ_CREATE_SEP +# define argz_create_sep rpl_argz_create_sep + +static error_t argz_create_sep LT_PARAMS((const char *str, int delim, + char **pargz, size_t *pargz_len)); + +static error_t +argz_create_sep (str, delim, pargz, pargz_len) + const char *str; + int delim; + char **pargz; + size_t *pargz_len; +{ + size_t argz_len; + char *argz = 0; + + assert (str); + assert (pargz); + assert (pargz_len); + + /* Make a copy of STR, but replacing each occurrence of + DELIM with '\0'. */ + argz_len = 1+ LT_STRLEN (str); + if (argz_len) + { + const char *p; + char *q; + + argz = LT_DLMALLOC (char, argz_len); + if (!argz) + return ENOMEM; + + for (p = str, q = argz; *p != LT_EOS_CHAR; ++p) + { + if (*p == delim) + { + /* Ignore leading delimiters, and fold consecutive + delimiters in STR into a single '\0' in ARGZ. */ + if ((q > argz) && (q[-1] != LT_EOS_CHAR)) + *q++ = LT_EOS_CHAR; + else + --argz_len; + } + else + *q++ = *p; + } + /* Copy terminating LT_EOS_CHAR. */ + *q = *p; + } + + /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ + if (!argz_len) + LT_DLFREE (argz); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_CREATE_SEP */ + + +#if ! HAVE_ARGZ_INSERT +# define argz_insert rpl_argz_insert + +static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, + char *before, const char *entry)); + +static error_t +argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + /* No BEFORE address indicates ENTRY should be inserted after the + current last element. */ + if (!before) + return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry)); + + /* This probably indicates a programmer error, but to preserve + semantics, scan back to the start of an entry if BEFORE points + into the middle of it. */ + while ((before > *pargz) && (before[-1] != LT_EOS_CHAR)) + --before; + + { + size_t entry_len = 1+ LT_STRLEN (entry); + size_t argz_len = *pargz_len + entry_len; + size_t offset = before - *pargz; + char *argz = LT_DLREALLOC (char, *pargz, argz_len); + + if (!argz) + return ENOMEM; + + /* Make BEFORE point to the equivalent offset in ARGZ that it + used to have in *PARGZ incase realloc() moved the block. */ + before = argz + offset; + + /* Move the ARGZ entries starting at BEFORE up into the new + space at the end -- making room to copy ENTRY into the + resulting gap. */ + memmove (before + entry_len, before, *pargz_len - offset); + memcpy (before, entry, entry_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + } + + return 0; +} +#endif /* !HAVE_ARGZ_INSERT */ + + +#if ! HAVE_ARGZ_NEXT +# define argz_next rpl_argz_next + +static char *argz_next LT_PARAMS((char *argz, size_t argz_len, + const char *entry)); + +static char * +argz_next (argz, argz_len, entry) + char *argz; + size_t argz_len; + const char *entry; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (entry) + { + /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address + within the ARGZ vector. */ + assert ((!argz && !argz_len) + || ((argz <= entry) && (entry < (argz + argz_len)))); + + /* Move to the char immediately after the terminating + '\0' of ENTRY. */ + entry = 1+ strchr (entry, LT_EOS_CHAR); + + /* Return either the new ENTRY, or else NULL if ARGZ is + exhausted. */ + return (entry >= argz + argz_len) ? 0 : (char *) entry; + } + else + { + /* This should probably be flagged as a programmer error, + since starting an argz_next loop with the iterator set + to ARGZ is safer. To preserve semantics, handle the NULL + case by returning the start of ARGZ (if any). */ + if (argz_len > 0) + return argz; + else + return 0; + } +} +#endif /* !HAVE_ARGZ_NEXT */ + + + +#if ! HAVE_ARGZ_STRINGIFY +# define argz_stringify rpl_argz_stringify + +static void argz_stringify LT_PARAMS((char *argz, size_t argz_len, + int sep)); + +static void +argz_stringify (argz, argz_len, sep) + char *argz; + size_t argz_len; + int sep; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (sep) + { + --argz_len; /* don't stringify the terminating EOS */ + while (--argz_len > 0) + { + if (argz[argz_len] == LT_EOS_CHAR) + argz[argz_len] = sep; + } + } +} +#endif /* !HAVE_ARGZ_STRINGIFY */ + + + + +/* --- TYPE DEFINITIONS -- */ + + +/* This type is used for the array of caller data sets in each handler. */ +typedef struct { + lt_dlcaller_id key; + lt_ptr data; +} lt_caller_data; + + + + +/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ + + +/* Extract the diagnostic strings from the error table macro in the same + order as the enumerated indices in ltdl.h. */ + +static const char *lt_dlerror_strings[] = + { +#define LT_ERROR(name, diagnostic) (diagnostic), + lt_dlerror_table +#undef LT_ERROR + + 0 + }; + +/* This structure is used for the list of registered loaders. */ +struct lt_dlloader { + struct lt_dlloader *next; + const char *loader_name; /* identifying name for each loader */ + const char *sym_prefix; /* prefix for symbols */ + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +struct lt_dlhandle_struct { + struct lt_dlhandle_struct *next; + lt_dlloader *loader; /* dlopening interface */ + lt_dlinfo info; + int depcount; /* number of dependencies */ + lt_dlhandle *deplibs; /* dependencies */ + lt_module module; /* system module handle */ + lt_ptr system; /* system specific data */ + lt_caller_data *caller_data; /* per caller associated data */ + int flags; /* various boolean stats */ +}; + +/* Various boolean flags can be stored in the flags field of an + lt_dlhandle_struct... */ +#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag)) +#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag)) + +#define LT_DLRESIDENT_FLAG (0x01 << 0) +/* ...add more flags here... */ + +#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG) + + +#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)] + +static const char objdir[] = LTDL_OBJDIR; +static const char archive_ext[] = LTDL_ARCHIVE_EXT; +#ifdef LTDL_SHLIB_EXT +static const char shlib_ext[] = LTDL_SHLIB_EXT; +#endif +#ifdef LTDL_SYSSEARCHPATH +static const char sys_search_path[] = LTDL_SYSSEARCHPATH; +#endif + + + + +/* --- MUTEX LOCKING --- */ + + +/* Macros to make it easier to run the lock functions only if they have + been registered. The reason for the complicated lock macro is to + ensure that the stored error message from the last error is not + accidentally erased if the current function doesn't generate an + error of its own. */ +#define LT_DLMUTEX_LOCK() LT_STMT_START { \ + if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ + } LT_STMT_END +#define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ + if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\ + } LT_STMT_END +#define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (*lt_dlmutex_seterror_func) (errormsg); \ + else lt_dllast_error = (errormsg); } LT_STMT_END +#define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (errormsg) = (*lt_dlmutex_geterror_func) (); \ + else (errormsg) = lt_dllast_error; } LT_STMT_END + +/* The mutex functions stored here are global, and are necessarily the + same for all threads that wish to share access to libltdl. */ +static lt_dlmutex_lock *lt_dlmutex_lock_func = 0; +static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0; +static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0; +static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0; +static const char *lt_dllast_error = 0; + + +/* Either set or reset the mutex functions. Either all the arguments must + be valid functions, or else all can be NULL to turn off locking entirely. + The registered functions should be manipulating a static global lock + from the lock() and unlock() callbacks, which needs to be reentrant. */ +int +lt_dlmutex_register (lock, unlock, seterror, geterror) + lt_dlmutex_lock *lock; + lt_dlmutex_unlock *unlock; + lt_dlmutex_seterror *seterror; + lt_dlmutex_geterror *geterror; +{ + lt_dlmutex_unlock *old_unlock = unlock; + int errors = 0; + + /* Lock using the old lock() callback, if any. */ + LT_DLMUTEX_LOCK (); + + if ((lock && unlock && seterror && geterror) + || !(lock || unlock || seterror || geterror)) + { + lt_dlmutex_lock_func = lock; + lt_dlmutex_unlock_func = unlock; + lt_dlmutex_geterror_func = geterror; + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS)); + ++errors; + } + + /* Use the old unlock() callback we saved earlier, if any. Otherwise + record any errors using internal storage. */ + if (old_unlock) + (*old_unlock) (); + + /* Return the number of errors encountered during the execution of + this function. */ + return errors; +} + + + + +/* --- ERROR HANDLING --- */ + + +static const char **user_error_strings = 0; +static int errorcount = LT_ERROR_MAX; + +int +lt_dladderror (diagnostic) + const char *diagnostic; +{ + int errindex = 0; + int result = -1; + const char **temp = (const char **) 0; + + assert (diagnostic); + + LT_DLMUTEX_LOCK (); + + errindex = errorcount - LT_ERROR_MAX; + temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); + if (temp) + { + user_error_strings = temp; + user_error_strings[errindex] = diagnostic; + result = errorcount++; + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +int +lt_dlseterror (errindex) + int errindex; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + if (errindex >= errorcount || errindex < 0) + { + /* Ack! Error setting the error message! */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); + ++errors; + } + else if (errindex < LT_ERROR_MAX) + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]); + } + else + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static lt_ptr +lt_emalloc (size) + size_t size; +{ + lt_ptr mem = lt_dlmalloc (size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static lt_ptr +lt_erealloc (addr, size) + lt_ptr addr; + size_t size; +{ + lt_ptr mem = lt_dlrealloc (addr, size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +static char * +lt_estrdup (str) + const char *str; +{ + char *copy = strdup (str); + if (LT_STRLEN (str) && !copy) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return copy; +} + + + + +/* --- DLOPEN() INTERFACE LOADER --- */ + + +#if HAVE_LIBDL + +/* dynamic linking with dlopen/dlsym */ + +#if HAVE_DLFCN_H +# include +#endif + +#if HAVE_SYS_DL_H +# include +#endif + +#ifdef RTLD_GLOBAL +# define LT_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_GLOBAL DL_GLOBAL +# endif +#endif /* !RTLD_GLOBAL */ +#ifndef LT_GLOBAL +# define LT_GLOBAL 0 +#endif /* !LT_GLOBAL */ + +/* We may have to define LT_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_LAZY_OR_NOW DL_LAZY +# endif +# endif /* !RTLD_LAZY */ +#endif +#ifndef LT_LAZY_OR_NOW +# ifdef RTLD_NOW +# define LT_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_LAZY_OR_NOW DL_NOW +# endif +# endif /* !RTLD_NOW */ +#endif +#ifndef LT_LAZY_OR_NOW +# define LT_LAZY_OR_NOW 0 +#endif /* !LT_LAZY_OR_NOW */ + +#if HAVE_DLERROR +# define DLERROR(arg) dlerror () +#else +# define DLERROR(arg) LT_DLSTRERROR (arg) +#endif + +static lt_module +sys_dl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW); + + if (!module) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN)); + } + + return module; +} + +static int +sys_dl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dlclose (module) != 0) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_dl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dlsym (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dl = + { +# ifdef NEED_USCORE + "_", +# else + 0, +# endif + sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 }; + + +#endif /* HAVE_LIBDL */ + + + +/* --- SHL_LOAD() INTERFACE LOADER --- */ + +#if HAVE_SHL_LOAD + +/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */ + +#ifdef HAVE_DL_H +# include +#endif + +/* some flags are missing on some systems, so we provide + * harmless defaults. + * + * Mandatory: + * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. + * BIND_DEFERRED - Delay code symbol resolution until actual reference. + * + * Optionally: + * BIND_FIRST - Place the library at the head of the symbol search + * order. + * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all + * unsatisfied symbols as fatal. This flag allows + * binding of unsatisfied code symbols to be deferred + * until use. + * [Perl: For certain libraries, like DCE, deferred + * binding often causes run time problems. Adding + * BIND_NONFATAL to BIND_IMMEDIATE still allows + * unresolved references in situations like this.] + * BIND_NOSTART - Do not call the initializer for the shared library + * when the library is loaded, nor on a future call to + * shl_unload(). + * BIND_VERBOSE - Print verbose messages concerning possible + * unsatisfied symbols. + * + * hp9000s700/hp9000s800: + * BIND_RESTRICTED - Restrict symbols visible by the library to those + * present at library load time. + * DYNAMIC_PATH - Allow the loader to dynamically search for the + * library specified by the path argument. + */ + +#ifndef DYNAMIC_PATH +# define DYNAMIC_PATH 0 +#endif +#ifndef BIND_RESTRICTED +# define BIND_RESTRICTED 0 +#endif + +#define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) + +static lt_module +sys_shl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + static shl_t self = (shl_t) 0; + lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); + + /* Since searching for a symbol against a NULL module handle will also + look in everything else that was already loaded and exported with + the -E compiler flag, we always cache a handle saved before any + modules are loaded. */ + if (!self) + { + lt_ptr address; + shl_findsym (&self, "main", TYPE_UNDEFINED, &address); + } + + if (!filename) + { + module = self; + } + else + { + module = shl_load (filename, LT_BIND_FLAGS, 0L); + + if (!module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + } + } + + return module; +} + +static int +sys_shl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (module && (shl_unload ((shl_t) (module)) != 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_shl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + + /* sys_shl_open should never return a NULL module handle */ + if (module == (lt_module) 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + } + else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address)) + { + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + } + + return address; +} + +static struct lt_user_dlloader sys_shl = { + 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 +}; + +#endif /* HAVE_SHL_LOAD */ + + + + +/* --- LOADLIBRARY() INTERFACE LOADER --- */ + +#ifdef __WINDOWS__ + +/* dynamic linking for Win32 */ + +#include + +/* Forward declaration; required to implement handle search below. */ +static lt_dlhandle handles; + +static lt_module +sys_wll_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlhandle cur; + lt_module module = 0; + const char *errormsg = 0; + char *searchname = 0; + char *ext; + char self_name_buf[MAX_PATH]; + + if (!filename) + { + /* Get the name of main module */ + *self_name_buf = 0; + GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf)); + filename = ext = self_name_buf; + } + else + { + ext = strrchr (filename, '.'); + } + + if (ext) + { + /* FILENAME already has an extension. */ + searchname = lt_estrdup (filename); + } + else + { + /* Append a `.' to stop Windows from adding an + implicit `.dll' extension. */ + searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename)); + if (searchname) + sprintf (searchname, "%s.", filename); + } + if (!searchname) + return 0; + + { + /* Silence dialog from LoadLibrary on some failures. + No way to get the error mode, but to set it, + so set it twice to preserve any previous flags. */ + UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS); + SetErrorMode(errormode | SEM_FAILCRITICALERRORS); + +#if defined(__CYGWIN__) + { + char wpath[MAX_PATH]; + cygwin_conv_to_full_win32_path (searchname, wpath); + module = LoadLibrary (wpath); + } +#else + module = LoadLibrary (searchname); +#endif + + /* Restore the error mode. */ + SetErrorMode(errormode); + } + + LT_DLFREE (searchname); + + /* libltdl expects this function to fail if it is unable + to physically load the library. Sadly, LoadLibrary + will search the loaded libraries for a match and return + one of them if the path search load fails. + + We check whether LoadLibrary is returning a handle to + an already loaded module, and simulate failure if we + find one. */ + LT_DLMUTEX_LOCK (); + cur = handles; + while (cur) + { + if (!cur->module) + { + cur = 0; + break; + } + + if (cur->module == module) + { + break; + } + + cur = cur->next; + } + LT_DLMUTEX_UNLOCK (); + + if (cur || !module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + module = 0; + } + + return module; +} + +static int +sys_wll_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (FreeLibrary(module) == 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_wll_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = GetProcAddress (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_wll = { + 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 +}; + +#endif /* __WINDOWS__ */ + + + + +/* --- LOAD_ADD_ON() INTERFACE LOADER --- */ + + +#ifdef __BEOS__ + +/* dynamic linking for BeOS */ + +#include + +static lt_module +sys_bedl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + image_id image = 0; + + if (filename) + { + image = load_add_on (filename); + } + else + { + image_info info; + int32 cookie = 0; + if (get_next_image_info (0, &cookie, &info) == B_OK) + image = load_add_on (info.name); + } + + if (image <= 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + image = 0; + } + + return (lt_module) image; +} + +static int +sys_bedl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (unload_add_on ((image_id) module) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_bedl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + image_id image = (image_id) module; + + if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + address = 0; + } + + return address; +} + +static struct lt_user_dlloader sys_bedl = { + 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 +}; + +#endif /* __BEOS__ */ + + + + +/* --- DLD_LINK() INTERFACE LOADER --- */ + + +#if HAVE_DLD + +/* dynamic linking with dld */ + +#if HAVE_DLD_H +#include +#endif + +static lt_module +sys_dld_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = strdup (filename); + + if (dld_link (filename) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLFREE (module); + module = 0; + } + + return module; +} + +static int +sys_dld_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dld_unlink_by_file ((char*)(module), 1) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + else + { + LT_DLFREE (module); + } + + return errors; +} + +static lt_ptr +sys_dld_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dld_get_func (symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dld = { + 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 +}; + +#endif /* HAVE_DLD */ + +/* --- DYLD() MACOSX/DARWIN INTERFACE LOADER --- */ +#if HAVE_DYLD + + +#if HAVE_MACH_O_DYLD_H +#if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__) +/* Is this correct? Does it still function properly? */ +#define __private_extern__ extern +#endif +# include +#endif +#include + +/* We have to put some stuff here that isn't in older dyld.h files */ +#ifndef ENUM_DYLD_BOOL +# define ENUM_DYLD_BOOL +# undef FALSE +# undef TRUE + enum DYLD_BOOL { + FALSE, + TRUE + }; +#endif +#ifndef LC_REQ_DYLD +# define LC_REQ_DYLD 0x80000000 +#endif +#ifndef LC_LOAD_WEAK_DYLIB +# define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) +#endif +static const struct mach_header * (*ltdl_NSAddImage)(const char *image_name, unsigned long options) = 0; +static NSSymbol (*ltdl_NSLookupSymbolInImage)(const struct mach_header *image,const char *symbolName, unsigned long options) = 0; +static enum DYLD_BOOL (*ltdl_NSIsSymbolNameDefinedInImage)(const struct mach_header *image, const char *symbolName) = 0; +static enum DYLD_BOOL (*ltdl_NSMakePrivateModulePublic)(NSModule module) = 0; + +#ifndef NSADDIMAGE_OPTION_NONE +#define NSADDIMAGE_OPTION_NONE 0x0 +#endif +#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR +#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 +#endif +#ifndef NSADDIMAGE_OPTION_WITH_SEARCHING +#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 +#endif +#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED +#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 +#endif +#ifndef NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME +#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 +#endif +#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR +#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 +#endif + + +static const char * +lt_int_dyld_error(othererror) + char* othererror; +{ +/* return the dyld error string, or the passed in error string if none */ + NSLinkEditErrors ler; + int lerno; + const char *errstr; + const char *file; + NSLinkEditError(&ler,&lerno,&file,&errstr); + if (!errstr || !strlen(errstr)) errstr = othererror; + return errstr; +} + +static const struct mach_header * +lt_int_dyld_get_mach_header_from_nsmodule(module) + NSModule module; +{ +/* There should probably be an apple dyld api for this */ + int i=_dyld_image_count(); + int j; + const char *modname=NSNameOfModule(module); + const struct mach_header *mh=NULL; + if (!modname) return NULL; + for (j = 0; j < i; j++) + { + if (!strcmp(_dyld_get_image_name(j),modname)) + { + mh=_dyld_get_image_header(j); + break; + } + } + return mh; +} + +static const char* lt_int_dyld_lib_install_name(mh) + const struct mach_header *mh; +{ +/* NSAddImage is also used to get the loaded image, but it only works if the lib + is installed, for uninstalled libs we need to check the install_names against + each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a + different lib was loaded as a result +*/ + int j; + struct load_command *lc; + unsigned long offset = sizeof(struct mach_header); + const char* retStr=NULL; + for (j = 0; j < mh->ncmds; j++) + { + lc = (struct load_command*)(((unsigned long)mh) + offset); + if (LC_ID_DYLIB == lc->cmd) + { + retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc); + } + offset += lc->cmdsize; + } + return retStr; +} + +static const struct mach_header * +lt_int_dyld_match_loaded_lib_by_install_name(const char *name) +{ + int i=_dyld_image_count(); + int j; + const struct mach_header *mh=NULL; + const char *id=NULL; + for (j = 0; j < i; j++) + { + id=lt_int_dyld_lib_install_name(_dyld_get_image_header(j)); + if ((id) && (!strcmp(id,name))) + { + mh=_dyld_get_image_header(j); + break; + } + } + return mh; +} + +static NSSymbol +lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh) + const char *symbol; + const struct mach_header *mh; +{ + /* Safe to assume our mh is good */ + int j; + struct load_command *lc; + unsigned long offset = sizeof(struct mach_header); + NSSymbol retSym = 0; + const struct mach_header *mh1; + if ((ltdl_NSLookupSymbolInImage) && NSIsSymbolNameDefined(symbol) ) + { + for (j = 0; j < mh->ncmds; j++) + { + lc = (struct load_command*)(((unsigned long)mh) + offset); + if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) + { + mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc)); + if (!mh1) + { + /* Maybe NSAddImage can find it */ + mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset + + (unsigned long)lc), + NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED + + NSADDIMAGE_OPTION_WITH_SEARCHING + + NSADDIMAGE_OPTION_RETURN_ON_ERROR ); + } + if (mh1) + { + retSym = ltdl_NSLookupSymbolInImage(mh1, + symbol, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW + | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR + ); + if (retSym) break; + } + } + offset += lc->cmdsize; + } + } + return retSym; +} + +static int +sys_dyld_init() +{ + int retCode = 0; + int err = 0; + if (!_dyld_present()) { + retCode=1; + } + else { + err = _dyld_func_lookup("__dyld_NSAddImage",(unsigned long*)<dl_NSAddImage); + err = _dyld_func_lookup("__dyld_NSLookupSymbolInImage",(unsigned long*)<dl_NSLookupSymbolInImage); + err = _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",(unsigned long*)<dl_NSIsSymbolNameDefinedInImage); + err = _dyld_func_lookup("__dyld_NSMakePrivateModulePublic",(unsigned long*)<dl_NSMakePrivateModulePublic); + } + return retCode; +} + +static lt_module +sys_dyld_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = 0; + NSObjectFileImage ofi = 0; + NSObjectFileImageReturnCode ofirc; + + if (!filename) + return (lt_module)-1; + ofirc = NSCreateObjectFileImageFromFile(filename, &ofi); + switch (ofirc) + { + case NSObjectFileImageSuccess: + module = NSLinkModule(ofi, filename, + NSLINKMODULE_OPTION_RETURN_ON_ERROR + | NSLINKMODULE_OPTION_PRIVATE + | NSLINKMODULE_OPTION_BINDNOW); + NSDestroyObjectFileImage(ofi); + if (module) + ltdl_NSMakePrivateModulePublic(module); + break; + case NSObjectFileImageInappropriateFile: + if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) + { + module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + break; + } + default: + LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); + return 0; + } + if (!module) LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); + return module; +} + +static int +sys_dyld_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int retCode = 0; + int flags = 0; + if (module == (lt_module)-1) return 0; +#ifdef __BIG_ENDIAN__ + if (((struct mach_header *)module)->magic == MH_MAGIC) +#else + if (((struct mach_header *)module)->magic == MH_CIGAM) +#endif + { + LT_DLMUTEX_SETERROR("Can not close a dylib"); + retCode = 1; + } + else + { +#if 1 +/* Currently, if a module contains c++ static destructors and it is unloaded, we + get a segfault in atexit(), due to compiler and dynamic loader differences of + opinion, this works around that. +*/ + if ((const struct section *)NULL != + getsectbynamefromheader(lt_int_dyld_get_mach_header_from_nsmodule(module), + "__DATA","__mod_term_func")) + { + flags += NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; + } +#endif +#ifdef __ppc__ + flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; +#endif + if (!NSUnLinkModule(module,flags)) + { + retCode=1; + LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE))); + } + } + + return retCode; +} + +static lt_ptr +sys_dyld_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + NSSymbol *nssym = 0; + void *unused; + const struct mach_header *mh=NULL; + char saveError[256] = "Symbol not found"; + if (module == (lt_module)-1) + { + _dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused); + return address; + } +#ifdef __BIG_ENDIAN__ + if (((struct mach_header *)module)->magic == MH_MAGIC) +#else + if (((struct mach_header *)module)->magic == MH_CIGAM) +#endif + { + if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) + { + mh=module; + if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol)) + { + nssym = ltdl_NSLookupSymbolInImage((struct mach_header*)module, + symbol, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW + | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR + ); + } + } + + } + else { + nssym = NSLookupSymbolInModule(module, symbol); + } + if (!nssym) + { + strncpy(saveError, lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)), 255); + saveError[255] = 0; + if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module); + nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh); + } + if (!nssym) + { + LT_DLMUTEX_SETERROR (saveError); + return NULL; + } + return NSAddressOfSymbol(nssym); +} + +static struct lt_user_dlloader sys_dyld = + { "_", sys_dyld_open, sys_dyld_close, sys_dyld_sym, 0, 0 }; + + +#endif /* HAVE_DYLD */ + + +/* --- DLPREOPEN() INTERFACE LOADER --- */ + + +/* emulate dynamic linking using preloaded_symbols */ + +typedef struct lt_dlsymlists_t +{ + struct lt_dlsymlists_t *next; + const lt_dlsymlist *syms; +} lt_dlsymlists_t; + +static const lt_dlsymlist *default_preloaded_symbols = 0; +static lt_dlsymlists_t *preloaded_symbols = 0; + +static int +presym_init (loader_data) + lt_user_data loader_data; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + preloaded_symbols = 0; + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static int +presym_free_symlists () +{ + lt_dlsymlists_t *lists; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + lt_dlsymlists_t *tmp = lists; + + lists = lists->next; + LT_DLFREE (tmp); + } + preloaded_symbols = 0; + + LT_DLMUTEX_UNLOCK (); + + return 0; +} + +static int +presym_exit (loader_data) + lt_user_data loader_data; +{ + presym_free_symlists (); + return 0; +} + +static int +presym_add_symlist (preloaded) + const lt_dlsymlist *preloaded; +{ + lt_dlsymlists_t *tmp; + lt_dlsymlists_t *lists; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + if (lists->syms == preloaded) + { + goto done; + } + lists = lists->next; + } + + tmp = LT_EMALLOC (lt_dlsymlists_t, 1); + if (tmp) + { + memset (tmp, 0, sizeof(lt_dlsymlists_t)); + tmp->syms = preloaded; + tmp->next = preloaded_symbols; + preloaded_symbols = tmp; + } + else + { + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static lt_module +presym_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlsymlists_t *lists; + lt_module module = (lt_module) 0; + + LT_DLMUTEX_LOCK (); + lists = preloaded_symbols; + + if (!lists) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS)); + goto done; + } + + /* Can't use NULL as the reflective symbol header, as NULL is + used to mark the end of the entire symbol list. Self-dlpreopened + symbols follow this magic number, chosen to be an unlikely + clash with a real module name. */ + if (!filename) + { + filename = "@PROGRAM@"; + } + + while (lists) + { + const lt_dlsymlist *syms = lists->syms; + + while (syms->name) + { + if (!syms->address && strcmp(syms->name, filename) == 0) + { + module = (lt_module) syms; + goto done; + } + ++syms; + } + + lists = lists->next; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + + done: + LT_DLMUTEX_UNLOCK (); + return module; +} + +static int +presym_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + /* Just to silence gcc -Wall */ + module = 0; + return 0; +} + +static lt_ptr +presym_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_dlsymlist *syms = (lt_dlsymlist*) module; + + ++syms; + while (syms->address) + { + if (strcmp(syms->name, symbol) == 0) + { + return syms->address; + } + + ++syms; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + + return 0; +} + +static struct lt_user_dlloader presym = { + 0, presym_open, presym_close, presym_sym, presym_exit, 0 +}; + + + + + +/* --- DYNAMIC MODULE LOADING --- */ + + +/* The type of a function used at each iteration of foreach_dirinpath(). */ +typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + +static int foreach_dirinpath LT_PARAMS((const char *search_path, + const char *base_name, + foreach_callback_func *func, + lt_ptr data1, lt_ptr data2)); + +static int find_file_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + + +static int canonicalize_path LT_PARAMS((const char *path, + char **pcanonical)); +static int argzize_path LT_PARAMS((const char *path, + char **pargz, + size_t *pargz_len)); +static FILE *find_file LT_PARAMS((const char *search_path, + const char *base_name, + char **pdir)); +static lt_dlhandle *find_handle LT_PARAMS((const char *search_path, + const char *base_name, + lt_dlhandle *handle)); +static int find_module LT_PARAMS((lt_dlhandle *handle, + const char *dir, + const char *libdir, + const char *dlname, + const char *old_name, + int installed)); +static int free_vars LT_PARAMS((char *dlname, char *oldname, + char *libdir, char *deplibs)); +static int load_deplibs LT_PARAMS((lt_dlhandle handle, + char *deplibs)); +static int trim LT_PARAMS((char **dest, + const char *str)); +static int try_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int unload_deplibs LT_PARAMS((lt_dlhandle handle)); +static int lt_argz_insert LT_PARAMS((char **pargz, + size_t *pargz_len, + char *before, + const char *entry)); +static int lt_argz_insertinorder LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *entry)); +static int lt_argz_insertdir LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *dirnam, + struct dirent *dp)); +static int lt_dlpath_insertdir LT_PARAMS((char **ppath, + char *before, + const char *dir)); +static int list_files_by_dir LT_PARAMS((const char *dirnam, + char **pargz, + size_t *pargz_len)); +static int file_not_found LT_PARAMS((void)); + +static char *user_search_path= 0; +static lt_dlloader *loaders = 0; +static lt_dlhandle handles = 0; +static int initialized = 0; + +/* Initialize libltdl. */ +int +lt_dlinit () +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* Initialize only at first call. */ + if (++initialized == 1) + { + handles = 0; + user_search_path = 0; /* empty search path */ + +#if HAVE_LIBDL + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen"); +#endif +#if HAVE_SHL_LOAD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen"); +#endif +#ifdef __WINDOWS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen"); +#endif +#ifdef __BEOS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen"); +#endif +#if HAVE_DLD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld"); +#endif +#if HAVE_DYLD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld"); + errors += sys_dyld_init(); +#endif + errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload"); + + if (presym_init (presym.dlloader_data)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER)); + ++errors; + } + else if (errors != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED)); + ++errors; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlpreload (preloaded) + const lt_dlsymlist *preloaded; +{ + int errors = 0; + + if (preloaded) + { + errors = presym_add_symlist (preloaded); + } + else + { + presym_free_symlists(); + + LT_DLMUTEX_LOCK (); + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlpreload_default (preloaded) + const lt_dlsymlist *preloaded; +{ + LT_DLMUTEX_LOCK (); + default_preloaded_symbols = preloaded; + LT_DLMUTEX_UNLOCK (); + return 0; +} + +int +lt_dlexit () +{ + /* shut down libltdl */ + lt_dlloader *loader; + int errors = 0; + + LT_DLMUTEX_LOCK (); + loader = loaders; + + if (!initialized) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN)); + ++errors; + goto done; + } + + /* shut down only at last call. */ + if (--initialized == 0) + { + int level; + + while (handles && LT_DLIS_RESIDENT (handles)) + { + handles = handles->next; + } + + /* close all modules */ + for (level = 1; handles; ++level) + { + lt_dlhandle cur = handles; + int saw_nonresident = 0; + + while (cur) + { + lt_dlhandle tmp = cur; + cur = cur->next; + if (!LT_DLIS_RESIDENT (tmp)) + saw_nonresident = 1; + if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) + { + if (lt_dlclose (tmp)) + { + ++errors; + } + } + } + /* done if only resident modules are left */ + if (!saw_nonresident) + break; + } + + /* close all loaders */ + while (loader) + { + lt_dlloader *next = loader->next; + lt_user_data data = loader->dlloader_data; + if (loader->dlloader_exit && loader->dlloader_exit (data)) + { + ++errors; + } + + LT_DLMEM_REASSIGN (loader, next); + } + loaders = 0; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static int +tryall_dlopen (handle, filename) + lt_dlhandle *handle; + const char *filename; +{ + lt_dlhandle cur; + lt_dlloader *loader; + const char *saved_error; + int errors = 0; + + LT_DLMUTEX_GETERROR (saved_error); + LT_DLMUTEX_LOCK (); + + cur = handles; + loader = loaders; + + /* check whether the module was already opened */ + while (cur) + { + /* try to dlopen the program itself? */ + if (!cur->info.filename && !filename) + { + break; + } + + if (cur->info.filename && filename + && strcmp (cur->info.filename, filename) == 0) + { + break; + } + + cur = cur->next; + } + + if (cur) + { + ++cur->info.ref_count; + *handle = cur; + goto done; + } + + cur = *handle; + if (filename) + { + /* Comment out the check of file permissions using access. + This call seems to always return -1 with error EACCES. + */ + /* We need to catch missing file errors early so that + file_not_found() can detect what happened. + if (access (filename, R_OK) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; + goto done; + } */ + + cur->info.filename = lt_estrdup (filename); + if (!cur->info.filename) + { + ++errors; + goto done; + } + } + else + { + cur->info.filename = 0; + } + + while (loader) + { + lt_user_data data = loader->dlloader_data; + + cur->module = loader->module_open (data, filename); + + if (cur->module != 0) + { + break; + } + loader = loader->next; + } + + if (!loader) + { + LT_DLFREE (cur->info.filename); + ++errors; + goto done; + } + + cur->loader = loader; + LT_DLMUTEX_SETERROR (saved_error); + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static int +tryall_dlopen_module (handle, prefix, dirname, dlname) + lt_dlhandle *handle; + const char *prefix; + const char *dirname; + const char *dlname; +{ + int error = 0; + char *filename = 0; + size_t filename_len = 0; + size_t dirname_len = LT_STRLEN (dirname); + + assert (handle); + assert (dirname); + assert (dlname); +#ifdef LT_DIRSEP_CHAR + /* Only canonicalized names (i.e. with DIRSEP chars already converted) + should make it into this function: */ + assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); +#endif + + if (dirname_len > 0) + if (dirname[dirname_len -1] == '/') + --dirname_len; + filename_len = dirname_len + 1 + LT_STRLEN (dlname); + + /* Allocate memory, and combine DIRNAME and MODULENAME into it. + The PREFIX (if any) is handled below. */ + filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1); + if (!filename) + return 1; + + sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); + + /* Now that we have combined DIRNAME and MODULENAME, if there is + also a PREFIX to contend with, simply recurse with the arguments + shuffled. Otherwise, attempt to open FILENAME as a module. */ + if (prefix) + { + error += tryall_dlopen_module (handle, + (const char *) 0, prefix, filename); + } + else if (tryall_dlopen (handle, filename) != 0) + { + ++error; + } + + LT_DLFREE (filename); + return error; +} + +static int +find_module (handle, dir, libdir, dlname, old_name, installed) + lt_dlhandle *handle; + const char *dir; + const char *libdir; + const char *dlname; + const char *old_name; + int installed; +{ + /* Try to open the old library first; if it was dlpreopened, + we want the preopened version of it, even if a dlopenable + module is available. */ + if (old_name && tryall_dlopen (handle, old_name) == 0) + { + return 0; + } + + /* Try to open the dynamic library. */ + if (dlname) + { + /* try to open the installed module */ + if (installed && libdir) + { + if (tryall_dlopen_module (handle, + (const char *) 0, libdir, dlname) == 0) + return 0; + } + + /* try to open the not-installed module */ + if (!installed) + { + if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0) + return 0; + } + + /* maybe it was moved to another directory */ + { + if (dir && (tryall_dlopen_module (handle, + (const char *) 0, dir, dlname) == 0)) + return 0; + } + } + + return 1; +} + + +static int +canonicalize_path (path, pcanonical) + const char *path; + char **pcanonical; +{ + char *canonical = 0; + + assert (path && *path); + assert (pcanonical); + + canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path)); + if (!canonical) + return 1; + + { + size_t dest = 0; + size_t src; + for (src = 0; path[src] != LT_EOS_CHAR; ++src) + { + /* Path separators are not copied to the beginning or end of + the destination, or if another separator would follow + immediately. */ + if (path[src] == LT_PATHSEP_CHAR) + { + if ((dest == 0) + || (path[1+ src] == LT_PATHSEP_CHAR) + || (path[1+ src] == LT_EOS_CHAR)) + continue; + } + + /* Anything other than a directory separator is copied verbatim. */ + if ((path[src] != '/') +#ifdef LT_DIRSEP_CHAR + && (path[src] != LT_DIRSEP_CHAR) +#endif + ) + { + canonical[dest++] = path[src]; + } + /* Directory separators are converted and copied only if they are + not at the end of a path -- i.e. before a path separator or + NULL terminator. */ + else if ((path[1+ src] != LT_PATHSEP_CHAR) + && (path[1+ src] != LT_EOS_CHAR) +#ifdef LT_DIRSEP_CHAR + && (path[1+ src] != LT_DIRSEP_CHAR) +#endif + && (path[1+ src] != '/')) + { + canonical[dest++] = '/'; + } + } + + /* Add an end-of-string marker at the end. */ + canonical[dest] = LT_EOS_CHAR; + } + + /* Assign new value. */ + *pcanonical = canonical; + + return 0; +} + +static int +argzize_path (path, pargz, pargz_len) + const char *path; + char **pargz; + size_t *pargz_len; +{ + error_t error; + + assert (path); + assert (pargz); + assert (pargz_len); + + if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + + return 1; + } + + return 0; +} + +/* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element + of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns + non-zero or all elements are exhausted. If BASE_NAME is non-NULL, + it is appended to each SEARCH_PATH element before FUNC is called. */ +static int +foreach_dirinpath (search_path, base_name, func, data1, data2) + const char *search_path; + const char *base_name; + foreach_callback_func *func; + lt_ptr data1; + lt_ptr data2; +{ + int result = 0; + int filenamesize = 0; + size_t lenbase = LT_STRLEN (base_name); + size_t argz_len = 0; + char *argz = 0; + char *filename = 0; + char *canonical = 0; + + LT_DLMUTEX_LOCK (); + + if (!search_path || !*search_path) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + goto cleanup; + } + + if (canonicalize_path (search_path, &canonical) != 0) + goto cleanup; + + if (argzize_path (canonical, &argz, &argz_len) != 0) + goto cleanup; + + { + char *dir_name = 0; + while ((dir_name = argz_next (argz, argz_len, dir_name))) + { + size_t lendir = LT_STRLEN (dir_name); + + if (lendir +1 +lenbase >= filenamesize) + { + LT_DLFREE (filename); + filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */ + filename = LT_EMALLOC (char, filenamesize); + if (!filename) + goto cleanup; + } + + assert (filenamesize > lendir); + strcpy (filename, dir_name); + + if (base_name && *base_name) + { + if (filename[lendir -1] != '/') + filename[lendir++] = '/'; + strcpy (filename +lendir, base_name); + } + + if ((result = (*func) (filename, data1, data2))) + { + break; + } + } + } + + cleanup: + LT_DLFREE (argz); + LT_DLFREE (canonical); + LT_DLFREE (filename); + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +/* If FILEPATH can be opened, store the name of the directory component + in DATA1, and the opened FILE* structure address in DATA2. Otherwise + DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ +static int +find_file_callback (filename, data1, data2) + char *filename; + lt_ptr data1; + lt_ptr data2; +{ + char **pdir = (char **) data1; + FILE **pfile = (FILE **) data2; + int is_done = 0; + + assert (filename && *filename); + assert (pdir); + assert (pfile); + + if ((*pfile = fopen (filename, LT_READTEXT_MODE))) + { + char *dirend = strrchr (filename, '/'); + + if (dirend > filename) + *dirend = LT_EOS_CHAR; + + LT_DLFREE (*pdir); + *pdir = lt_estrdup (filename); + is_done = (*pdir == 0) ? -1 : 1; + } + + return is_done; +} + +static FILE * +find_file (search_path, base_name, pdir) + const char *search_path; + const char *base_name; + char **pdir; +{ + FILE *file = 0; + + foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); + + return file; +} + +static int +find_handle_callback (filename, data, ignored) + char *filename; + lt_ptr data; + lt_ptr ignored; +{ + lt_dlhandle *handle = (lt_dlhandle *) data; + int notfound = access (filename, R_OK); + + /* Bail out if file cannot be read... */ + if (notfound) + return 0; + + /* Try to dlopen the file, but do not continue searching in any + case. */ + if (tryall_dlopen (handle, filename) != 0) + *handle = 0; + + return 1; +} + +/* If HANDLE was found return it, otherwise return 0. If HANDLE was + found but could not be opened, *HANDLE will be set to 0. */ +static lt_dlhandle * +find_handle (search_path, base_name, handle) + const char *search_path; + const char *base_name; + lt_dlhandle *handle; +{ + if (!search_path) + return 0; + + if (!foreach_dirinpath (search_path, base_name, find_handle_callback, + handle, 0)) + return 0; + + return handle; +} + +static int +load_deplibs (handle, deplibs) + lt_dlhandle handle; + char *deplibs; +{ +#if LTDL_DLOPEN_DEPLIBS + char *p, *save_search_path = 0; + int depcount = 0; + int i; + char **names = 0; +#endif + int errors = 0; + + handle->depcount = 0; + +#if LTDL_DLOPEN_DEPLIBS + if (!deplibs) + { + return errors; + } + ++errors; + + LT_DLMUTEX_LOCK (); + if (user_search_path) + { + save_search_path = lt_estrdup (user_search_path); + if (!save_search_path) + goto cleanup; + } + + /* extract search paths and count deplibs */ + p = deplibs; + while (*p) + { + if (!isspace ((int) *p)) + { + char *end = p+1; + while (*end && !isspace((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) + { + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (lt_dladdsearchdir(p+2)) + { + goto cleanup; + } + *end = save; + } + else + { + ++depcount; + } + + p = end; + } + else + { + ++p; + } + } + + if (!depcount) + { + errors = 0; + goto cleanup; + } + + names = LT_EMALLOC (char *, depcount * sizeof (char*)); + if (!names) + goto cleanup; + + /* now only extract the actual deplibs */ + depcount = 0; + p = deplibs; + while (*p) + { + if (isspace ((int) *p)) + { + ++p; + } + else + { + char *end = p+1; + while (*end && !isspace ((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) + { + char *name; + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (strncmp(p, "-l", 2) == 0) + { + size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); + name = LT_EMALLOC (char, 1+ name_len); + if (name) + sprintf (name, "lib%s", p+2); + } + else + name = lt_estrdup(p); + + if (!name) + goto cleanup_names; + + names[depcount++] = name; + *end = save; + } + p = end; + } + } + + /* load the deplibs (in reverse order) + At this stage, don't worry if the deplibs do not load correctly, + they may already be statically linked into the loading application + for instance. There will be a more enlightening error message + later on if the loaded module cannot resolve all of its symbols. */ + if (depcount) + { + int j = 0; + + handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount); + if (!handle->deplibs) + goto cleanup; + + for (i = 0; i < depcount; ++i) + { + handle->deplibs[j] = lt_dlopenext(names[depcount-1-i]); + if (handle->deplibs[j]) + { + ++j; + } + } + + handle->depcount = j; /* Number of successfully loaded deplibs */ + errors = 0; + } + + cleanup_names: + for (i = 0; i < depcount; ++i) + { + LT_DLFREE (names[i]); + } + + cleanup: + LT_DLFREE (names); + /* restore the old search path */ + if (user_search_path) { + LT_DLFREE (user_search_path); + user_search_path = save_search_path; + } + LT_DLMUTEX_UNLOCK (); + +#endif + + return errors; +} + +static int +unload_deplibs (handle) + lt_dlhandle handle; +{ + int i; + int errors = 0; + + if (handle->depcount) + { + for (i = 0; i < handle->depcount; ++i) + { + if (!LT_DLIS_RESIDENT (handle->deplibs[i])) + { + errors += lt_dlclose (handle->deplibs[i]); + } + } + } + + return errors; +} + +static int +trim (dest, str) + char **dest; + const char *str; +{ + /* remove the leading and trailing "'" from str + and store the result in dest */ + const char *end = strrchr (str, '\''); + size_t len = LT_STRLEN (str); + char *tmp; + + LT_DLFREE (*dest); + + if (!end) + return 1; + + if (len > 3 && str[0] == '\'') + { + tmp = LT_EMALLOC (char, end - str); + if (!tmp) + return 1; + + strncpy(tmp, &str[1], (end - str) - 1); + tmp[len-3] = LT_EOS_CHAR; + *dest = tmp; + } + else + { + *dest = 0; + } + + return 0; +} + +static int +free_vars (dlname, oldname, libdir, deplibs) + char *dlname; + char *oldname; + char *libdir; + char *deplibs; +{ + LT_DLFREE (dlname); + LT_DLFREE (oldname); + LT_DLFREE (libdir); + LT_DLFREE (deplibs); + + return 0; +} + +static int +try_dlopen (phandle, filename) + lt_dlhandle *phandle; + const char *filename; +{ + const char * ext = 0; + const char * saved_error = 0; + char * canonical = 0; + char * base_name = 0; + char * dir = 0; + char * name = 0; + int errors = 0; + lt_dlhandle newhandle; + + assert (phandle); + assert (*phandle == 0); + + LT_DLMUTEX_GETERROR (saved_error); + + /* dlopen self? */ + if (!filename) + { + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + return 1; + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* lt_dlclose()ing yourself is very bad! Disallow it. */ + LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG); + + if (tryall_dlopen (&newhandle, 0) != 0) + { + LT_DLFREE (*phandle); + return 1; + } + + goto register_handle; + } + + assert (filename && *filename); + + /* Doing this immediately allows internal functions to safely + assume only canonicalized paths are passed. */ + if (canonicalize_path (filename, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + /* If the canonical module name is a path (relative or absolute) + then split it into a directory part and a name part. */ + base_name = strrchr (canonical, '/'); + if (base_name) + { + size_t dirlen = (1+ base_name) - canonical; + + dir = LT_EMALLOC (char, 1+ dirlen); + if (!dir) + { + ++errors; + goto cleanup; + } + + strncpy (dir, canonical, dirlen); + dir[dirlen] = LT_EOS_CHAR; + + ++base_name; + } + else + base_name = canonical; + + assert (base_name && *base_name); + + /* Check whether we are opening a libtool module (.la extension). */ + ext = strrchr (base_name, '.'); + if (ext && strcmp (ext, archive_ext) == 0) + { + /* this seems to be a libtool module */ + FILE * file = 0; + char * dlname = 0; + char * old_name = 0; + char * libdir = 0; + char * deplibs = 0; + char * line = 0; + size_t line_len; + + /* if we can't find the installed flag, it is probably an + installed libtool archive, produced with an old version + of libtool */ + int installed = 1; + + /* extract the module name from the file name */ + name = LT_EMALLOC (char, ext - base_name + 1); + if (!name) + { + ++errors; + goto cleanup; + } + + /* canonicalize the module name */ + { + size_t i; + for (i = 0; i < ext - base_name; ++i) + { + if (isalnum ((int)(base_name[i]))) + { + name[i] = base_name[i]; + } + else + { + name[i] = '_'; + } + } + name[ext - base_name] = LT_EOS_CHAR; + } + + /* Now try to open the .la file. If there is no directory name + component, try to find it first in user_search_path and then other + prescribed paths. Otherwise (or in any case if the module was not + yet found) try opening just the module name as passed. */ + if (!dir) + { + const char *search_path; + + LT_DLMUTEX_LOCK (); + search_path = user_search_path; + if (search_path) + file = find_file (user_search_path, base_name, &dir); + LT_DLMUTEX_UNLOCK (); + + if (!file) + { + search_path = getenv (LTDL_SEARCHPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!file) + { + search_path = getenv (LTDL_SHLIBPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!file && sys_search_path) + { + file = find_file (sys_search_path, base_name, &dir); + } +#endif + } + if (!file) + { + file = fopen (filename, LT_READTEXT_MODE); + } + + /* If we didn't find the file by now, it really isn't there. Set + the status flag, and bail out. */ + if (!file) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; + goto cleanup; + } + + line_len = LT_FILENAME_MAX; + line = LT_EMALLOC (char, line_len); + if (!line) + { + fclose (file); + ++errors; + goto cleanup; + } + + /* read the .la file */ + while (!feof (file)) + { + if (!fgets (line, (int) line_len, file)) + { + break; + } + + /* Handle the case where we occasionally need to read a line + that is longer than the initial buffer size. */ + while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file))) + { + line = LT_DLREALLOC (char, line, line_len *2); + if (!fgets (&line[line_len -1], (int) line_len +1, file)) + { + break; + } + line_len *= 2; + } + + if (line[0] == '\n' || line[0] == '#') + { + continue; + } + +#undef STR_DLNAME +#define STR_DLNAME "dlname=" + if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) + { + errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]); + } + +#undef STR_OLD_LIBRARY +#define STR_OLD_LIBRARY "old_library=" + else if (strncmp (line, STR_OLD_LIBRARY, + sizeof (STR_OLD_LIBRARY) - 1) == 0) + { + errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); + } +#undef STR_LIBDIR +#define STR_LIBDIR "libdir=" + else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) + { + errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]); + } + +#undef STR_DL_DEPLIBS +#define STR_DL_DEPLIBS "dependency_libs=" + else if (strncmp (line, STR_DL_DEPLIBS, + sizeof (STR_DL_DEPLIBS) - 1) == 0) + { + errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); + } + else if (strcmp (line, "installed=yes\n") == 0) + { + installed = 1; + } + else if (strcmp (line, "installed=no\n") == 0) + { + installed = 0; + } + +#undef STR_LIBRARY_NAMES +#define STR_LIBRARY_NAMES "library_names=" + else if (! dlname && strncmp (line, STR_LIBRARY_NAMES, + sizeof (STR_LIBRARY_NAMES) - 1) == 0) + { + char *last_libname; + errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); + if (!errors + && dlname + && (last_libname = strrchr (dlname, ' ')) != 0) + { + last_libname = lt_estrdup (last_libname + 1); + if (!last_libname) + { + ++errors; + goto cleanup; + } + LT_DLMEM_REASSIGN (dlname, last_libname); + } + } + + if (errors) + break; + } + + fclose (file); + LT_DLFREE (line); + + /* allocate the handle */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + ++errors; + + if (errors) + { + free_vars (dlname, old_name, libdir, deplibs); + LT_DLFREE (*phandle); + goto cleanup; + } + + assert (*phandle); + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + if (load_deplibs (*phandle, deplibs) == 0) + { + newhandle = *phandle; + /* find_module may replace newhandle */ + if (find_module (&newhandle, dir, libdir, dlname, old_name, installed)) + { + unload_deplibs (*phandle); + ++errors; + } + } + else + { + ++errors; + } + + free_vars (dlname, old_name, libdir, deplibs); + if (errors) + { + LT_DLFREE (*phandle); + goto cleanup; + } + + if (*phandle != newhandle) + { + unload_deplibs (*phandle); + } + } + else + { + /* not a libtool module */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + { + ++errors; + goto cleanup; + } + + memset (*phandle, 0, sizeof (struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* If the module has no directory name component, try to find it + first in user_search_path and then other prescribed paths. + Otherwise (or in any case if the module was not yet found) try + opening just the module name as passed. */ + if ((dir || (!find_handle (user_search_path, base_name, &newhandle) + && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, + &newhandle) +#ifdef LTDL_SHLIBPATH_VAR + && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name, + &newhandle) +#endif +#ifdef LTDL_SYSSEARCHPATH + && !find_handle (sys_search_path, base_name, &newhandle) +#endif + ))) + { + if (tryall_dlopen (&newhandle, filename) != 0) + { + newhandle = NULL; + } + } + + if (!newhandle) + { + LT_DLFREE (*phandle); + ++errors; + goto cleanup; + } + } + + register_handle: + LT_DLMEM_REASSIGN (*phandle, newhandle); + + if ((*phandle)->info.ref_count == 0) + { + (*phandle)->info.ref_count = 1; + LT_DLMEM_REASSIGN ((*phandle)->info.name, name); + + LT_DLMUTEX_LOCK (); + (*phandle)->next = handles; + handles = *phandle; + LT_DLMUTEX_UNLOCK (); + } + + LT_DLMUTEX_SETERROR (saved_error); + + cleanup: + LT_DLFREE (dir); + LT_DLFREE (name); + LT_DLFREE (canonical); + + return errors; +} + +lt_dlhandle +lt_dlopen (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + + /* Just incase we missed a code path in try_dlopen() that reports + an error, but forgets to reset handle... */ + if (try_dlopen (&handle, filename) != 0) + return 0; + + return handle; +} + +/* If the last error messge store was `FILE_NOT_FOUND', then return + non-zero. */ +static int +file_not_found () +{ + const char *error = 0; + + LT_DLMUTEX_GETERROR (error); + if (error == LT_DLSTRERROR (FILE_NOT_FOUND)) + return 1; + + return 0; +} + +/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to + open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, + and if a file is still not found try again with SHLIB_EXT appended + instead. */ +lt_dlhandle +lt_dlopenext (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + char * tmp = 0; + char * ext = 0; + size_t len; + int errors = 0; + + if (!filename) + { + return lt_dlopen (filename); + } + + assert (filename); + + len = LT_STRLEN (filename); + ext = strrchr (filename, '.'); + + /* If FILENAME already bears a suitable extension, there is no need + to try appending additional extensions. */ + if (ext && ((strcmp (ext, archive_ext) == 0) +#ifdef LTDL_SHLIB_EXT + || (strcmp (ext, shlib_ext) == 0) +#endif + )) + { + return lt_dlopen (filename); + } + + /* First try appending ARCHIVE_EXT. */ + tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1); + if (!tmp) + return 0; + + strcpy (tmp, filename); + strcat (tmp, archive_ext); + errors = try_dlopen (&handle, tmp); + + /* If we found FILENAME, stop searching -- whether we were able to + load the file as a module or not. If the file exists but loading + failed, it is better to return an error message here than to + report FILE_NOT_FOUND when the alternatives (foo.so etc) are not + in the module search path. */ + if (handle || ((errors > 0) && !file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } + +#ifdef LTDL_SHLIB_EXT + /* Try appending SHLIB_EXT. */ + if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) + { + LT_DLFREE (tmp); + tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1); + if (!tmp) + return 0; + + strcpy (tmp, filename); + } + else + { + tmp[len] = LT_EOS_CHAR; + } + + strcat(tmp, shlib_ext); + errors = try_dlopen (&handle, tmp); + + /* As before, if the file was found but loading failed, return now + with the current error message. */ + if (handle || ((errors > 0) && !file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } +#endif + + /* Still here? Then we really did fail to locate any of the file + names we tried. */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + LT_DLFREE (tmp); + return 0; +} + + +static int +lt_argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + error_t error; + + /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, + pargz_len, NULL, entry) failed with EINVAL. */ + if (before) + error = argz_insert (pargz, pargz_len, before, entry); + else + error = argz_append (pargz, pargz_len, entry, 1 + LT_STRLEN (entry)); + + if (error) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + return 1; + } + + return 0; +} + +static int +lt_argz_insertinorder (pargz, pargz_len, entry) + char **pargz; + size_t *pargz_len; + const char *entry; +{ + char *before = 0; + + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + if (*pargz) + while ((before = argz_next (*pargz, *pargz_len, before))) + { + int cmp = strcmp (entry, before); + + if (cmp < 0) break; + if (cmp == 0) return 0; /* No duplicates! */ + } + + return lt_argz_insert (pargz, pargz_len, before, entry); +} + +static int +lt_argz_insertdir (pargz, pargz_len, dirnam, dp) + char **pargz; + size_t *pargz_len; + const char *dirnam; + struct dirent *dp; +{ + char *buf = 0; + size_t buf_len = 0; + char *end = 0; + size_t end_offset = 0; + size_t dir_len = 0; + int errors = 0; + + assert (pargz); + assert (pargz_len); + assert (dp); + + dir_len = LT_STRLEN (dirnam); + end = dp->d_name + LT_D_NAMLEN(dp); + + /* Ignore version numbers. */ + { + char *p; + for (p = end; p -1 > dp->d_name; --p) + if (strchr (".0123456789", p[-1]) == 0) + break; + + if (*p == '.') + end = p; + } + + /* Ignore filename extension. */ + { + char *p; + for (p = end -1; p > dp->d_name; --p) + if (*p == '.') + { + end = p; + break; + } + } + + /* Prepend the directory name. */ + end_offset = end - dp->d_name; + buf_len = dir_len + 1+ end_offset; + buf = LT_EMALLOC (char, 1+ buf_len); + if (!buf) + return ++errors; + + assert (buf); + + strcpy (buf, dirnam); + strcat (buf, "/"); + strncat (buf, dp->d_name, end_offset); + buf[buf_len] = LT_EOS_CHAR; + + /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ + if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) + ++errors; + + LT_DLFREE (buf); + + return errors; +} + +static int +list_files_by_dir (dirnam, pargz, pargz_len) + const char *dirnam; + char **pargz; + size_t *pargz_len; +{ + DIR *dirp = 0; + int errors = 0; + + assert (dirnam && *dirnam); + assert (pargz); + assert (pargz_len); + assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); + + dirp = opendir (dirnam); + if (dirp) + { + struct dirent *dp = 0; + + while ((dp = readdir (dirp))) + if (dp->d_name[0] != '.') + if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) + { + ++errors; + break; + } + + closedir (dirp); + } + else + ++errors; + + return errors; +} + + +/* If there are any files in DIRNAME, call the function passed in + DATA1 (with the name of each file and DATA2 as arguments). */ +static int +foreachfile_callback (dirname, data1, data2) + char *dirname; + lt_ptr data1; + lt_ptr data2; +{ + int (*func) LT_PARAMS((const char *filename, lt_ptr data)) + = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1; + + int is_done = 0; + char *argz = 0; + size_t argz_len = 0; + + if (list_files_by_dir (dirname, &argz, &argz_len) != 0) + goto cleanup; + if (!argz) + goto cleanup; + + { + char *filename = 0; + while ((filename = argz_next (argz, argz_len, filename))) + if ((is_done = (*func) (filename, data2))) + break; + } + + cleanup: + LT_DLFREE (argz); + + return is_done; +} + + +/* Call FUNC for each unique extensionless file in SEARCH_PATH, along + with DATA. The filenames passed to FUNC would be suitable for + passing to lt_dlopenext. The extensions are stripped so that + individual modules do not generate several entries (e.g. libfoo.la, + libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, + then the same directories that lt_dlopen would search are examined. */ +int +lt_dlforeachfile (search_path, func, data) + const char *search_path; + int (*func) LT_PARAMS ((const char *filename, lt_ptr data)); + lt_ptr data; +{ + int is_done = 0; + + if (search_path) + { + /* If a specific path was passed, search only the directories + listed in it. */ + is_done = foreach_dirinpath (search_path, 0, + foreachfile_callback, func, data); + } + else + { + /* Otherwise search the default paths. */ + is_done = foreach_dirinpath (user_search_path, 0, + foreachfile_callback, func, data); + if (!is_done) + { + is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0, + foreachfile_callback, func, data); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0, + foreachfile_callback, func, data); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0, + foreachfile_callback, func, data); + } +#endif + } + + return is_done; +} + +int +lt_dlclose (handle) + lt_dlhandle handle; +{ + lt_dlhandle cur, last; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* check whether the handle is valid */ + last = cur = handles; + while (cur && handle != cur) + { + last = cur; + cur = cur->next; + } + + if (!cur) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + goto done; + } + + handle->info.ref_count--; + + /* Note that even with resident modules, we must track the ref_count + correctly incase the user decides to reset the residency flag + later (even though the API makes no provision for that at the + moment). */ + if (handle->info.ref_count <= 0 && !LT_DLIS_RESIDENT (handle)) + { + lt_user_data data = handle->loader->dlloader_data; + + if (handle != handles) + { + last->next = handle->next; + } + else + { + handles = handle->next; + } + + errors += handle->loader->module_close (data, handle->module); + errors += unload_deplibs(handle); + + /* It is up to the callers to free the data itself. */ + LT_DLFREE (handle->caller_data); + + LT_DLFREE (handle->info.filename); + LT_DLFREE (handle->info.name); + LT_DLFREE (handle); + + goto done; + } + + if (LT_DLIS_RESIDENT (handle)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE)); + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_ptr +lt_dlsym (handle, symbol) + lt_dlhandle handle; + const char *symbol; +{ + size_t lensym; + char lsym[LT_SYMBOL_LENGTH]; + char *sym; + lt_ptr address; + lt_user_data data; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + if (!symbol) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + return 0; + } + + lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix) + + LT_STRLEN (handle->info.name); + + if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) + { + sym = lsym; + } + else + { + sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); + if (!sym) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); + return 0; + } + } + + data = handle->loader->dlloader_data; + if (handle->info.name) + { + const char *saved_error; + + LT_DLMUTEX_GETERROR (saved_error); + + /* this is a libtool module */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, handle->info.name); + } + else + { + strcpy(sym, handle->info.name); + } + + strcat(sym, "_LTX_"); + strcat(sym, symbol); + + /* try "modulename_LTX_symbol" */ + address = handle->loader->find_sym (data, handle->module, sym); + if (address) + { + if (sym != lsym) + { + LT_DLFREE (sym); + } + return address; + } + LT_DLMUTEX_SETERROR (saved_error); + } + + /* otherwise try "symbol" */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, symbol); + } + else + { + strcpy(sym, symbol); + } + + address = handle->loader->find_sym (data, handle->module, sym); + if (sym != lsym) + { + LT_DLFREE (sym); + } + + return address; +} + +const char * +lt_dlerror () +{ + const char *error; + + LT_DLMUTEX_GETERROR (error); + LT_DLMUTEX_SETERROR (0); + + return error ? error : NULL; +} + +static int +lt_dlpath_insertdir (ppath, before, dir) + char **ppath; + char *before; + const char *dir; +{ + int errors = 0; + char *canonical = 0; + char *argz = 0; + size_t argz_len = 0; + + assert (ppath); + assert (dir && *dir); + + if (canonicalize_path (dir, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + assert (canonical && *canonical); + + /* If *PPATH is empty, set it to DIR. */ + if (*ppath == 0) + { + assert (!before); /* BEFORE cannot be set without PPATH. */ + assert (dir); /* Without DIR, don't call this function! */ + + *ppath = lt_estrdup (dir); + if (*ppath == 0) + ++errors; + + return errors; + } + + assert (ppath && *ppath); + + if (argzize_path (*ppath, &argz, &argz_len) != 0) + { + ++errors; + goto cleanup; + } + + /* Convert BEFORE into an equivalent offset into ARGZ. This only works + if *PPATH is already canonicalized, and hence does not change length + with respect to ARGZ. We canonicalize each entry as it is added to + the search path, and don't call this function with (uncanonicalized) + user paths, so this is a fair assumption. */ + if (before) + { + assert (*ppath <= before); + assert (before - *ppath <= strlen (*ppath)); + + before = before - *ppath + argz; + } + + if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) + { + ++errors; + goto cleanup; + } + + argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); + LT_DLMEM_REASSIGN (*ppath, argz); + + cleanup: + LT_DLFREE (canonical); + LT_DLFREE (argz); + + return errors; +} + +int +lt_dladdsearchdir (search_dir) + const char *search_dir; +{ + int errors = 0; + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlinsertsearchdir (before, search_dir) + const char *before; + const char *search_dir; +{ + int errors = 0; + + if (before) + { + LT_DLMUTEX_LOCK (); + if ((before < user_search_path) + || (before >= user_search_path + LT_STRLEN (user_search_path))) + { + LT_DLMUTEX_UNLOCK (); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION)); + return 1; + } + LT_DLMUTEX_UNLOCK (); + } + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, + (char *) before, search_dir) != 0) + { + ++errors; + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlsetsearchpath (search_path) + const char *search_path; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + LT_DLFREE (user_search_path); + LT_DLMUTEX_UNLOCK (); + + if (!search_path || !LT_STRLEN (search_path)) + { + return errors; + } + + LT_DLMUTEX_LOCK (); + if (canonicalize_path (search_path, &user_search_path) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +const char * +lt_dlgetsearchpath () +{ + const char *saved_path; + + LT_DLMUTEX_LOCK (); + saved_path = user_search_path; + LT_DLMUTEX_UNLOCK (); + + return saved_path; +} + +int +lt_dlmakeresident (handle) + lt_dlhandle handle; +{ + int errors = 0; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + } + else + { + LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG); + } + + return errors; +} + +int +lt_dlisresident (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return -1; + } + + return LT_DLIS_RESIDENT (handle); +} + + + + +/* --- MODULE INFORMATION --- */ + +const lt_dlinfo * +lt_dlgetinfo (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + return &(handle->info); +} + +lt_dlhandle +lt_dlhandle_next (place) + lt_dlhandle place; +{ + return place ? place->next : handles; +} + +int +lt_dlforeach (func, data) + int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data)); + lt_ptr data; +{ + int errors = 0; + lt_dlhandle cur; + + LT_DLMUTEX_LOCK (); + + cur = handles; + while (cur) + { + lt_dlhandle tmp = cur; + + cur = cur->next; + if ((*func) (tmp, data)) + { + ++errors; + break; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlcaller_id +lt_dlcaller_register () +{ + static lt_dlcaller_id last_caller_id = 0; + int result; + + LT_DLMUTEX_LOCK (); + result = ++last_caller_id; + LT_DLMUTEX_UNLOCK (); + + return result; +} + +lt_ptr +lt_dlcaller_set_data (key, handle, data) + lt_dlcaller_id key; + lt_dlhandle handle; + lt_ptr data; +{ + int n_elements = 0; + lt_ptr stale = (lt_ptr) 0; + int i; + + /* This needs to be locked so that the caller data can be updated + simultaneously by different threads. */ + LT_DLMUTEX_LOCK (); + + if (handle->caller_data) + while (handle->caller_data[n_elements].key) + ++n_elements; + + for (i = 0; i < n_elements; ++i) + { + if (handle->caller_data[i].key == key) + { + stale = handle->caller_data[i].data; + break; + } + } + + /* Ensure that there is enough room in this handle's caller_data + array to accept a new element (and an empty end marker). */ + if (i == n_elements) + { + lt_caller_data *temp + = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements); + + if (!temp) + { + stale = 0; + goto done; + } + + handle->caller_data = temp; + + /* We only need this if we needed to allocate a new caller_data. */ + handle->caller_data[i].key = key; + handle->caller_data[1+ i].key = 0; + } + + handle->caller_data[i].data = data; + + done: + LT_DLMUTEX_UNLOCK (); + + return stale; +} + +lt_ptr +lt_dlcaller_get_data (key, handle) + lt_dlcaller_id key; + lt_dlhandle handle; +{ + lt_ptr result = (lt_ptr) 0; + + /* This needs to be locked so that the caller data isn't updated by + another thread part way through this function. */ + LT_DLMUTEX_LOCK (); + + /* Locate the index of the element with a matching KEY. */ + { + int i; + for (i = 0; handle->caller_data[i].key; ++i) + { + if (handle->caller_data[i].key == key) + { + result = handle->caller_data[i].data; + break; + } + } + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + + + +/* --- USER MODULE LOADER API --- */ + + +int +lt_dlloader_add (place, dlloader, loader_name) + lt_dlloader *place; + const struct lt_user_dlloader *dlloader; + const char *loader_name; +{ + int errors = 0; + lt_dlloader *node = 0, *ptr = 0; + + if ((dlloader == 0) /* diagnose null parameters */ + || (dlloader->module_open == 0) + || (dlloader->module_close == 0) + || (dlloader->find_sym == 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + /* Create a new dlloader node with copies of the user callbacks. */ + node = LT_EMALLOC (lt_dlloader, 1); + if (!node) + return 1; + + node->next = 0; + node->loader_name = loader_name; + node->sym_prefix = dlloader->sym_prefix; + node->dlloader_exit = dlloader->dlloader_exit; + node->module_open = dlloader->module_open; + node->module_close = dlloader->module_close; + node->find_sym = dlloader->find_sym; + node->dlloader_data = dlloader->dlloader_data; + + LT_DLMUTEX_LOCK (); + if (!loaders) + { + /* If there are no loaders, NODE becomes the list! */ + loaders = node; + } + else if (!place) + { + /* If PLACE is not set, add NODE to the end of the + LOADERS list. */ + for (ptr = loaders; ptr->next; ptr = ptr->next) + { + /*NOWORK*/; + } + + ptr->next = node; + } + else if (loaders == place) + { + /* If PLACE is the first loader, NODE goes first. */ + node->next = place; + loaders = node; + } + else + { + /* Find the node immediately preceding PLACE. */ + for (ptr = loaders; ptr->next != place; ptr = ptr->next) + { + /*NOWORK*/; + } + + if (ptr->next != place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + ++errors; + } + else + { + /* Insert NODE between PTR and PLACE. */ + node->next = place; + ptr->next = node; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlloader_remove (loader_name) + const char *loader_name; +{ + lt_dlloader *place = lt_dlloader_find (loader_name); + lt_dlhandle handle; + int errors = 0; + + if (!place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + LT_DLMUTEX_LOCK (); + + /* Fail if there are any open modules which use this loader. */ + for (handle = handles; handle; handle = handle->next) + { + if (handle->loader == place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER)); + ++errors; + goto done; + } + } + + if (place == loaders) + { + /* PLACE is the first loader in the list. */ + loaders = loaders->next; + } + else + { + /* Find the loader before the one being removed. */ + lt_dlloader *prev; + for (prev = loaders; prev->next; prev = prev->next) + { + if (!strcmp (prev->next->loader_name, loader_name)) + { + break; + } + } + + place = prev->next; + prev->next = prev->next->next; + } + + if (place->dlloader_exit) + { + errors = place->dlloader_exit (place->dlloader_data); + } + + LT_DLFREE (place); + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlloader * +lt_dlloader_next (place) + lt_dlloader *place; +{ + lt_dlloader *next; + + LT_DLMUTEX_LOCK (); + next = place ? place->next : loaders; + LT_DLMUTEX_UNLOCK (); + + return next; +} + +const char * +lt_dlloader_name (place) + lt_dlloader *place; +{ + const char *name = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + name = place ? place->loader_name : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return name; +} + +lt_user_data * +lt_dlloader_data (place) + lt_dlloader *place; +{ + lt_user_data *data = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + data = place ? &(place->dlloader_data) : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return data; +} + +lt_dlloader * +lt_dlloader_find (loader_name) + const char *loader_name; +{ + lt_dlloader *place = 0; + + LT_DLMUTEX_LOCK (); + for (place = loaders; place; place = place->next) + { + if (strcmp (place->loader_name, loader_name) == 0) + { + break; + } + } + LT_DLMUTEX_UNLOCK (); + + return place; +} diff --git a/libltdl/ltdl.c.mod b/libltdl/ltdl.c.mod new file mode 100644 index 0000000..ccd9fb8 --- /dev/null +++ b/libltdl/ltdl.c.mod @@ -0,0 +1,4020 @@ +/* ltdl.c -- system independent dlopen wrapper + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU libtool, you may include it under the same +distribution terms that you use for the rest of that program. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA + +*/ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + +#if HAVE_STDIO_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_STRING_H +# include +#else +# if HAVE_STRINGS_H +# include +# endif +#endif + +#if HAVE_CTYPE_H +# include +#endif + +#if HAVE_MALLOC_H +# include +#endif + +#if HAVE_MEMORY_H +# include +#endif + +#if HAVE_ERRNO_H +# include +#endif + +#if HAVE_DIRENT_H +# include +# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) +#else +# define dirent direct +# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen) +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#if HAVE_ARGZ_H +# include +#endif + +#if HAVE_ASSERT_H +# include +#else +# define assert(arg) ((void) 0) +#endif + +#include "ltdl.h" + + + + +/* --- WINDOWS SUPPORT --- */ + + +#ifdef DLL_EXPORT +# define LT_GLOBAL_DATA __declspec(dllexport) +#else +# define LT_GLOBAL_DATA +#endif + +/* fopen() mode flags for reading a text file */ +#undef LT_READTEXT_MODE +#ifdef __WINDOWS__ +# define LT_READTEXT_MODE "rt" +#else +# define LT_READTEXT_MODE "r" +#endif + + + + +/* --- MANIFEST CONSTANTS --- */ + + +/* Standard libltdl search path environment variable name */ +#undef LTDL_SEARCHPATH_VAR +#define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" + +/* Standard libtool archive file extension. */ +#undef LTDL_ARCHIVE_EXT +#define LTDL_ARCHIVE_EXT ".la" + +/* max. filename length */ +#ifndef LT_FILENAME_MAX +# define LT_FILENAME_MAX 1024 +#endif + +/* This is the maximum symbol size that won't require malloc/free */ +#undef LT_SYMBOL_LENGTH +#define LT_SYMBOL_LENGTH 128 + +/* This accounts for the _LTX_ separator */ +#undef LT_SYMBOL_OVERHEAD +#define LT_SYMBOL_OVERHEAD 5 + + + + +/* --- MEMORY HANDLING --- */ + + +/* These are the functions used internally. In addition to making + use of the associated function pointers above, they also perform + error handling. */ +static char *lt_estrdup LT_PARAMS((const char *str)); +static lt_ptr lt_emalloc LT_PARAMS((size_t size)); +static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size)); + +static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); + +/* These are the pointers that can be changed by the caller: */ +LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)) + = (lt_ptr (*) LT_PARAMS((size_t))) malloc; +LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)) + = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc; +LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) + = (void (*) LT_PARAMS((lt_ptr))) free; + +/* The following macros reduce the amount of typing needed to cast + assigned memory. */ +#define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) +#define LT_DLREALLOC(tp, p, n) ((tp *) rpl_realloc ((p), (n) * sizeof(tp))) +#define LT_DLFREE(p) \ + LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END + +#define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) +#define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) + +#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ + if ((p) != (q)) { lt_dlfree (p); (p) = (q); (q) = 0; } \ + } LT_STMT_END + + +/* --- REPLACEMENT FUNCTIONS --- */ + + +#undef strdup +#define strdup rpl_strdup + +static char *strdup LT_PARAMS((const char *str)); + +char * +strdup(str) + const char *str; +{ + char *tmp = 0; + + if (str) + { + tmp = LT_DLMALLOC (char, 1+ strlen (str)); + if (tmp) + { + strcpy(tmp, str); + } + } + + return tmp; +} + + +#if ! HAVE_STRCMP + +#undef strcmp +#define strcmp rpl_strcmp + +static int strcmp LT_PARAMS((const char *str1, const char *str2)); + +int +strcmp (str1, str2) + const char *str1; + const char *str2; +{ + if (str1 == str2) + return 0; + if (str1 == 0) + return -1; + if (str2 == 0) + return 1; + + for (;*str1 && *str2; ++str1, ++str2) + { + if (*str1 != *str2) + break; + } + + return (int)(*str1 - *str2); +} +#endif + + +#if ! HAVE_STRCHR + +# if HAVE_INDEX +# define strchr index +# else +# define strchr rpl_strchr + +static const char *strchr LT_PARAMS((const char *str, int ch)); + +const char* +strchr(str, ch) + const char *str; + int ch; +{ + const char *p; + + for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p) + /*NOWORK*/; + + return (*p == (char)ch) ? p : 0; +} + +# endif +#endif /* !HAVE_STRCHR */ + + +#if ! HAVE_STRRCHR + +# if HAVE_RINDEX +# define strrchr rindex +# else +# define strrchr rpl_strrchr + +static const char *strrchr LT_PARAMS((const char *str, int ch)); + +const char* +strrchr(str, ch) + const char *str; + int ch; +{ + const char *p, *q = 0; + + for (p = str; *p != LT_EOS_CHAR; ++p) + { + if (*p == (char) ch) + { + q = p; + } + } + + return q; +} + +# endif +#endif + +/* NOTE: Neither bcopy nor the memcpy implementation below can + reliably handle copying in overlapping areas of memory. Use + memmove (for which there is a fallback implmentation below) + if you need that behaviour. */ +#if ! HAVE_MEMCPY + +# if HAVE_BCOPY +# define memcpy(dest, src, size) bcopy (src, dest, size) +# else +# define memcpy rpl_memcpy + +static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +lt_ptr +memcpy (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + size_t i = 0; + + for (i = 0; i < size; ++i) + { + dest[i] = src[i]; + } + + return dest; +} + +# endif /* !HAVE_BCOPY */ +#endif /* !HAVE_MEMCPY */ + +#if ! HAVE_MEMMOVE +# define memmove rpl_memmove + +static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); + +lt_ptr +memmove (dest, src, size) + lt_ptr dest; + const lt_ptr src; + size_t size; +{ + size_t i; + + if (dest < src) + for (i = 0; i < size; ++i) + { + dest[i] = src[i]; + } + else if (dest > src) + for (i = size -1; i >= 0; --i) + { + dest[i] = src[i]; + } + + return dest; +} + +#endif /* !HAVE_MEMMOVE */ + + +/* According to Alexandre Oliva , + ``realloc is not entirely portable'' + In any case we want to use the allocator supplied by the user without + burdening them with an lt_dlrealloc function pointer to maintain. + Instead implement our own version (with known boundary conditions) + using lt_dlmalloc and lt_dlfree. */ + +#undef realloc +#define realloc rpl_realloc + +lt_ptr +realloc (ptr, size) + lt_ptr ptr; + size_t size; +{ + if (size <= 0) + { + /* For zero or less bytes, free the original memory */ + if (ptr != 0) + { + lt_dlfree (ptr); + } + + return (lt_ptr) 0; + } + else if (ptr == 0) + { + /* Allow reallocation of a NULL pointer. */ + return lt_dlmalloc (size); + } + else + { + /* Allocate a new block, copy and free the old block. */ + lt_ptr mem = lt_dlmalloc (size); + + if (mem) + { + memcpy (mem, ptr, size); + lt_dlfree (ptr); + } + + /* Note that the contents of PTR are not damaged if there is + insufficient memory to realloc. */ + return mem; + } +} + + +#if ! HAVE_ARGZ_APPEND +# define argz_append rpl_argz_append + +static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len, + const char *buf, size_t buf_len)); + +error_t +argz_append (pargz, pargz_len, buf, buf_len) + char **pargz; + size_t *pargz_len; + const char *buf; + size_t buf_len; +{ + size_t argz_len; + char *argz; + + assert (pargz); + assert (pargz_len); + assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); + + /* If nothing needs to be appended, no more work is required. */ + if (buf_len == 0) + return 0; + + /* Ensure there is enough room to append BUF_LEN. */ + argz_len = *pargz_len + buf_len; + argz = LT_DLREALLOC (char, *pargz, argz_len); + if (!argz) + return ENOMEM; + + /* Copy characters from BUF after terminating '\0' in ARGZ. */ + memcpy (argz + *pargz_len, buf, buf_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_APPEND */ + + +#if ! HAVE_ARGZ_CREATE_SEP +# define argz_create_sep rpl_argz_create_sep + +static error_t argz_create_sep LT_PARAMS((const char *str, int delim, + char **pargz, size_t *pargz_len)); + +error_t +argz_create_sep (str, delim, pargz, pargz_len) + const char *str; + int delim; + char **pargz; + size_t *pargz_len; +{ + size_t argz_len; + char *argz = 0; + + assert (str); + assert (pargz); + assert (pargz_len); + + /* Make a copy of STR, but replacing each occurence of + DELIM with '\0'. */ + argz_len = 1+ LT_STRLEN (str); + if (argz_len) + { + const char *p; + char *q; + + argz = LT_DLMALLOC (char, argz_len); + if (!argz) + return ENOMEM; + + for (p = str, q = argz; *p != LT_EOS_CHAR; ++p) + { + if (*p == delim) + { + /* Ignore leading delimiters, and fold consecutive + delimiters in STR into a single '\0' in ARGZ. */ + if ((q > argz) && (q[-1] != LT_EOS_CHAR)) + *q++ = LT_EOS_CHAR; + else + --argz_len; + } + else + *q++ = *p; + } + /* Copy terminating LT_EOS_CHAR. */ + *q = *p; + } + + /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ + if (!argz_len) + LT_DLFREE (argz); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + + return 0; +} +#endif /* !HAVE_ARGZ_CREATE_SEP */ + + +#if ! HAVE_ARGZ_INSERT +# define argz_insert rpl_argz_insert + +static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, + char *before, const char *entry)); + +error_t +argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + /* Either PARGZ/PARGZ_LEN is empty and BEFORE is NULL, + or BEFORE points into an address within the ARGZ vector. */ + assert ((!*pargz && !*pargz_len && !before) + || ((*pargz <= before) && (before < (*pargz + *pargz_len)))); + + /* No BEFORE address indicates ENTRY should be inserted after the + current last element. */ + if (!before) + return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry)); + + /* This probably indicates a programmer error, but to preserve + semantics, scan back to the start of an entry if BEFORE points + into the middle of it. */ + while ((before >= *pargz) && (before[-1] != LT_EOS_CHAR)) + --before; + + { + size_t entry_len = 1+ LT_STRLEN (entry); + size_t argz_len = *pargz_len + entry_len; + size_t offset = before - *pargz; + char *argz = LT_DLREALLOC (char, *pargz, argz_len); + + if (!argz) + return ENOMEM; + + /* Make BEFORE point to the equivalent offset in ARGZ that it + used to have in *PARGZ incase realloc() moved the block. */ + before = argz + offset; + + /* Move the ARGZ entries starting at BEFORE up into the new + space at the end -- making room to copy ENTRY into the + resulting gap. */ + memmove (before + entry_len, before, *pargz_len - offset); + memcpy (before, entry, entry_len); + + /* Assign new values. */ + *pargz = argz; + *pargz_len = argz_len; + } + + return 0; +} +#endif /* !HAVE_ARGZ_INSERT */ + + +#if ! HAVE_ARGZ_NEXT +# define argz_next rpl_argz_next + +static char *argz_next LT_PARAMS((char *argz, size_t argz_len, + const char *entry)); + +char * +argz_next (argz, argz_len, entry) + char *argz; + size_t argz_len; + const char *entry; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (entry) + { + /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address + within the ARGZ vector. */ + assert ((!argz && !argz_len) + || ((argz <= entry) && (entry < (argz + argz_len)))); + + /* Move to the char immediately after the terminating + '\0' of ENTRY. */ + entry = 1+ strchr (entry, LT_EOS_CHAR); + + /* Return either the new ENTRY, or else NULL if ARGZ is + exhausted. */ + return (entry >= argz + argz_len) ? 0 : (char *) entry; + } + else + { + /* This should probably be flagged as a programmer error, + since starting an argz_next loop with the iterator set + to ARGZ is safer. To preserve semantics, handle the NULL + case by returning the start of ARGZ (if any). */ + if (argz_len > 0) + return argz; + else + return 0; + } +} +#endif /* !HAVE_ARGZ_NEXT */ + + + +#if ! HAVE_ARGZ_STRINGIFY +# define argz_stringify rpl_argz_stringify + +static void argz_stringify LT_PARAMS((char *argz, size_t argz_len, + int sep)); + +void +argz_stringify (argz, argz_len, sep) + char *argz; + size_t argz_len; + int sep; +{ + assert ((argz && argz_len) || (!argz && !argz_len)); + + if (sep) + { + --argz_len; /* don't stringify the terminating EOS */ + while (--argz_len > 0) + { + if (argz[argz_len] == LT_EOS_CHAR) + argz[argz_len] = sep; + } + } +} +#endif /* !HAVE_ARGZ_STRINGIFY */ + + + + +/* --- TYPE DEFINITIONS -- */ + + +/* This type is used for the array of caller data sets in each handler. */ +typedef struct { + lt_dlcaller_id key; + lt_ptr data; +} lt_caller_data; + + + + +/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ + + +/* Extract the diagnostic strings from the error table macro in the same + order as the enumerated indices in ltdl.h. */ + +static const char *lt_dlerror_strings[] = + { +#define LT_ERROR(name, diagnostic) (diagnostic), + lt_dlerror_table +#undef LT_ERROR + + 0 + }; + +/* This structure is used for the list of registered loaders. */ +struct lt_dlloader { + struct lt_dlloader *next; + const char *loader_name; /* identifying name for each loader */ + const char *sym_prefix; /* prefix for symbols */ + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +struct lt_dlhandle_struct { + struct lt_dlhandle_struct *next; + lt_dlloader *loader; /* dlopening interface */ + lt_dlinfo info; + int depcount; /* number of dependencies */ + lt_dlhandle *deplibs; /* dependencies */ + lt_module module; /* system module handle */ + lt_ptr system; /* system specific data */ + lt_caller_data *caller_data; /* per caller associated data */ + int flags; /* various boolean stats */ +}; + +/* Various boolean flags can be stored in the flags field of an + lt_dlhandle_struct... */ +#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag)) +#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag)) + +#define LT_DLRESIDENT_FLAG (0x01 << 0) +/* ...add more flags here... */ + +#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG) + + +#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)] + +static const char objdir[] = LTDL_OBJDIR; +static const char archive_ext[] = LTDL_ARCHIVE_EXT; +#ifdef LTDL_SHLIB_EXT +static const char shlib_ext[] = LTDL_SHLIB_EXT; +#endif +#ifdef LTDL_SYSSEARCHPATH +static const char sys_search_path[] = LTDL_SYSSEARCHPATH; +#endif + + + + +/* --- MUTEX LOCKING --- */ + + +/* Macros to make it easier to run the lock functions only if they have + been registered. The reason for the complicated lock macro is to + ensure that the stored error message from the last error is not + accidentally erased if the current function doesn't generate an + error of its own. */ +#define LT_DLMUTEX_LOCK() LT_STMT_START { \ + if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ + } LT_STMT_END +#define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ + if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\ + } LT_STMT_END +#define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (*lt_dlmutex_seterror_func) (errormsg); \ + else lt_dllast_error = (errormsg); } LT_STMT_END +#define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \ + if (lt_dlmutex_seterror_func) \ + (errormsg) = (*lt_dlmutex_geterror_func) (); \ + else (errormsg) = lt_dllast_error; } LT_STMT_END + +/* The mutex functions stored here are global, and are necessarily the + same for all threads that wish to share access to libltdl. */ +static lt_dlmutex_lock *lt_dlmutex_lock_func = 0; +static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0; +static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0; +static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0; +static const char *lt_dllast_error = 0; + + +/* Either set or reset the mutex functions. Either all the arguments must + be valid functions, or else all can be NULL to turn off locking entirely. + The registered functions should be manipulating a static global lock + from the lock() and unlock() callbacks, which needs to be reentrant. */ +int +lt_dlmutex_register (lock, unlock, seterror, geterror) + lt_dlmutex_lock *lock; + lt_dlmutex_unlock *unlock; + lt_dlmutex_seterror *seterror; + lt_dlmutex_geterror *geterror; +{ + lt_dlmutex_unlock *old_unlock = unlock; + int errors = 0; + + /* Lock using the old lock() callback, if any. */ + LT_DLMUTEX_LOCK (); + + if ((lock && unlock && seterror && geterror) + || !(lock || unlock || seterror || geterror)) + { + lt_dlmutex_lock_func = lock; + lt_dlmutex_unlock_func = unlock; + lt_dlmutex_geterror_func = geterror; + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS)); + ++errors; + } + + /* Use the old unlock() callback we saved earlier, if any. Otherwise + record any errors using internal storage. */ + if (old_unlock) + (*old_unlock) (); + + /* Return the number of errors encountered during the execution of + this function. */ + return errors; +} + + + + +/* --- ERROR HANDLING --- */ + + +static const char **user_error_strings = 0; +static int errorcount = LT_ERROR_MAX; + +int +lt_dladderror (diagnostic) + const char *diagnostic; +{ + int errindex = 0; + int result = -1; + const char **temp = (const char **) 0; + + assert (diagnostic); + + LT_DLMUTEX_LOCK (); + + errindex = errorcount - LT_ERROR_MAX; + temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); + if (temp) + { + user_error_strings = temp; + user_error_strings[errindex] = diagnostic; + result = errorcount++; + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +int +lt_dlseterror (errindex) + int errindex; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + if (errindex >= errorcount || errindex < 0) + { + /* Ack! Error setting the error message! */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); + ++errors; + } + else if (errindex < LT_ERROR_MAX) + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]); + } + else + { + /* No error setting the error message! */ + LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_ptr +lt_emalloc (size) + size_t size; +{ + lt_ptr mem = lt_dlmalloc (size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +lt_ptr +lt_erealloc (addr, size) + lt_ptr addr; + size_t size; +{ + lt_ptr mem = realloc (addr, size); + if (size && !mem) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return mem; +} + +char * +lt_estrdup (str) + const char *str; +{ + char *dup = strdup (str); + if (LT_STRLEN (str) && !dup) + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + return dup; +} + + + + +/* --- DLOPEN() INTERFACE LOADER --- */ + + +/* The Cygwin dlopen implementation prints a spurious error message to + stderr if its call to LoadLibrary() fails for any reason. We can + mitigate this by not using the Cygwin implementation, and falling + back to our own LoadLibrary() wrapper. */ +#if HAVE_LIBDL && !defined(__CYGWIN__) + +/* dynamic linking with dlopen/dlsym */ + +#if HAVE_DLFCN_H +# include +#endif + +#if HAVE_SYS_DL_H +# include +#endif + +#ifdef RTLD_GLOBAL +# define LT_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_GLOBAL DL_GLOBAL +# endif +#endif /* !RTLD_GLOBAL */ +#ifndef LT_GLOBAL +# define LT_GLOBAL 0 +#endif /* !LT_GLOBAL */ + +/* We may have to define LT_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_LAZY_OR_NOW DL_LAZY +# endif +# endif /* !RTLD_LAZY */ +#endif +#ifndef LT_LAZY_OR_NOW +# ifdef RTLD_NOW +# define LT_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_LAZY_OR_NOW DL_NOW +# endif +# endif /* !RTLD_NOW */ +#endif +#ifndef LT_LAZY_OR_NOW +# define LT_LAZY_OR_NOW 0 +#endif /* !LT_LAZY_OR_NOW */ + +#if HAVE_DLERROR +# define DLERROR(arg) dlerror () +#else +# define DLERROR(arg) LT_DLSTRERROR (arg) +#endif + +static lt_module +sys_dl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW); + + if (!module) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN)); + } + + return module; +} + +static int +sys_dl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dlclose (module) != 0) + { + LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_dl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dlsym (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dl = + { +# ifdef NEED_USCORE + "_", +# else + 0, +# endif + sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 }; + + +#endif /* HAVE_LIBDL */ + + + +/* --- SHL_LOAD() INTERFACE LOADER --- */ + +#if HAVE_SHL_LOAD + +/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */ + +#ifdef HAVE_DL_H +# include +#endif + +/* some flags are missing on some systems, so we provide + * harmless defaults. + * + * Mandatory: + * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. + * BIND_DEFERRED - Delay code symbol resolution until actual reference. + * + * Optionally: + * BIND_FIRST - Place the library at the head of the symbol search + * order. + * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all + * unsatisfied symbols as fatal. This flag allows + * binding of unsatisfied code symbols to be deferred + * until use. + * [Perl: For certain libraries, like DCE, deferred + * binding often causes run time problems. Adding + * BIND_NONFATAL to BIND_IMMEDIATE still allows + * unresolved references in situations like this.] + * BIND_NOSTART - Do not call the initializer for the shared library + * when the library is loaded, nor on a future call to + * shl_unload(). + * BIND_VERBOSE - Print verbose messages concerning possible + * unsatisfied symbols. + * + * hp9000s700/hp9000s800: + * BIND_RESTRICTED - Restrict symbols visible by the library to those + * present at library load time. + * DYNAMIC_PATH - Allow the loader to dynamically search for the + * library specified by the path argument. + */ + +#ifndef DYNAMIC_PATH +# define DYNAMIC_PATH 0 +#endif +#ifndef BIND_RESTRICTED +# define BIND_RESTRICTED 0 +#endif + +#define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) + +static lt_module +sys_shl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + static shl_t self = (shl_t) 0; + lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); + + /* Since searching for a symbol against a NULL module handle will also + look in everything else that was already loaded and exported with + the -E compiler flag, we always cache a handle saved before any + modules are loaded. */ + if (!self) + { + lt_ptr address; + shl_findsym (&self, "main", TYPE_UNDEFINED, &address); + } + + if (!filename) + { + module = self; + } + else + { + module = shl_load (filename, LT_BIND_FLAGS, 0L); + + if (!module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + } + } + + return module; +} + +static int +sys_shl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (module && (shl_unload ((shl_t) (module)) != 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_shl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + + /* sys_shl_open should never return a NULL module handle */ + if (module == (lt_module) 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + } + else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address)) + { + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + } + + return address; +} + +static struct lt_user_dlloader sys_shl = { + 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 +}; + +#endif /* HAVE_SHL_LOAD */ + + + + +/* --- LOADLIBRARY() INTERFACE LOADER --- */ + +#ifdef __WINDOWS__ + +/* dynamic linking for Win32 */ + +#include + +/* Forward declaration; required to implement handle search below. */ +static lt_dlhandle handles; + +static lt_module +sys_wll_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlhandle cur; + lt_module module = 0; + const char *errormsg = 0; + char *searchname = 0; + char *ext; + char self_name_buf[MAX_PATH]; + + if (!filename) + { + /* Get the name of main module */ + *self_name_buf = 0; + GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf)); + filename = ext = self_name_buf; + } + else + { + ext = strrchr (filename, '.'); + } + + if (ext) + { + /* FILENAME already has an extension. */ + searchname = lt_estrdup (filename); + } + else + { + /* Append a `.' to stop Windows from adding an + implicit `.dll' extension. */ + searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename)); + if (searchname) + sprintf (searchname, "%s.", filename); + } + if (!searchname) + return 0; + +#if __CYGWIN__ + { + char wpath[MAX_PATH]; + cygwin_conv_to_full_win32_path(searchname, wpath); + module = LoadLibrary(wpath); + } +#else + module = LoadLibrary (searchname); +#endif + LT_DLFREE (searchname); + + /* libltdl expects this function to fail if it is unable + to physically load the library. Sadly, LoadLibrary + will search the loaded libraries for a match and return + one of them if the path search load fails. + + We check whether LoadLibrary is returning a handle to + an already loaded module, and simulate failure if we + find one. */ + LT_DLMUTEX_LOCK (); + cur = handles; + while (cur) + { + if (!cur->module) + { + cur = 0; + break; + } + + if (cur->module == module) + { + break; + } + + cur = cur->next; + } + LT_DLMUTEX_UNLOCK (); + + if (cur || !module) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + module = 0; + } + + return module; +} + +static int +sys_wll_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (FreeLibrary(module) == 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_wll_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = GetProcAddress (module, symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_wll = { + 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 +}; + +#endif /* __WINDOWS__ */ + + + + +/* --- LOAD_ADD_ON() INTERFACE LOADER --- */ + + +#ifdef __BEOS__ + +/* dynamic linking for BeOS */ + +#include + +static lt_module +sys_bedl_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + image_id image = 0; + + if (filename) + { + image = load_add_on (filename); + } + else + { + image_info info; + int32 cookie = 0; + if (get_next_image_info (0, &cookie, &info) == B_OK) + image = load_add_on (info.name); + } + + if (image <= 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + image = 0; + } + + return (lt_module) image; +} + +static int +sys_bedl_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (unload_add_on ((image_id) module) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + + return errors; +} + +static lt_ptr +sys_bedl_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = 0; + image_id image = (image_id) module; + + if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + address = 0; + } + + return address; +} + +static struct lt_user_dlloader sys_bedl = { + 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 +}; + +#endif /* __BEOS__ */ + + + + +/* --- DLD_LINK() INTERFACE LOADER --- */ + + +#if HAVE_DLD + +/* dynamic linking with dld */ + +#if HAVE_DLD_H +#include +#endif + +static lt_module +sys_dld_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_module module = strdup (filename); + + if (dld_link (filename) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); + LT_DLFREE (module); + module = 0; + } + + return module; +} + +static int +sys_dld_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + int errors = 0; + + if (dld_unlink_by_file ((char*)(module), 1) != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); + ++errors; + } + else + { + LT_DLFREE (module); + } + + return errors; +} + +static lt_ptr +sys_dld_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_ptr address = dld_get_func (symbol); + + if (!address) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + } + + return address; +} + +static struct lt_user_dlloader sys_dld = { + 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 +}; + +#endif /* HAVE_DLD */ + + + + +/* --- DLPREOPEN() INTERFACE LOADER --- */ + + +/* emulate dynamic linking using preloaded_symbols */ + +typedef struct lt_dlsymlists_t +{ + struct lt_dlsymlists_t *next; + const lt_dlsymlist *syms; +} lt_dlsymlists_t; + +static const lt_dlsymlist *default_preloaded_symbols = 0; +static lt_dlsymlists_t *preloaded_symbols = 0; + +static int +presym_init (loader_data) + lt_user_data loader_data; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + preloaded_symbols = 0; + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +static int +presym_free_symlists () +{ + lt_dlsymlists_t *lists; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + lt_dlsymlists_t *tmp = lists; + + lists = lists->next; + LT_DLFREE (tmp); + } + preloaded_symbols = 0; + + LT_DLMUTEX_UNLOCK (); + + return 0; +} + +static int +presym_exit (loader_data) + lt_user_data loader_data; +{ + presym_free_symlists (); + return 0; +} + +static int +presym_add_symlist (preloaded) + const lt_dlsymlist *preloaded; +{ + lt_dlsymlists_t *tmp; + lt_dlsymlists_t *lists; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + lists = preloaded_symbols; + while (lists) + { + if (lists->syms == preloaded) + { + goto done; + } + lists = lists->next; + } + + tmp = LT_EMALLOC (lt_dlsymlists_t, 1); + if (tmp) + { + memset (tmp, 0, sizeof(lt_dlsymlists_t)); + tmp->syms = preloaded; + tmp->next = preloaded_symbols; + preloaded_symbols = tmp; + } + else + { + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static lt_module +presym_open (loader_data, filename) + lt_user_data loader_data; + const char *filename; +{ + lt_dlsymlists_t *lists; + lt_module module = (lt_module) 0; + + LT_DLMUTEX_LOCK (); + lists = preloaded_symbols; + + if (!lists) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS)); + goto done; + } + + /* Can't use NULL as the reflective symbol header, as NULL is + used to mark the end of the entire symbol list. Self-dlpreopened + symbols follow this magic number, chosen to be an unlikely + clash with a real module name. */ + if (!filename) + { + filename = "@PROGRAM@"; + } + + while (lists) + { + const lt_dlsymlist *syms = lists->syms; + + while (syms->name) + { + if (!syms->address && strcmp(syms->name, filename) == 0) + { + module = (lt_module) syms; + goto done; + } + ++syms; + } + + lists = lists->next; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + + done: + LT_DLMUTEX_UNLOCK (); + return module; +} + +static int +presym_close (loader_data, module) + lt_user_data loader_data; + lt_module module; +{ + /* Just to silence gcc -Wall */ + module = 0; + return 0; +} + +static lt_ptr +presym_sym (loader_data, module, symbol) + lt_user_data loader_data; + lt_module module; + const char *symbol; +{ + lt_dlsymlist *syms = (lt_dlsymlist*) module; + + ++syms; + while (syms->address) + { + if (strcmp(syms->name, symbol) == 0) + { + return syms->address; + } + + ++syms; + } + + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + + return 0; +} + +static struct lt_user_dlloader presym = { + 0, presym_open, presym_close, presym_sym, presym_exit, 0 +}; + + + + + +/* --- DYNAMIC MODULE LOADING --- */ + + +/* The type of a function used at each iteration of foreach_dirinpath(). */ +typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + +static int foreach_dirinpath LT_PARAMS((const char *search_path, + const char *base_name, + foreach_callback_func *func, + lt_ptr data1, lt_ptr data2)); + +static int find_file_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data, + lt_ptr ignored)); +static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1, + lt_ptr data2)); + + +static int canonicalize_path LT_PARAMS((const char *path, + char **pcanonical)); +static int argzize_path LT_PARAMS((const char *path, + char **pargz, + size_t *pargz_len)); +static FILE *find_file LT_PARAMS((const char *search_path, + const char *base_name, + char **pdir)); +static lt_dlhandle *find_handle LT_PARAMS((const char *search_path, + const char *base_name, + lt_dlhandle *handle)); +static int find_module LT_PARAMS((lt_dlhandle *handle, + const char *dir, + const char *libdir, + const char *dlname, + const char *old_name, + int installed)); +static int free_vars LT_PARAMS((char *dlname, char *oldname, + char *libdir, char *deplibs)); +static int load_deplibs LT_PARAMS((lt_dlhandle handle, + char *deplibs)); +static int trim LT_PARAMS((char **dest, + const char *str)); +static int try_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle, + const char *filename)); +static int unload_deplibs LT_PARAMS((lt_dlhandle handle)); +static int lt_argz_insert LT_PARAMS((char **pargz, + size_t *pargz_len, + char *before, + const char *entry)); +static int lt_argz_insertinorder LT_PARAMS((char **pargz, + size_t *pargz_len, + const char *entry)); +static int lt_dlpath_insertdir LT_PARAMS((char **ppath, + char *before, + const char *dir)); + +static char *user_search_path= 0; +static lt_dlloader *loaders = 0; +static lt_dlhandle handles = 0; +static int initialized = 0; + +/* Initialize libltdl. */ +int +lt_dlinit () +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* Initialize only at first call. */ + if (++initialized == 1) + { + handles = 0; + user_search_path = 0; /* empty search path */ + +#if HAVE_LIBDL && !defined(__CYGWIN__) + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen"); +#endif +#if HAVE_SHL_LOAD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen"); +#endif +#ifdef __WINDOWS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen"); +#endif +#ifdef __BEOS__ + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen"); +#endif +#if HAVE_DLD + errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld"); +#endif + errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload"); + + if (presym_init (presym.dlloader_data)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER)); + ++errors; + } + else if (errors != 0) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED)); + ++errors; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlpreload (preloaded) + const lt_dlsymlist *preloaded; +{ + int errors = 0; + + if (preloaded) + { + errors = presym_add_symlist (preloaded); + } + else + { + presym_free_symlists(); + + LT_DLMUTEX_LOCK (); + if (default_preloaded_symbols) + { + errors = lt_dlpreload (default_preloaded_symbols); + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlpreload_default (preloaded) + const lt_dlsymlist *preloaded; +{ + LT_DLMUTEX_LOCK (); + default_preloaded_symbols = preloaded; + LT_DLMUTEX_UNLOCK (); + return 0; +} + +int +lt_dlexit () +{ + /* shut down libltdl */ + lt_dlloader *loader; + int errors = 0; + + LT_DLMUTEX_LOCK (); + loader = loaders; + + if (!initialized) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN)); + ++errors; + goto done; + } + + /* shut down only at last call. */ + if (--initialized == 0) + { + int level; + + while (handles && LT_DLIS_RESIDENT (handles)) + { + handles = handles->next; + } + + /* close all modules */ + for (level = 1; handles; ++level) + { + lt_dlhandle cur = handles; + int saw_nonresident = 0; + + while (cur) + { + lt_dlhandle tmp = cur; + cur = cur->next; + if (!LT_DLIS_RESIDENT (tmp)) + saw_nonresident = 1; + if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) + { + if (lt_dlclose (tmp)) + { + ++errors; + } + } + } + /* done if only resident modules are left */ + if (!saw_nonresident) + break; + } + + /* close all loaders */ + while (loader) + { + lt_dlloader *next = loader->next; + lt_user_data data = loader->dlloader_data; + if (loader->dlloader_exit && loader->dlloader_exit (data)) + { + ++errors; + } + + LT_DLMEM_REASSIGN (loader, next); + } + loaders = 0; + } + + done: + LT_DLMUTEX_UNLOCK (); + return errors; +} + +static int +tryall_dlopen (handle, filename) + lt_dlhandle *handle; + const char *filename; +{ + lt_dlhandle cur; + lt_dlloader *loader; + const char *saved_error; + int errors = 0; + + printf("tryall_dlopen %s\n", filename); + LT_DLMUTEX_GETERROR (saved_error); + LT_DLMUTEX_LOCK (); + + puts("3.11.1.3.1"); + + cur = handles; + loader = loaders; + + /* check whether the module was already opened */ + while (cur) + { + /* try to dlopen the program itself? */ + if (!cur->info.filename && !filename) + { + break; + } + + if (cur->info.filename && filename + && strcmp (cur->info.filename, filename) == 0) + { + break; + } + + cur = cur->next; + } + + puts("3.11.1.3.2"); + if (cur) + { + ++cur->info.ref_count; + *handle = cur; + goto done; + } + + puts("3.11.1.3.3"); + cur = *handle; + if (filename) + { + cur->info.filename = lt_estrdup (filename); + if (!cur->info.filename) + { + ++errors; + goto done; + } + } + else + { + cur->info.filename = 0; + } + + puts("3.11.1.3.4"); + while (loader) + { + lt_user_data data = loader->dlloader_data; + + cur->module = loader->module_open (data, filename); + printf("cur->module=%p, filenam = %s\n", cur->module, filename); + + if (cur->module != 0) + { + break; + } + loader = loader->next; + } + puts("3.11.1.3.5"); + + if (!loader) + { + LT_DLFREE (cur->info.filename); + ++errors; + goto done; + } + puts("3.11.1.3.6"); + + cur->loader = loader; + LT_DLMUTEX_SETERROR (saved_error); + + done: + LT_DLMUTEX_UNLOCK (); + puts("3.11.1.3.7"); + + return errors; +} + +static int +tryall_dlopen_module (handle, prefix, dirname, dlname) + lt_dlhandle *handle; + const char *prefix; + const char *dirname; + const char *dlname; +{ + int error = 0; + char *filename = 0; + size_t filename_len = 0; + size_t dirname_len = LT_STRLEN (dirname); + + printf("tryall_dlopen_module %s %s %s\n", prefix, dirname, dlname); + + assert (handle); + assert (dirname); + assert (dlname); +#ifdef LT_DIRSEP_CHAR + /* Only canonicalized names (i.e. with DIRSEP chars already converted) + should make it into this function: */ + assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); +#endif + puts("3.11.1.3.1"); + + if (dirname[dirname_len -1] == '/') + --dirname_len; + filename_len = dirname_len + 1 + LT_STRLEN (dlname); + + /* Allocate memory, and combine DIRNAME and MODULENAME into it. + The PREFIX (if any) is handled below. */ + filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1); + if (!filename) + return 1; + puts("3.11.1.3.2"); + + sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); + + /* Now that we have combined DIRNAME and MODULENAME, if there is + also a PREFIX to contend with, simply recurse with the arguments + shuffled. Otherwise, attempt to open FILENAME as a module. */ + if (prefix) + { + error += tryall_dlopen_module (handle, + (const char *) 0, prefix, filename); + printf("1:error = %d\n", error); + } + else if (tryall_dlopen (handle, filename) != 0) + { + printf("2:error = %d\n", error); + ++error; + } + puts("3.11.1.3.3"); + + LT_DLFREE (filename); + return error; +} + +static int +find_module (handle, dir, libdir, dlname, old_name, installed) + lt_dlhandle *handle; + const char *dir; + const char *libdir; + const char *dlname; + const char *old_name; + int installed; +{ + printf("find_module %s %s %s %s\n", dir, libdir, dlname, old_name); + /* Try to open the old library first; if it was dlpreopened, + we want the preopened version of it, even if a dlopenable + module is available. */ + if (old_name && tryall_dlopen (handle, old_name) == 0) + { + return 0; + } + puts("3.11.1.1"); + /* Try to open the dynamic library. */ + if (dlname) + { + puts("3.11.1.2"); + /* try to open the installed module */ + if (installed && libdir) + { + if (tryall_dlopen_module (handle, + (const char *) 0, libdir, dlname) == 0) + return 0; + } + puts("3.11.1.3"); + + /* try to open the not-installed module */ + if (!installed) + { + if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0) + return 0; + } + + puts("3.11.1.4"); + /* maybe it was moved to another directory */ + { + if (tryall_dlopen_module (handle, + (const char *) 0, dir, dlname) == 0) + return 0; + } + } + + puts("3.11.1.5"); + return 1; +} + + +static int +canonicalize_path (path, pcanonical) + const char *path; + char **pcanonical; +{ + char *canonical = 0; + + assert (path && *path); + assert (pcanonical); + + canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path)); + if (!canonical) + return 1; + + { + size_t dest = 0; + size_t src; + for (src = 0; path[src] != LT_EOS_CHAR; ++src) + { + /* Path separators are not copied to the beginning or end of + the destination, or if another separator would follow + immediately. */ + if (path[src] == LT_PATHSEP_CHAR) + { + if ((dest == 0) + || (path[1+ src] == LT_PATHSEP_CHAR) + || (path[1+ src] == LT_EOS_CHAR)) + continue; + } + + /* Anything other than a directory separator is copied verbatim. */ + if ((path[src] != '/') +#ifdef LT_DIRSEP_CHAR + && (path[src] != LT_DIRSEP_CHAR) +#endif + ) + { + canonical[dest++] = path[src]; + } + /* Directory separators are converted and copied only if they are + not at the end of a path -- i.e. before a path separator or + NULL terminator. */ + else if ((path[1+ src] != LT_PATHSEP_CHAR) + && (path[1+ src] != LT_EOS_CHAR) +#ifdef LT_DIRSEP_CHAR + && (path[1+ src] != LT_DIRSEP_CHAR) +#endif + && (path[1+ src] != '/')) + { + canonical[dest++] = '/'; + } + } + + /* Add an end-of-string marker at the end. */ + canonical[dest] = LT_EOS_CHAR; + } + + /* Assign new value. */ + *pcanonical = canonical; + + return 0; +} + +static int +argzize_path (path, pargz, pargz_len) + const char *path; + char **pargz; + size_t *pargz_len; +{ + error_t error; + + assert (path); + assert (pargz); + assert (pargz_len); + + if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + + return 1; + } + + return 0; +} + +/* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element + of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns + non-zero or all elements are exhausted. If BASE_NAME is non-NULL, + it is appended to each SEARCH_PATH element before FUNC is called. */ +static int +foreach_dirinpath (search_path, base_name, func, data1, data2) + const char *search_path; + const char *base_name; + foreach_callback_func *func; + lt_ptr data1; + lt_ptr data2; +{ + int result = 0; + int filenamesize = 0; + int lenbase = LT_STRLEN (base_name); + size_t argz_len = 0; + char * argz = 0; + char * filename = 0; + char * canonical = 0; + + LT_DLMUTEX_LOCK (); + + if (!search_path || !*search_path) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + goto cleanup; + } + + if (canonicalize_path (search_path, &canonical) != 0) + goto cleanup; + + if (argzize_path (canonical, &argz, &argz_len) != 0) + goto cleanup; + + { + char *dir_name = 0; + while ((dir_name = argz_next (argz, argz_len, dir_name))) + { + int lendir = LT_STRLEN (dir_name); + + if (lendir +1 +lenbase >= filenamesize) + { + LT_DLFREE (filename); + filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */ + filename = LT_EMALLOC (char, filenamesize); + if (!filename) + goto cleanup; + } + + strncpy (filename, dir_name, lendir); + if (base_name && *base_name) + { + if (filename[lendir -1] != '/') + filename[lendir++] = '/'; + strcpy (filename +lendir, base_name); + } + + if ((result = (*func) (filename, data1, data2))) + { + break; + } + } + } + + cleanup: + LT_DLFREE (argz); + LT_DLFREE (canonical); + LT_DLFREE (filename); + + LT_DLMUTEX_UNLOCK (); + + return result; +} + +/* If FILEPATH can be opened, store the name of the directory component + in DATA1, and the opened FILE* structure address in DATA2. Otherwise + DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ +static int +find_file_callback (filename, data1, data2) + char *filename; + lt_ptr data1; + lt_ptr data2; +{ + char **pdir = (char **) data1; + FILE **pfile = (FILE **) data2; + int is_done = 0; + + assert (filename && *filename); + assert (pdir); + assert (pfile); + + if ((*pfile = fopen (filename, LT_READTEXT_MODE))) + { + char *dirend = strrchr (filename, '/'); + + if (dirend > filename) + *dirend = LT_EOS_CHAR; + + LT_DLFREE (*pdir); + *pdir = lt_estrdup (filename); + is_done = (*pdir == 0) ? -1 : 1; + } + + return is_done; +} + +static FILE * +find_file (search_path, base_name, pdir) + const char *search_path; + const char *base_name; + char **pdir; +{ + FILE *file = 0; + + foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); + + return file; +} + +static int +find_handle_callback (filename, data, ignored) + char *filename; + lt_ptr data; + lt_ptr ignored; +{ + lt_dlhandle *handle = (lt_dlhandle *) data; + int found = access (filename, R_OK); + + /* Bail out if file cannot be read... */ + if (!found) + return 0; + + /* Try to dlopen the file, but do not continue searching in any + case. */ + if (tryall_dlopen (handle, filename) != 0) + *handle = 0; + + return 1; +} + +/* If HANDLE was found return it, otherwise return 0. If HANDLE was + found but could not be opened, *HANDLE will be set to 0. */ +static lt_dlhandle * +find_handle (search_path, base_name, handle) + const char *search_path; + const char *base_name; + lt_dlhandle *handle; +{ + if (!search_path) + return 0; + + if (!foreach_dirinpath (search_path, base_name, find_handle_callback, + handle, 0)) + return 0; + + return handle; +} + +static int +load_deplibs (handle, deplibs) + lt_dlhandle handle; + char *deplibs; +{ +#if LTDL_DLOPEN_DEPLIBS + char *p, *save_search_path = 0; + int depcount = 0; + int i; + char **names = 0; +#endif + int errors = 0; + + handle->depcount = 0; + +#if LTDL_DLOPEN_DEPLIBS + if (!deplibs) + { + return errors; + } + ++errors; + + LT_DLMUTEX_LOCK (); + if (user_search_path) + { + save_search_path = lt_estrdup (user_search_path); + if (!save_search_path) + goto cleanup; + } + + /* extract search paths and count deplibs */ + p = deplibs; + while (*p) + { + if (!isspace ((int) *p)) + { + char *end = p+1; + while (*end && !isspace((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) + { + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (lt_dladdsearchdir(p+2)) + { + goto cleanup; + } + *end = save; + } + else + { + ++depcount; + } + + p = end; + } + else + { + ++p; + } + } + + /* restore the old search path */ + LT_DLFREE (user_search_path); + user_search_path = save_search_path; + + LT_DLMUTEX_UNLOCK (); + + if (!depcount) + { + errors = 0; + goto cleanup; + } + + names = LT_EMALLOC (char *, depcount * sizeof (char*)); + if (!names) + goto cleanup; + + /* now only extract the actual deplibs */ + depcount = 0; + p = deplibs; + while (*p) + { + if (isspace ((int) *p)) + { + ++p; + } + else + { + char *end = p+1; + while (*end && !isspace ((int) *end)) + { + ++end; + } + + if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) + { + char *name; + char save = *end; + *end = 0; /* set a temporary string terminator */ + if (strncmp(p, "-l", 2) == 0) + { + size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); + name = LT_EMALLOC (char, 1+ name_len); + if (name) + sprintf (name, "lib%s", p+2); + } + else + name = lt_estrdup(p); + + if (!name) + goto cleanup_names; + + names[depcount++] = name; + *end = save; + } + p = end; + } + } + + /* load the deplibs (in reverse order) + At this stage, don't worry if the deplibs do not load correctly, + they may already be statically linked into the loading application + for instance. There will be a more enlightening error message + later on if the loaded module cannot resolve all of its symbols. */ + if (depcount) + { + int j = 0; + + handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount); + if (!handle->deplibs) + goto cleanup; + + for (i = 0; i < depcount; ++i) + { + handle->deplibs[j] = lt_dlopenext(names[depcount-1-i]); + if (handle->deplibs[j]) + { + ++j; + } + } + + handle->depcount = j; /* Number of successfully loaded deplibs */ + errors = 0; + } + + cleanup_names: + for (i = 0; i < depcount; ++i) + { + LT_DLFREE (names[i]); + } + + cleanup: + LT_DLFREE (names); +#endif + + return errors; +} + +static int +unload_deplibs (handle) + lt_dlhandle handle; +{ + int i; + int errors = 0; + + if (handle->depcount) + { + for (i = 0; i < handle->depcount; ++i) + { + if (!LT_DLIS_RESIDENT (handle->deplibs[i])) + { + errors += lt_dlclose (handle->deplibs[i]); + } + } + } + + return errors; +} + +static int +trim (dest, str) + char **dest; + const char *str; +{ + /* remove the leading and trailing "'" from str + and store the result in dest */ + const char *end = strrchr (str, '\''); + int len = LT_STRLEN (str); + char *tmp; + + LT_DLFREE (*dest); + + if (len > 3 && str[0] == '\'') + { + tmp = LT_EMALLOC (char, end - str); + if (!tmp) + return 1; + + strncpy(tmp, &str[1], (end - str) - 1); + tmp[len-3] = LT_EOS_CHAR; + *dest = tmp; + } + else + { + *dest = 0; + } + + return 0; +} + +static int +free_vars (dlname, oldname, libdir, deplibs) + char *dlname; + char *oldname; + char *libdir; + char *deplibs; +{ + LT_DLFREE (dlname); + LT_DLFREE (oldname); + LT_DLFREE (libdir); + LT_DLFREE (deplibs); + + return 0; +} + +int +try_dlopen (phandle, filename) + lt_dlhandle *phandle; + const char *filename; +{ + const char * ext = 0; + const char * saved_error = 0; + char * canonical = 0; + char * base_name = 0; + char * dir = 0; + char * name = 0; + int errors = 0; + lt_dlhandle newhandle; + + assert (phandle); + assert (*phandle == 0); + + LT_DLMUTEX_GETERROR (saved_error); + puts("3.1"); + /* dlopen self? */ + if (!filename) + { + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + return 1; + + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* lt_dlclose()ing yourself is very bad! Disallow it. */ + LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG); + + if (tryall_dlopen (&newhandle, 0) != 0) + { + LT_DLFREE (*phandle); + return 1; + } + + goto register_handle; + } + puts("3.2"); + + assert (filename && *filename); + + /* Doing this immediately allows internal functions to safely + assume only canonicalized paths are passed. */ + if (canonicalize_path (filename, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + puts("3.3"); + /* If the canonical module name is a path (relative or absolute) + then split it into a directory part and a name part. */ + base_name = strrchr (canonical, '/'); + if (base_name) + { + size_t dirlen = (1+ base_name) - canonical; + + dir = LT_EMALLOC (char, 1+ dirlen); + if (!dir) + { + ++errors; + goto cleanup; + } + + puts("3.4"); + strncpy (dir, canonical, dirlen); + dir[dirlen] = LT_EOS_CHAR; + + ++base_name; + } + else + LT_DLMEM_REASSIGN (base_name, canonical); + + puts("3.5"); + assert (base_name && *base_name); + + /* Check whether we are opening a libtool module (.la extension). */ + ext = strrchr (base_name, '.'); + printf("ext=%s,archive_ext=%s\n", ext, archive_ext); + if (ext && strcmp (ext, archive_ext) == 0) + { + /* this seems to be a libtool module */ + FILE * file = 0; + char * dlname = 0; + char * old_name = 0; + char * libdir = 0; + char * deplibs = 0; + char * line = 0; + size_t line_len; + int i; + + /* if we can't find the installed flag, it is probably an + installed libtool archive, produced with an old version + of libtool */ + int installed = 1; + + /* extract the module name from the file name */ + name = LT_EMALLOC (char, ext - base_name + 1); + if (!name) + { + ++errors; + goto cleanup; + } + + puts("3.6"); + + /* canonicalize the module name */ + for (i = 0; i < ext - base_name; ++i) + { + if (isalnum ((int)(base_name[i]))) + { + name[i] = base_name[i]; + } + else + { + name[i] = '_'; + } + } + name[ext - base_name] = LT_EOS_CHAR; + + /* Now try to open the .la file. If there is no directory name + component, try to find it first in user_search_path and then other + prescribed paths. Otherwise (or in any case if the module was not + yet found) try opening just the module name as passed. */ + if (!dir) + { + const char *search_path; + + LT_DLMUTEX_LOCK (); + search_path = user_search_path; + if (search_path) + file = find_file (user_search_path, base_name, &dir); + LT_DLMUTEX_UNLOCK (); + + if (!file) + { + search_path = getenv (LTDL_SEARCHPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!file) + { + search_path = getenv (LTDL_SHLIBPATH_VAR); + if (search_path) + file = find_file (search_path, base_name, &dir); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!file && sys_search_path) + { + file = find_file (sys_search_path, base_name, &dir); + } +#endif + } + if (!file) + { + file = fopen (filename, LT_READTEXT_MODE); + } + + /* If we didn't find the file by now, it really isn't there. Set + the status flag, and bail out. */ + if (!file) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + ++errors; + goto cleanup; + } + + puts("3.7"); + line_len = LT_FILENAME_MAX; + line = LT_EMALLOC (char, line_len); + if (!line) + { + fclose (file); + ++errors; + goto cleanup; + } + + puts("3.8"); + /* read the .la file */ + while (!feof (file)) + { + if (!fgets (line, line_len, file)) + { + break; + } + + /* Handle the case where we occasionally need to read a line + that is longer than the initial buffer size. */ + while (line[LT_STRLEN(line) -1] != '\n') + { + line = LT_DLREALLOC (char, line, line_len *2); + if (!fgets (&line[line_len -1], line_len +1, file)) + { + break; + } + line_len *= 2; + } + + if (line[0] == '\n' || line[0] == '#') + { + continue; + } + +#undef STR_DLNAME +#define STR_DLNAME "dlname=" + if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) + { + errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]); + } + +#undef STR_OLD_LIBRARY +#define STR_OLD_LIBRARY "old_library=" + else if (strncmp (line, STR_OLD_LIBRARY, + sizeof (STR_OLD_LIBRARY) - 1) == 0) + { + errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); + } +#undef STR_LIBDIR +#define STR_LIBDIR "libdir=" + else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) + { + errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]); + } + +#undef STR_DL_DEPLIBS +#define STR_DL_DEPLIBS "dependency_libs=" + else if (strncmp (line, STR_DL_DEPLIBS, + sizeof (STR_DL_DEPLIBS) - 1) == 0) + { + errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); + } + else if (strcmp (line, "installed=yes\n") == 0) + { + installed = 1; + } + else if (strcmp (line, "installed=no\n") == 0) + { + installed = 0; + } + +#undef STR_LIBRARY_NAMES +#define STR_LIBRARY_NAMES "library_names=" + else if (! dlname && strncmp (line, STR_LIBRARY_NAMES, + sizeof (STR_LIBRARY_NAMES) - 1) == 0) + { + char *last_libname; + errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); + if (!errors + && dlname + && (last_libname = strrchr (dlname, ' ')) != 0) + { + last_libname = lt_estrdup (last_libname + 1); + if (!last_libname) + { + ++errors; + goto cleanup; + } + LT_DLMEM_REASSIGN (dlname, last_libname); + } + } + + puts("3.9"); + + if (errors) + break; + } + + fclose (file); + LT_DLFREE (line); + + /* allocate the handle */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + ++errors; + puts("3.10"); + + if (errors) + { + free_vars (dlname, old_name, libdir, deplibs); + LT_DLFREE (*phandle); + goto cleanup; + } + + assert (*phandle); + + puts("3.11"); + memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); + if (load_deplibs (*phandle, deplibs) == 0) + { + puts("3.11.1"); + newhandle = *phandle; + /* find_module may replace newhandle */ + if (find_module (&newhandle, dir, libdir, dlname, old_name, installed)) + { + puts("3.11.2"); + unload_deplibs (*phandle); + ++errors; + } + } + else + { + ++errors; + } + puts("3.12"); + + free_vars (dlname, old_name, libdir, deplibs); + if (errors) + { + LT_DLFREE (*phandle); + goto cleanup; + } + + puts("3.13"); + if (*phandle != newhandle) + { + unload_deplibs (*phandle); + } + } + else + { + /* not a libtool module */ + *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); + if (*phandle == 0) + { + ++errors; + goto cleanup; + } + + memset (*phandle, 0, sizeof (struct lt_dlhandle_struct)); + newhandle = *phandle; + + /* If the module has no directory name component, try to find it + first in user_search_path and then other prescribed paths. + Otherwise (or in any case if the module was not yet found) try + opening just the module name as passed. */ + if ((dir || (!find_handle (user_search_path, base_name, &newhandle) + && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, + &newhandle) +#ifdef LTDL_SHLIBPATH_VAR + && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name, + &newhandle) +#endif +#ifdef LTDL_SYSSEARCHPATH + && !find_handle (sys_search_path, base_name, &newhandle) +#endif + ))) + { + tryall_dlopen (&newhandle, filename); + } + + puts("3.14"); + if (!newhandle) + { + LT_DLFREE (*phandle); + ++errors; + goto cleanup; + } + } + + puts("3.15"); + register_handle: + LT_DLMEM_REASSIGN (*phandle, newhandle); + + if ((*phandle)->info.ref_count == 0) + { + (*phandle)->info.ref_count = 1; + LT_DLMEM_REASSIGN ((*phandle)->info.name, name); + + LT_DLMUTEX_LOCK (); + (*phandle)->next = handles; + handles = *phandle; + LT_DLMUTEX_UNLOCK (); + } + + LT_DLMUTEX_SETERROR (saved_error); + puts("3.16"); + + cleanup: + LT_DLFREE (dir); + LT_DLFREE (name); + LT_DLFREE (canonical); + puts("3.17"); + + return errors; +} + +lt_dlhandle +lt_dlopen (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + + /* Just incase we missed a code path in try_dlopen() that reports + an error, but forgets to reset handle... */ + if (try_dlopen (&handle, filename) != 0) + return 0; + + return handle; +} + +/* If the last error messge store was `FILE_NOT_FOUND', then return + non-zero. */ +int +file_not_found () +{ + const char *error = 0; + + LT_DLMUTEX_GETERROR (error); + if (error == LT_DLSTRERROR (FILE_NOT_FOUND)) + return 1; + + return 0; +} + +/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to + open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, + and if a file is still not found try again with SHLIB_EXT appended + instead. */ +lt_dlhandle +lt_dlopenext (filename) + const char *filename; +{ + lt_dlhandle handle = 0; + char * tmp = 0; + char * ext = 0; + int len; + int errors = 0; + int file_found = 1; /* until proven otherwise */ + + if (!filename) + { + return lt_dlopen (filename); + } + + assert (filename); + puts("step.1"); + len = LT_STRLEN (filename); + ext = strrchr (filename, '.'); + + /* If FILENAME already bears a suitable extension, there is no need + to try appending additional extensions. */ + if (ext && ((strcmp (ext, archive_ext) == 0) +#ifdef LTDL_SHLIB_EXT + || (strcmp (ext, shlib_ext) == 0) +#endif + )) + { + return lt_dlopen (filename); + } + + puts("step.2"); + /* First try appending ARCHIVE_EXT. */ + tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1); + if (!tmp) + return 0; + + puts("step.3"); + strcpy (tmp, filename); + strcat (tmp, archive_ext); + errors = try_dlopen (&handle, tmp); + printf("tmp = %s, handle = %p\n", tmp, handle); + puts("step.4"); + + /* If we found FILENAME, stop searching -- whether we were able to + load the file as a module or not. If the file exists but loading + failed, it is better to return an error message here than to + report FILE_NOT_FOUND when the alternatives (foo.so etc) are not + in the module search path. */ + if (handle || ((errors > 0) && file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } + + puts("step.5"); +#ifdef LTDL_SHLIB_EXT + /* Try appending SHLIB_EXT. */ + if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) + { + LT_DLFREE (tmp); + tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1); + if (!tmp) + return 0; + + strcpy (tmp, filename); + } + else + { + tmp[len] = LT_EOS_CHAR; + } + + puts("step.6"); + strcat(tmp, shlib_ext); + errors = try_dlopen (&handle, tmp); + + puts("step.7"); + /* As before, if the file was found but loading failed, return now + with the current error message. */ + if (handle || ((errors > 0) && file_not_found ())) + { + LT_DLFREE (tmp); + return handle; + } +#endif + + puts("step.8"); + /* Still here? Then we really did fail to locate any of the file + names we tried. */ + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); + LT_DLFREE (tmp); + return 0; +} + + +int +lt_argz_insert (pargz, pargz_len, before, entry) + char **pargz; + size_t *pargz_len; + char *before; + const char *entry; +{ + error_t error; + + if ((error = argz_insert (pargz, pargz_len, before, entry))) + { + switch (error) + { + case ENOMEM: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); + break; + default: + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); + break; + } + return 1; + } + + return 0; +} + +int +lt_argz_insertinorder (pargz, pargz_len, entry) + char **pargz; + size_t *pargz_len; + const char *entry; +{ + char *before = 0; + + assert (pargz); + assert (pargz_len); + assert (entry && *entry); + + if (*pargz) + while ((before = argz_next (*pargz, *pargz_len, before))) + { + int cmp = strcmp (entry, before); + + if (cmp < 0) break; + if (cmp == 0) return 0; /* No duplicates! */ + } + + return lt_argz_insert (pargz, pargz_len, before, entry); +} + +int +lt_argz_insertdir (pargz, pargz_len, dirnam, dp) + char **pargz; + size_t *pargz_len; + const char *dirnam; + struct dirent *dp; +{ + char *buf = 0; + size_t buf_len = 0; + char *end = 0; + size_t end_offset = 0; + size_t dir_len = 0; + int errors = 0; + + assert (pargz); + assert (pargz_len); + assert (dp); + + dir_len = LT_STRLEN (dirnam); + end = dp->d_name + LT_D_NAMLEN(dp); + + /* Ignore version numbers. */ + { + char *p; + for (p = end; p -1 > dp->d_name; --p) + if (strchr (".0123456789", p[-1]) == 0) + break; + + if (*p == '.') + end = p; + } + + /* Ignore filename extension. */ + { + char *p; + for (p = end -1; p > dp->d_name; --p) + if (*p == '.') + { + end = p; + break; + } + } + + /* Prepend the directory name. */ + end_offset = end - dp->d_name; + buf_len = dir_len + 1+ end_offset; + buf = LT_EMALLOC (char, 1+ buf_len); + if (!buf) + return ++errors; + + assert (buf); + + strcpy (buf, dirnam); + strcat (buf, "/"); + strncat (buf, dp->d_name, end_offset); + buf[buf_len] = LT_EOS_CHAR; + + /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ + if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) + ++errors; + + LT_DLFREE (buf); + + return errors; +} + +int +list_files_by_dir (dirnam, pargz, pargz_len) + const char *dirnam; + char **pargz; + size_t *pargz_len; +{ + DIR *dirp = 0; + int errors = 0; + + assert (dirnam && *dirnam); + assert (pargz); + assert (pargz_len); + assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); + + dirp = opendir (dirnam); + if (dirp) + { + struct dirent *dp = 0; + + while ((dp = readdir (dirp))) + if (dp->d_name[0] != '.') + if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) + { + ++errors; + break; + } + + closedir (dirp); + } + else + ++errors; + + return errors; +} + + +/* If there are any files in DIRNAME, call the function passed in + DATA1 (with the name of each file and DATA2 as arguments). */ +static int +foreachfile_callback (dirname, data1, data2) + char *dirname; + lt_ptr data1; + lt_ptr data2; +{ + int (*func) LT_PARAMS((const char *filename, lt_ptr data)) + = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1; + + int is_done = 0; + char *argz = 0; + size_t argz_len = 0; + + if (list_files_by_dir (dirname, &argz, &argz_len) != 0) + goto cleanup; + if (!argz) + goto cleanup; + + { + char *filename = 0; + while ((filename = argz_next (argz, argz_len, filename))) + if ((is_done = (*func) (filename, data2))) + break; + } + + cleanup: + LT_DLFREE (argz); + + return is_done; +} + + +/* Call FUNC for each unique extensionless file in SEARCH_PATH, along + with DATA. The filenames passed to FUNC would be suitable for + passing to lt_dlopenext. The extensions are stripped so that + individual modules do not generate several entries (e.g. libfoo.la, + libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, + then the same directories that lt_dlopen would search are examined. */ +int +lt_dlforeachfile (search_path, func, data) + const char *search_path; + int (*func) LT_PARAMS ((const char *filename, lt_ptr data)); + lt_ptr data; +{ + int is_done = 0; + + if (search_path) + { + /* If a specific path was passed, search only the directories + listed in it. */ + is_done = foreach_dirinpath (search_path, 0, + foreachfile_callback, func, data); + } + else + { + /* Otherwise search the default paths. */ + is_done = foreach_dirinpath (user_search_path, 0, + foreachfile_callback, func, data); + if (!is_done) + { + is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0, + foreachfile_callback, func, data); + } + +#ifdef LTDL_SHLIBPATH_VAR + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0, + foreachfile_callback, func, data); + } +#endif +#ifdef LTDL_SYSSEARCHPATH + if (!is_done) + { + is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0, + foreachfile_callback, func, data); + } +#endif + } + + return is_done; +} + +int +lt_dlclose (handle) + lt_dlhandle handle; +{ + lt_dlhandle cur, last; + int errors = 0; + + LT_DLMUTEX_LOCK (); + + /* check whether the handle is valid */ + last = cur = handles; + while (cur && handle != cur) + { + last = cur; + cur = cur->next; + } + + if (!cur) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + goto done; + } + + handle->info.ref_count--; + + /* Note that even with resident modules, we must track the ref_count + correctly incase the user decides to reset the residency flag + later (even though the API makes no provision for that at the + moment). */ + if (handle->info.ref_count <= 0 && !LT_DLIS_RESIDENT (handle)) + { + lt_user_data data = handle->loader->dlloader_data; + + if (handle != handles) + { + last->next = handle->next; + } + else + { + handles = handle->next; + } + + errors += handle->loader->module_close (data, handle->module); + errors += unload_deplibs(handle); + + LT_DLFREE (handle->info.filename); + LT_DLFREE (handle->info.name); + LT_DLFREE (handle); + + goto done; + } + + if (LT_DLIS_RESIDENT (handle)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE)); + ++errors; + } + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_ptr +lt_dlsym (handle, symbol) + lt_dlhandle handle; + const char *symbol; +{ + int lensym; + char lsym[LT_SYMBOL_LENGTH]; + char *sym; + lt_ptr address; + lt_user_data data; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + if (!symbol) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); + return 0; + } + + lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix) + + LT_STRLEN (handle->info.name); + + if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) + { + sym = lsym; + } + else + { + sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); + if (!sym) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); + return 0; + } + } + + data = handle->loader->dlloader_data; + if (handle->info.name) + { + const char *saved_error; + + LT_DLMUTEX_GETERROR (saved_error); + + /* this is a libtool module */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, handle->info.name); + } + else + { + strcpy(sym, handle->info.name); + } + + strcat(sym, "_LTX_"); + strcat(sym, symbol); + + /* try "modulename_LTX_symbol" */ + address = handle->loader->find_sym (data, handle->module, sym); + if (address) + { + if (sym != lsym) + { + LT_DLFREE (sym); + } + return address; + } + LT_DLMUTEX_SETERROR (saved_error); + } + + /* otherwise try "symbol" */ + if (handle->loader->sym_prefix) + { + strcpy(sym, handle->loader->sym_prefix); + strcat(sym, symbol); + } + else + { + strcpy(sym, symbol); + } + + address = handle->loader->find_sym (data, handle->module, sym); + if (sym != lsym) + { + LT_DLFREE (sym); + } + + return address; +} + +const char * +lt_dlerror () +{ + const char *error; + + LT_DLMUTEX_GETERROR (error); + LT_DLMUTEX_SETERROR (0); + + return error ? error : LT_DLSTRERROR (UNKNOWN); +} + +int +lt_dlpath_insertdir (ppath, before, dir) + char **ppath; + char *before; + const char *dir; +{ + int errors = 0; + char *canonical = 0; + char *argz = 0; + size_t argz_len = 0; + + assert (ppath); + assert (dir && *dir); + + if (canonicalize_path (dir, &canonical) != 0) + { + ++errors; + goto cleanup; + } + + assert (canonical && *canonical); + + /* If *PPATH is empty, set it to DIR. */ + if (*ppath == 0) + { + assert (!before); /* BEFORE cannot be set without PPATH. */ + assert (dir); /* Without DIR, don't call this function! */ + + *ppath = lt_estrdup (dir); + if (*ppath == 0) + ++errors; + + return errors; + } + + assert (ppath && *ppath); + + if (argzize_path (*ppath, &argz, &argz_len) != 0) + { + ++errors; + goto cleanup; + } + + /* Convert BEFORE into an equivalent offset into ARGZ. This only works + if *PPATH is already canonicalized, and hence does not change length + with respect to ARGZ. We canonicalize each entry as it is added to + the search path, and don't call this function with (uncanonicalized) + user paths, so this is a fair assumption. */ + if (before) + { + assert (*ppath <= before); + assert (before - *ppath <= strlen (*ppath)); + + before = before - *ppath + argz; + } + + if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) + { + ++errors; + goto cleanup; + } + + argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); + LT_DLMEM_REASSIGN (*ppath, argz); + + cleanup: + LT_DLFREE (canonical); + LT_DLFREE (argz); + + return errors; +} + +int +lt_dladdsearchdir (search_dir) + const char *search_dir; +{ + int errors = 0; + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlinsertsearchdir (before, search_dir) + const char *before; + const char *search_dir; +{ + int errors = 0; + + if (before) + { + LT_DLMUTEX_LOCK (); + if ((before < user_search_path) + || (before >= user_search_path + LT_STRLEN (user_search_path))) + { + LT_DLMUTEX_UNLOCK (); + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION)); + return 1; + } + LT_DLMUTEX_UNLOCK (); + } + + if (search_dir && *search_dir) + { + LT_DLMUTEX_LOCK (); + if (lt_dlpath_insertdir (&user_search_path, + (char *) before, search_dir) != 0) + { + ++errors; + } + LT_DLMUTEX_UNLOCK (); + } + + return errors; +} + +int +lt_dlsetsearchpath (search_path) + const char *search_path; +{ + int errors = 0; + + LT_DLMUTEX_LOCK (); + LT_DLFREE (user_search_path); + LT_DLMUTEX_UNLOCK (); + + if (!search_path || !LT_STRLEN (search_path)) + { + return errors; + } + + LT_DLMUTEX_LOCK (); + if (canonicalize_path (search_path, &user_search_path) != 0) + ++errors; + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +const char * +lt_dlgetsearchpath () +{ + const char *saved_path; + + LT_DLMUTEX_LOCK (); + saved_path = user_search_path; + LT_DLMUTEX_UNLOCK (); + + return saved_path; +} + +int +lt_dlmakeresident (handle) + lt_dlhandle handle; +{ + int errors = 0; + + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + ++errors; + } + else + { + LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG); + } + + return errors; +} + +int +lt_dlisresident (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return -1; + } + + return LT_DLIS_RESIDENT (handle); +} + + + + +/* --- MODULE INFORMATION --- */ + +const lt_dlinfo * +lt_dlgetinfo (handle) + lt_dlhandle handle; +{ + if (!handle) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); + return 0; + } + + return &(handle->info); +} + +lt_dlhandle +lt_dlhandle_next (place) + lt_dlhandle place; +{ + return place ? place->next : handles; +} + +int +lt_dlforeach (func, data) + int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data)); + lt_ptr data; +{ + int errors = 0; + lt_dlhandle cur; + + LT_DLMUTEX_LOCK (); + + cur = handles; + while (cur) + { + lt_dlhandle tmp = cur; + + cur = cur->next; + if ((*func) (tmp, data)) + { + ++errors; + break; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlcaller_id +lt_dlcaller_register () +{ + static lt_dlcaller_id last_caller_id = 0; + int result; + + LT_DLMUTEX_LOCK (); + result = ++last_caller_id; + LT_DLMUTEX_UNLOCK (); + + return result; +} + +lt_ptr +lt_dlcaller_set_data (key, handle, data) + lt_dlcaller_id key; + lt_dlhandle handle; + lt_ptr data; +{ + int n_elements = 0; + lt_ptr stale = (lt_ptr) 0; + int i; + + /* This needs to be locked so that the caller data can be updated + simultaneously by different threads. */ + LT_DLMUTEX_LOCK (); + + if (handle->caller_data) + while (handle->caller_data[n_elements].key) + ++n_elements; + + for (i = 0; i < n_elements; ++i) + { + if (handle->caller_data[i].key == key) + { + stale = handle->caller_data[i].data; + break; + } + } + + /* Ensure that there is enough room in this handle's caller_data + array to accept a new element (and an empty end marker). */ + if (i == n_elements) + { + lt_caller_data *temp + = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements); + + if (!temp) + { + stale = 0; + goto done; + } + + handle->caller_data = temp; + + /* We only need this if we needed to allocate a new caller_data. */ + handle->caller_data[i].key = key; + handle->caller_data[1+ i].key = 0; + } + + handle->caller_data[i].data = data; + + done: + LT_DLMUTEX_UNLOCK (); + + return stale; +} + +lt_ptr +lt_dlcaller_get_data (key, handle) + lt_dlcaller_id key; + lt_dlhandle handle; +{ + lt_ptr result = (lt_ptr) 0; + + /* This needs to be locked so that the caller data isn't updated by + another thread part way through this function. */ + LT_DLMUTEX_LOCK (); + + /* Locate the index of the element with a matching KEY. */ + { + int i; + for (i = 0; handle->caller_data[i].key; ++i) + { + if (handle->caller_data[i].key == key) + { + result = handle->caller_data[i].data; + break; + } + } + } + + LT_DLMUTEX_UNLOCK (); + + return result; +} + + + +/* --- USER MODULE LOADER API --- */ + + +int +lt_dlloader_add (place, dlloader, loader_name) + lt_dlloader *place; + const struct lt_user_dlloader *dlloader; + const char *loader_name; +{ + int errors = 0; + lt_dlloader *node = 0, *ptr = 0; + + if ((dlloader == 0) /* diagnose null parameters */ + || (dlloader->module_open == 0) + || (dlloader->module_close == 0) + || (dlloader->find_sym == 0)) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + /* Create a new dlloader node with copies of the user callbacks. */ + node = LT_EMALLOC (lt_dlloader, 1); + if (!node) + return 1; + + node->next = 0; + node->loader_name = loader_name; + node->sym_prefix = dlloader->sym_prefix; + node->dlloader_exit = dlloader->dlloader_exit; + node->module_open = dlloader->module_open; + node->module_close = dlloader->module_close; + node->find_sym = dlloader->find_sym; + node->dlloader_data = dlloader->dlloader_data; + + LT_DLMUTEX_LOCK (); + if (!loaders) + { + /* If there are no loaders, NODE becomes the list! */ + loaders = node; + } + else if (!place) + { + /* If PLACE is not set, add NODE to the end of the + LOADERS list. */ + for (ptr = loaders; ptr->next; ptr = ptr->next) + { + /*NOWORK*/; + } + + ptr->next = node; + } + else if (loaders == place) + { + /* If PLACE is the first loader, NODE goes first. */ + node->next = place; + loaders = node; + } + else + { + /* Find the node immediately preceding PLACE. */ + for (ptr = loaders; ptr->next != place; ptr = ptr->next) + { + /*NOWORK*/; + } + + if (ptr->next != place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + ++errors; + } + else + { + /* Insert NODE between PTR and PLACE. */ + node->next = place; + ptr->next = node; + } + } + + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +int +lt_dlloader_remove (loader_name) + const char *loader_name; +{ + lt_dlloader *place = lt_dlloader_find (loader_name); + lt_dlhandle handle; + int errors = 0; + + if (!place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + return 1; + } + + LT_DLMUTEX_LOCK (); + + /* Fail if there are any open modules which use this loader. */ + for (handle = handles; handle; handle = handle->next) + { + if (handle->loader == place) + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER)); + ++errors; + goto done; + } + } + + if (place == loaders) + { + /* PLACE is the first loader in the list. */ + loaders = loaders->next; + } + else + { + /* Find the loader before the one being removed. */ + lt_dlloader *prev; + for (prev = loaders; prev->next; prev = prev->next) + { + if (!strcmp (prev->next->loader_name, loader_name)) + { + break; + } + } + + place = prev->next; + prev->next = prev->next->next; + } + + if (place->dlloader_exit) + { + errors = place->dlloader_exit (place->dlloader_data); + } + + LT_DLFREE (place); + + done: + LT_DLMUTEX_UNLOCK (); + + return errors; +} + +lt_dlloader * +lt_dlloader_next (place) + lt_dlloader *place; +{ + lt_dlloader *next; + + LT_DLMUTEX_LOCK (); + next = place ? place->next : loaders; + LT_DLMUTEX_UNLOCK (); + + return next; +} + +const char * +lt_dlloader_name (place) + lt_dlloader *place; +{ + const char *name = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + name = place ? place->loader_name : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return name; +} + +lt_user_data * +lt_dlloader_data (place) + lt_dlloader *place; +{ + lt_user_data *data = 0; + + if (place) + { + LT_DLMUTEX_LOCK (); + data = place ? &(place->dlloader_data) : 0; + LT_DLMUTEX_UNLOCK (); + } + else + { + LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); + } + + return data; +} + +lt_dlloader * +lt_dlloader_find (loader_name) + const char *loader_name; +{ + lt_dlloader *place = 0; + + LT_DLMUTEX_LOCK (); + for (place = loaders; place; place = place->next) + { + if (strcmp (place->loader_name, loader_name) == 0) + { + break; + } + } + LT_DLMUTEX_UNLOCK (); + + return place; +} diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h new file mode 100644 index 0000000..8aaf342 --- /dev/null +++ b/libltdl/ltdl.h @@ -0,0 +1,366 @@ +/* ltdl.h -- generic dlopen functions + Copyright (C) 1998-2000 Free Software Foundation, Inc. + Originally by Thomas Tanner + This file is part of GNU Libtool. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU libtool, you may include it under the same +distribution terms that you use for the rest of that program. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free +Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA +*/ + +/* Only include this header file once. */ +#ifndef LTDL_H +#define LTDL_H 1 + +#include /* for size_t declaration */ + + +/* --- MACROS FOR PORTABILITY --- */ + + +/* Saves on those hard to debug '\0' typos.... */ +#define LT_EOS_CHAR '\0' + +/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, + so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at + the end of C declarations. */ +#ifdef __cplusplus +# define LT_BEGIN_C_DECLS extern "C" { +# define LT_END_C_DECLS } +#else +# define LT_BEGIN_C_DECLS /* empty */ +# define LT_END_C_DECLS /* empty */ +#endif + +LT_BEGIN_C_DECLS + + +/* LT_PARAMS is a macro used to wrap function prototypes, so that compilers + that don't understand ANSI C prototypes still work, and ANSI C + compilers can issue warnings about type mismatches. */ +#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus) +# define LT_PARAMS(protos) protos +# define lt_ptr void* +#else +# define LT_PARAMS(protos) () +# define lt_ptr char* +#endif + +/* LT_STMT_START/END are used to create macros which expand to a + a single compound statement in a portable way. */ +#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) +# define LT_STMT_START (void)( +# define LT_STMT_END ) +#else +# if (defined (sun) || defined (__sun__)) +# define LT_STMT_START if (1) +# define LT_STMT_END else (void)0 +# else +# define LT_STMT_START do +# define LT_STMT_END while (0) +# endif +#endif + +/* LT_CONC creates a new concatenated symbol for the compiler + in a portable way. */ +#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) +# define LT_CONC(s,t) s##t +#else +# define LT_CONC(s,t) s/**/t +#endif + +/* LT_STRLEN can be used safely on NULL pointers. */ +#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) + + + +/* --- WINDOWS SUPPORT --- */ + + +/* Canonicalise Windows and Cygwin recognition macros. */ +#ifdef __CYGWIN32__ +# ifndef __CYGWIN__ +# define __CYGWIN__ __CYGWIN32__ +# endif +#endif +#if defined(_WIN32) || defined(WIN32) +# ifndef __WINDOWS__ +# ifdef _WIN32 +# define __WINDOWS__ _WIN32 +# else +# ifdef WIN32 +# define __WINDOWS__ WIN32 +# endif +# endif +# endif +#endif + + +#ifdef __WINDOWS__ +# ifndef __CYGWIN__ +/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory + separator when it is set. */ +# define LT_DIRSEP_CHAR '\\' +# define LT_PATHSEP_CHAR ';' +# endif +#endif +#ifndef LT_PATHSEP_CHAR +# define LT_PATHSEP_CHAR ':' +#endif + +/* DLL building support on win32 hosts; mostly to workaround their + ridiculous implementation of data symbol exporting. */ +#ifndef LT_SCOPE +# ifdef __WINDOWS__ +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define LT_SCOPE __declspec(dllexport) +# endif +# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */ +# define LT_SCOPE extern __declspec(dllimport) +# endif +# endif +# ifndef LT_SCOPE /* static linking or !__WINDOWS__ */ +# define LT_SCOPE extern +# endif +#endif + + +#if defined(_MSC_VER) /* Visual Studio */ +# define R_OK 4 +#endif + + + +/* --- DYNAMIC MODULE LOADING API --- */ + + +typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */ + +/* Initialisation and finalisation functions for libltdl. */ +LT_SCOPE int lt_dlinit LT_PARAMS((void)); +LT_SCOPE int lt_dlexit LT_PARAMS((void)); + +/* Module search path manipulation. */ +LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char *search_dir)); +LT_SCOPE int lt_dlinsertsearchdir LT_PARAMS((const char *before, + const char *search_dir)); +LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char *search_path)); +LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void)); +LT_SCOPE int lt_dlforeachfile LT_PARAMS(( + const char *search_path, + int (*func) (const char *filename, lt_ptr data), + lt_ptr data)); + +/* Portable libltdl versions of the system dlopen() API. */ +LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char *filename)); +LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename)); +LT_SCOPE lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle, + const char *name)); +LT_SCOPE const char *lt_dlerror LT_PARAMS((void)); +LT_SCOPE int lt_dlclose LT_PARAMS((lt_dlhandle handle)); + +/* Module residency management. */ +LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle)); +LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle)); + + + + +/* --- MUTEX LOCKING --- */ + + +typedef void lt_dlmutex_lock LT_PARAMS((void)); +typedef void lt_dlmutex_unlock LT_PARAMS((void)); +typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg)); +typedef const char *lt_dlmutex_geterror LT_PARAMS((void)); + +LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock, + lt_dlmutex_unlock *unlock, + lt_dlmutex_seterror *seterror, + lt_dlmutex_geterror *geterror)); + + + + +/* --- MEMORY HANDLING --- */ + + +/* By default, the realloc function pointer is set to our internal + realloc implementation which iself uses lt_dlmalloc and lt_dlfree. + libltdl relies on a featureful realloc, but if you are sure yours + has the right semantics then you can assign it directly. Generally, + it is safe to assign just a malloc() and a free() function. */ +LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)); +LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)); +LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)); + + + + +/* --- PRELOADED MODULE SUPPORT --- */ + + +/* A preopened symbol. Arrays of this type comprise the exported + symbols for a dlpreopened module. */ +typedef struct { + const char *name; + lt_ptr address; +} lt_dlsymlist; + +LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded)); +LT_SCOPE int lt_dlpreload_default + LT_PARAMS((const lt_dlsymlist *preloaded)); + +#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \ + extern const lt_dlsymlist lt_preloaded_symbols[]; \ + lt_dlpreload_default(lt_preloaded_symbols); \ + }LT_STMT_END + + + + +/* --- MODULE INFORMATION --- */ + + +/* Read only information pertaining to a loaded module. */ +typedef struct { + char *filename; /* file name */ + char *name; /* module name */ + int ref_count; /* number of times lt_dlopened minus + number of times lt_dlclosed. */ +} lt_dlinfo; + +LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle)); +LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place)); +LT_SCOPE int lt_dlforeach LT_PARAMS(( + int (*func) (lt_dlhandle handle, lt_ptr data), + lt_ptr data)); + +/* Associating user data with loaded modules. */ +typedef unsigned lt_dlcaller_id; + +LT_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void)); +LT_SCOPE lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key, + lt_dlhandle handle, + lt_ptr data)); +LT_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key, + lt_dlhandle handle)); + + + +/* --- USER MODULE LOADER API --- */ + + +typedef struct lt_dlloader lt_dlloader; +typedef lt_ptr lt_user_data; +typedef lt_ptr lt_module; + +/* Function pointer types for creating user defined module loaders. */ +typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data, + const char *filename)); +typedef int lt_module_close LT_PARAMS((lt_user_data loader_data, + lt_module handle)); +typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data, + lt_module handle, + const char *symbol)); +typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data)); + +struct lt_user_dlloader { + const char *sym_prefix; + lt_module_open *module_open; + lt_module_close *module_close; + lt_find_sym *find_sym; + lt_dlloader_exit *dlloader_exit; + lt_user_data dlloader_data; +}; + +LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place)); +LT_SCOPE lt_dlloader *lt_dlloader_find LT_PARAMS(( + const char *loader_name)); +LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place)); +LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place)); +LT_SCOPE int lt_dlloader_add LT_PARAMS((lt_dlloader *place, + const struct lt_user_dlloader *dlloader, + const char *loader_name)); +LT_SCOPE int lt_dlloader_remove LT_PARAMS(( + const char *loader_name)); + + + +/* --- ERROR MESSAGE HANDLING --- */ + + +/* Defining error strings alongside their symbolic names in a macro in + this way allows us to expand the macro in different contexts with + confidence that the enumeration of symbolic names will map correctly + onto the table of error strings. */ +#define lt_dlerror_table \ + LT_ERROR(UNKNOWN, "unknown error") \ + LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \ + LT_ERROR(INVALID_LOADER, "invalid loader") \ + LT_ERROR(INIT_LOADER, "loader initialization failed") \ + LT_ERROR(REMOVE_LOADER, "loader removal failed") \ + LT_ERROR(FILE_NOT_FOUND, "file not found") \ + LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \ + LT_ERROR(NO_SYMBOLS, "no symbols defined") \ + LT_ERROR(CANNOT_OPEN, "can't open the module") \ + LT_ERROR(CANNOT_CLOSE, "can't close the module") \ + LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \ + LT_ERROR(NO_MEMORY, "not enough memory") \ + LT_ERROR(INVALID_HANDLE, "invalid module handle") \ + LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \ + LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \ + LT_ERROR(SHUTDOWN, "library already shutdown") \ + LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \ + LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \ + LT_ERROR(INVALID_POSITION, "invalid search path insert position") + +/* Enumerate the symbolic error names. */ +enum { +#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), + lt_dlerror_table +#undef LT_ERROR + + LT_ERROR_MAX +}; + +/* These functions are only useful from inside custom module loaders. */ +LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic)); +LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode)); + + + + +/* --- SOURCE COMPATIBILITY WITH OLD LIBLTDL --- */ + + +#ifdef LT_NON_POSIX_NAMESPACE +# define lt_ptr_t lt_ptr +# define lt_module_t lt_module +# define lt_module_open_t lt_module_open +# define lt_module_close_t lt_module_close +# define lt_find_sym_t lt_find_sym +# define lt_dlloader_exit_t lt_dlloader_exit +# define lt_dlloader_t lt_dlloader +# define lt_dlloader_data_t lt_user_data +#endif + +LT_END_C_DECLS + +#endif /* !LTDL_H */ diff --git a/libltdl/ltmain.sh b/libltdl/ltmain.sh new file mode 100644 index 0000000..06823e0 --- /dev/null +++ b/libltdl/ltmain.sh @@ -0,0 +1,6863 @@ +# 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, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +# 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 "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# 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" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + 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$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + 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 (C) 2005 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 $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # 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" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --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 $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# 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 + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + 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 $EXIT_FAILURE + 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= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + 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. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.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 $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE" 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 $EXIT_FAILURE" 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 "$progpath" "$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 $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $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 </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 $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $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 <> ${libobj}T </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 $EXIT_FAILURE + 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 <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + 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 $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_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 | grep "^# 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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + 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 $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + 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 + absdir="$dir" + notinst_path="$notinst_path $dir" + 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*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # 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 + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + 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 ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -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 $EXIT_FAILURE + ;; + 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 + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + 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= + 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 + ;; + + -XCClinker) + prev=xcclinker + 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 | grep "^# 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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $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 $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + 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 + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + 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 $EXIT_FAILURE + ;; + 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 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + 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 + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -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" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $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) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + 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' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + 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 variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # 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 $EXIT_FAILURE + 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" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + 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 $EXIT_FAILURE + 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 + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) 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 + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) 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* | mingw*) + 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'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + 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" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) 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" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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="$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 $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + 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" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + 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/-version-number' 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 shared_ext=\"$shrext_cmds\" + 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 $EXIT_FAILURE + 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 shared_ext=\"$shrext_cmds\" + 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 $EXIT_FAILURE + 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/-version-number' 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. + 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 $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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 $EXIT_FAILURE + 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="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$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" -ne 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 $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $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}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + 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* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + 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 behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </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 + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + 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 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -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 + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$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" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + 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 shared_ext=\"$shrext_cmds\" + 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 -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + 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 + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; 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 + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + 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 "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + 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 + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # 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/$output_la-${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" : ".*" 2>/dev/null` && + 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/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${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\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $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 "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $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 $EXIT_FAILURE + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + 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" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + 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 $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + ;; + + 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 + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + 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/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + 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" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$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. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + 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 $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + 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}%"` + fi + ;; + * ) + 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}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + 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" + exit_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 $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 $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $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 $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --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 + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 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. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following 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 $EXIT_FAILURE + 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 + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + 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 + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + 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 $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + 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 | *mingw*,*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 + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + 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 $EXIT_SUCCESS + ;; + + # 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" | 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) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -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 $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 | grep "^# 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 $EXIT_FAILURE + 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 + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $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 + exit $EXIT_FAILURE + 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. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_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 $EXIT_FAILURE + ;; + 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 $EXIT_SUCCESS + ;; + + *) + # 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 + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + 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= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $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$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + 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 "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + 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. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 | grep "^# 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 environment 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 $EXIT_SUCCESS + 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 $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + 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 | grep "^# 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" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 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. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# 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 + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # 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 $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +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. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +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 + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -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 $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# 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 +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/libltdl/missing b/libltdl/missing new file mode 100755 index 0000000..64b5f90 --- /dev/null +++ b/libltdl/missing @@ -0,0 +1,353 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2004-09-07.08 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, 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 + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit 0 + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit 0 + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + 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 + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/libltdl/mkinstalldirs b/libltdl/mkinstalldirs new file mode 100755 index 0000000..d2d5f21 --- /dev/null +++ b/libltdl/mkinstalldirs @@ -0,0 +1,111 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac + +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 + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: +# mkinstalldirs ends here diff --git a/libltdl/stamp-h.in b/libltdl/stamp-h.in new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/libltdl/stamp-h.in @@ -0,0 +1 @@ +timestamp diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000..06823e0 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,6863 @@ +# 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, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +# 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 "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# 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" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + 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$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + 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 (C) 2005 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 $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # 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" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --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 $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# 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 + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + 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 $EXIT_FAILURE + 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= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + 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. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.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 $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE" 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 $EXIT_FAILURE" 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 "$progpath" "$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 $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $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 </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 $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $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 <> ${libobj}T </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 $EXIT_FAILURE + 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 <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + 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 $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_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 | grep "^# 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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + 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 $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + 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 + absdir="$dir" + notinst_path="$notinst_path $dir" + 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*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # 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 + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + 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 ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -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 $EXIT_FAILURE + ;; + 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 + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + 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= + 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 + ;; + + -XCClinker) + prev=xcclinker + 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 | grep "^# 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 $EXIT_FAILURE + 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 + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $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 $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + 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 + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + 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 $EXIT_FAILURE + ;; + 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 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + 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 + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -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" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $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) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + 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' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + 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 variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # 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 $EXIT_FAILURE + 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" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + 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 $EXIT_FAILURE + 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 + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) 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 + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) 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* | mingw*) + 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'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + 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" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) 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" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + 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="$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 $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + 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" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + 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/-version-number' 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 shared_ext=\"$shrext_cmds\" + 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 $EXIT_FAILURE + 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 shared_ext=\"$shrext_cmds\" + 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 $EXIT_FAILURE + 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/-version-number' 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. + 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 $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + 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 $EXIT_FAILURE + 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="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$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" -ne 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 $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $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}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + 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* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + 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 behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </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 + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + 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 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -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 + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$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" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + 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 shared_ext=\"$shrext_cmds\" + 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 -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + 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 + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; 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 + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + 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 "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + 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 + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # 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/$output_la-${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" : ".*" 2>/dev/null` && + 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/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${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\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $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 "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $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 $EXIT_FAILURE + 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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + 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" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + 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 $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + ;; + + 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 + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + 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/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + 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" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$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. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + 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 $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + 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}%"` + fi + ;; + * ) + 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}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + 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" + exit_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 $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 $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $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 $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --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 + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 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. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following 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 $EXIT_FAILURE + 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 + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + 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 + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + 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 $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + 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 | *mingw*,*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 + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + 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 $EXIT_SUCCESS + ;; + + # 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" | 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) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -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 $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + ;; + 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 | grep "^# 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 $EXIT_FAILURE + 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 + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $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 + exit $EXIT_FAILURE + 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. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_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 $EXIT_FAILURE + ;; + 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 $EXIT_SUCCESS + ;; + + *) + # 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 + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + 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= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $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$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + 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 "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + 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. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $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 $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# 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 $EXIT_FAILURE + 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 $EXIT_FAILURE + 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 | grep "^# 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 environment 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 $EXIT_SUCCESS + 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 $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + 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 | grep "^# 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" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 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. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# 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 + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # 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 $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +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. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +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 + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -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 $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# 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 +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/macros/Makefile.am b/macros/Makefile.am new file mode 100644 index 0000000..698c52c --- /dev/null +++ b/macros/Makefile.am @@ -0,0 +1,27 @@ +## Please update this variable if any new macros are created + +MACROS= \ + aclocal-include.m4 \ + ac_c_var_func.m4 \ + alsa.m4 \ + codeset.m4 \ + esd.m4 \ + freetype.m4 \ + freetype2.m4 \ + gtk.m4 \ + glib.m4 \ + libtool.m4 \ + sdl.m4 \ + pkg.m4 \ + vorbis.m4 \ + ogg.m4 \ + glib-2.0.m4 \ + gtk-2.0.m4 \ + ltdl.m4 + + +EXTRA_DIST=$(MACROS) +MAINTAINERCLEANFILES=macros.dep + +@MAINT@macros.dep: Makefile.am +@MAINT@ @echo '$$(top_srcdir)/aclocal.m4: $(MACROS:%=macros/%)' > $@ diff --git a/macros/Makefile.in b/macros/Makefile.in new file mode 100644 index 0000000..5098f88 --- /dev/null +++ b/macros/Makefile.in @@ -0,0 +1,435 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = macros +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +MACROS = \ + aclocal-include.m4 \ + ac_c_var_func.m4 \ + alsa.m4 \ + codeset.m4 \ + esd.m4 \ + freetype.m4 \ + freetype2.m4 \ + gtk.m4 \ + glib.m4 \ + libtool.m4 \ + sdl.m4 \ + pkg.m4 \ + vorbis.m4 \ + ogg.m4 \ + glib-2.0.m4 \ + gtk-2.0.m4 \ + ltdl.m4 + +EXTRA_DIST = $(MACROS) +MAINTAINERCLEANFILES = macros.dep +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu macros/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu macros/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +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: + + +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"; \ + $(mkdir_p) "$(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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-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 + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-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 + + +@MAINT@macros.dep: Makefile.am +@MAINT@ @echo '$$(top_srcdir)/aclocal.m4: $(MACROS:%=macros/%)' > $@ +# 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/macros/ac_c_var_func.m4 b/macros/ac_c_var_func.m4 new file mode 100644 index 0000000..74d515f --- /dev/null +++ b/macros/ac_c_var_func.m4 @@ -0,0 +1,29 @@ +dnl @synopsis AC_C_VAR_FUNC +dnl +dnl This macro tests if the C complier supports the C9X standard +dnl __func__ indentifier. +dnl +dnl The new C9X standard for the C language stipulates that the +dnl identifier __func__ shall be implictly declared by the compiler +dnl as if, immediately following the opening brace of each function +dnl definition, the declaration +dnl +dnl static const char __func__[] = "function-name"; +dnl +dnl appeared, where function-name is the name of the function where +dnl the __func__ identifier is used. +dnl +dnl @version $Id: ac_c_var_func.m4,v 1.1 2002/09/18 13:16:22 chikama Exp $ +dnl @author Christopher Currie + +AC_DEFUN([AC_C_VAR_FUNC], +[AC_REQUIRE([AC_PROG_CC]) +AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func, +AC_TRY_COMPILE(, +[int main() { +char *s = __func__; +}], +AC_DEFINE(HAVE_FUNC,, +[Define if the C complier supports __func__]) ac_cv_c_var_func=yes, +ac_cv_c_var_func=no) ) +])dnl diff --git a/macros/aclocal-include.m4 b/macros/aclocal-include.m4 new file mode 100644 index 0000000..abf6533 --- /dev/null +++ b/macros/aclocal-include.m4 @@ -0,0 +1,16 @@ +# aclocal-include.m4 +# +# This macro adds the name macrodir to the set of directories +# that `aclocal' searches for macros. + +# serial 1 + +dnl AM_ACLOCAL_INCLUDE(macrodir) +AC_DEFUN([AM_ACLOCAL_INCLUDE], +[ + AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y) + + test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" + + for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done +]) diff --git a/macros/alsa.m4 b/macros/alsa.m4 new file mode 100644 index 0000000..dd1e703 --- /dev/null +++ b/macros/alsa.m4 @@ -0,0 +1,145 @@ +dnl Configure Paths for Alsa +dnl Some modifications by Richard Boulton +dnl Christopher Lansdown +dnl Jaroslav Kysela +dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp +dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. +dnl enables arguments --with-alsa-prefix= +dnl --with-alsa-enc-prefix= +dnl --disable-alsatest +dnl +dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, +dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. +dnl +AC_DEFUN([AM_PATH_ALSA], +[dnl Save the original CFLAGS, LDFLAGS, and LIBS +alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + +dnl +dnl Get the cflags and libraries for alsa +dnl +AC_ARG_WITH(alsa-prefix, +[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], +[alsa_prefix="$withval"], [alsa_prefix=""]) + +AC_ARG_WITH(alsa-inc-prefix, +[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], +[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) + +dnl FIXME: this is not yet implemented +AC_ARG_ENABLE(alsatest, +[ --disable-alsatest Do not try to compile and run a test Alsa program], +[enable_alsatest="$enableval"], +[enable_alsatest=yes]) + +dnl Add any special include directories +AC_MSG_CHECKING(for ALSA CFLAGS) +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +AC_MSG_RESULT($ALSA_CFLAGS) + +dnl add any special lib dirs +AC_MSG_CHECKING(for ALSA LDFLAGS) +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +dnl add the alsa library +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS=`echo $LIBS | sed 's/-lm//'` +LIBS=`echo $LIBS | sed 's/-ldl//'` +LIBS=`echo $LIBS | sed 's/-lpthread//'` +LIBS=`echo $LIBS | sed 's/ //'` +LIBS="$ALSA_LIBS $LIBS" +AC_MSG_RESULT($ALSA_LIBS) + +dnl Check for a working version of libasound that is of the right version. +min_alsa_version=ifelse([$1], ,0.1.1,$1) +AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + +AC_LANG_SAVE +AC_LANG_C +AC_TRY_COMPILE([ +#include +], [ +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); +], + [AC_MSG_RESULT(found.)], + [AC_MSG_RESULT(not present.) + ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) + alsa_found=no] +) +AC_LANG_RESTORE + +dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. +if test "x$enable_alsatest" = "xyes"; then +AC_CHECK_LIB([asound], [snd_ctl_open],, + [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) + alsa_found=no] +) +fi + +if test "x$alsa_found" = "xyes" ; then + ifelse([$2], , :, [$2]) + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + ifelse([$3], , :, [$3]) + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + +dnl That should be it. Now just export out symbols: +AC_SUBST(ALSA_CFLAGS) +AC_SUBST(ALSA_LIBS) +]) + diff --git a/macros/autogen.sh b/macros/autogen.sh new file mode 100755 index 0000000..cf02e95 --- /dev/null +++ b/macros/autogen.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +rm -f po/Makevars.template +rm -f po/Rules-quot +rm -f po/boldquot.sed +rm -f po/en@boldquot.header +rm -f po/en@quot.header +rm -f po/insert-header.sin +rm -f po/quot.sed + +aclocal -I macros + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/macros/codeset.m4 b/macros/codeset.m4 new file mode 100644 index 0000000..59535eb --- /dev/null +++ b/macros/codeset.m4 @@ -0,0 +1,23 @@ +# codeset.m4 serial AM1 (gettext-0.10.40) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi +]) diff --git a/macros/esd.m4 b/macros/esd.m4 new file mode 100644 index 0000000..24666c9 --- /dev/null +++ b/macros/esd.m4 @@ -0,0 +1,194 @@ +# Configure paths for ESD +# Manish Singh 98-9-30 +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS +dnl +AC_DEFUN([AM_PATH_ESD], +[dnl +dnl Get the cflags and libraries from the esd-config script +dnl +AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], + esd_prefix="$withval", esd_prefix="") +AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], + esd_exec_prefix="$withval", esd_exec_prefix="") +AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], + , enable_esdtest=yes) + + if test x$esd_exec_prefix != x ; then + esd_args="$esd_args --exec-prefix=$esd_exec_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_exec_prefix/bin/esd-config + fi + fi + if test x$esd_prefix != x ; then + esd_args="$esd_args --prefix=$esd_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_prefix/bin/esd-config + fi + fi + + AC_PATH_PROG(ESD_CONFIG, esd-config, no) + min_esd_version=ifelse([$1], ,0.2.7,$1) + AC_MSG_CHECKING(for ESD - version >= $min_esd_version) + no_esd="" + if test "$ESD_CONFIG" = "no" ; then + no_esd=yes + else + AC_LANG_SAVE + AC_LANG_C + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` + + esd_major_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + esd_minor_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_esdtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" +dnl +dnl Now check if the installed ESD is sufficiently new. (Also sanity +dnl checks the results of esd-config to some extent +dnl + rm -f conf.esdtest + AC_TRY_RUN([ +#include +#include +#include +#include + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.esdtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_esd_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_esd_version"); + exit(1); + } + + if (($esd_major_version > major) || + (($esd_major_version == major) && ($esd_minor_version > minor)) || + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); + printf("*** to point to the correct copy of esd-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + AC_LANG_RESTORE + fi + fi + if test "x$no_esd" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$ESD_CONFIG" = "no" ; then + echo "*** The esd-config script installed by ESD could not be found" + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ESD_CONFIG environment variable to the" + echo "*** full path to esd-config." + else + if test -f conf.esdtest ; then + : + else + echo "*** Could not run ESD test program, checking why..." + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + AC_LANG_SAVE + AC_LANG_C + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding ESD or finding the wrong" + echo "*** version of ESD. If it is not finding ESD, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means ESD was incorrectly installed" + echo "*** or that you have moved ESD since it was installed. In the latter case, you" + echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + AC_LANG_RESTORE + fi + fi + ESD_CFLAGS="" + ESD_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(ESD_CFLAGS) + AC_SUBST(ESD_LIBS) + rm -f conf.esdtest +]) + +dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]]) +dnl Test, whether esd supports multiple recording clients (version >=0.2.21) +dnl +AC_DEFUN([AM_ESD_SUPPORTS_MULTIPLE_RECORD], +[dnl + AC_MSG_NOTICE([whether installed esd version supports multiple recording clients]) + ac_save_ESD_CFLAGS="$ESD_CFLAGS" + ac_save_ESD_LIBS="$ESD_LIBS" + AM_PATH_ESD(0.2.21, + ifelse([$1], , [ + AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true) + AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1, + [Define if you have esound with support of multiple recording clients.])], + [$1]), + ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2]) + if test "x$ac_save_ESD_CFLAGS" != x ; then + ESD_CFLAGS="$ac_save_ESD_CFLAGS" + fi + if test "x$ac_save_ESD_LIBS" != x ; then + ESD_LIBS="$ac_save_ESD_LIBS" + fi + ) +]) diff --git a/macros/freetype.m4 b/macros/freetype.m4 new file mode 100644 index 0000000..99a12d3 --- /dev/null +++ b/macros/freetype.m4 @@ -0,0 +1,84 @@ +dnl +dnl Borrow form Berlin Project. +dnl http://www.berlin-consortium.org +dnl +dnl Checks if FreeType is found. If it is, $ac_cv_lib_freetype is +dnl set to "yes". + +AC_DEFUN([AM_PATH_FREETYPE], +[dnl Get the cflags and librarie + AC_LANG_SAVE + AC_LANG_C + AC_ARG_WITH(freetype-prefix, [ --with-freetype-prefix=PFX Prefix for Freetype (optional)], + freetype_prefix="$withval", freetype_prefix="") + +dnl Check for Freetype includes. + if test ".$freetype_prefix" != . ; then + FREETYPE_INCLUDES=-I$freetype_prefix/include + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$FREETYPE_INCLUDES $CPPFLAGS" + AC_CHECK_HEADER(freetype/freetype.h,AC_DEFINE(FREETYPE_HAVE_DIR,1,[define this if you have freetype/freetype.h])) + CPPFLAGS="$save_CPPFLAGS" + +dnl Check for Freetype libs + if test x$no_freetype = x ; then + if test x$freetype_prefix != x ; then + freetype_libs=-L$freetype_prefix/lib + fi + freetype_libs="$freetype_libs -lttf" + + AC_CACHE_CHECK([for working Freetype environment], + ac_cv_lib_freetype, [ + save_LDFLAGS="$LDFLAGS" + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + LIBS="$LIBS $freetype_libs" + LDFLAGS="$LDFLAGS" + CPPFLAGS="$CPPFLAGS $FREETYPE_INCLUDES" + + dnl Check if everything works + AC_TRY_RUN([ +#ifdef FREETYPE_HAVE_DIR +#include +#else +#include +#endif +#include +int main (int argc, char* argv[]) +{ + TT_Engine library; + if(TT_Init_FreeType(&library) != 0) + { + printf("Error: Could not initialize FreeType engine!\n"); + return 1; + } + return 0; +} + ], ac_cv_lib_freetype=yes, + ac_cv_lib_freetype=no, + ac_cv_lib_freetype=yes) + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ]) dnl End of AC_CACHE_CHECK + + fi + + if test x$ac_cv_lib_freetype = xyes ; then + FREETYPE_LIBS=$freetype_libs + ifelse([$2], , :, [$2]) + else + + if test ".$1" = .mandatory ; then + AC_MSG_ERROR(Could not find freetype library!) + fi + ifelse([$3], , :, [$3]) + fi + + AC_SUBST(FREETYPE_LIBS) + AC_SUBST(FREETYPE_INCLUDES) + + AC_LANG_RESTORE +]) diff --git a/macros/freetype2.m4 b/macros/freetype2.m4 new file mode 100644 index 0000000..fc2242f --- /dev/null +++ b/macros/freetype2.m4 @@ -0,0 +1,187 @@ +# Configure paths for FreeType2 +# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor +# +# Copyright 2001, 2003 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. +# +# serial 2 + +# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS. +# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is +# FreeType 2.0.4). +# +AC_DEFUN([AC_CHECK_FT2], + [# Get the cflags and libraries from the freetype-config script + # + AC_ARG_WITH([ft-prefix], + dnl don't quote AS_HELP_STRING! + AS_HELP_STRING([--with-ft-prefix=PREFIX], + [Prefix where FreeType is installed (optional)]), + [ft_config_prefix="$withval"], + [ft_config_prefix=""]) + + AC_ARG_WITH([ft-exec-prefix], + dnl don't quote AS_HELP_STRING! + AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], + [Exec prefix where FreeType is installed (optional)]), + [ft_config_exec_prefix="$withval"], + [ft_config_exec_prefix=""]) + + AC_ARG_ENABLE([freetypetest], + dnl don't quote AS_HELP_STRING! + AS_HELP_STRING([--disable-freetypetest], + [Do not try to compile and run a test FreeType program]), + [], + [enable_fttest=yes]) + + if test x$ft_config_exec_prefix != x ; then + ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config + fi + fi + + if test x$ft_config_prefix != x ; then + ft_config_args="$ft_config_args --prefix=$ft_config_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_prefix/bin/freetype-config + fi + fi + + AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no]) + + min_ft_version=m4_if([$1], [], [7.0.1], [$1]) + AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version]) + no_ft="" + if test "$FT2_CONFIG" = "no" ; then + no_ft=yes + else + FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` + FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` + ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + ft_min_major_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_min_minor_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_min_micro_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test x$enable_fttest = xyes ; then + ft_config_is_lt="" + if test $ft_config_major_version -lt $ft_min_major_version ; then + ft_config_is_lt=yes + else + if test $ft_config_major_version -eq $ft_min_major_version ; then + if test $ft_config_minor_version -lt $ft_min_minor_version ; then + ft_config_is_lt=yes + else + if test $ft_config_minor_version -eq $ft_min_minor_version ; then + if test $ft_config_micro_version -lt $ft_min_micro_version ; then + ft_config_is_lt=yes + fi + fi + fi + fi + fi + if test x$ft_config_is_lt = xyes ; then + no_ft=yes + else + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $FT2_CFLAGS" + LIBS="$FT2_LIBS $LIBS" + + # + # Sanity checks for the results of freetype-config to some extent. + # + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ + +#include +#include FT_FREETYPE_H +#include +#include + +int +main() +{ + FT_Library library; + FT_Error error; + + error = FT_Init_FreeType(&library); + + if (error) + return 1; + else + { + FT_Done_FreeType(library); + return 0; + } +} + + ]]) + ], + [], + [no_ft=yes], + [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"]) + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi # test $ft_config_version -lt $ft_min_version + fi # test x$enable_fttest = xyes + fi # test "$FT2_CONFIG" = "no" + + if test x$no_ft = x ; then + AC_MSG_RESULT([yes]) + m4_if([$2], [], [:], [$2]) + else + AC_MSG_RESULT([no]) + if test "$FT2_CONFIG" = "no" ; then + AC_MSG_WARN([ + + The freetype-config script installed by FreeType 2 could not be found. + If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in + your path, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + ]) + else + if test x$ft_config_is_lt = xyes ; then + AC_MSG_WARN([ + + Your installed version of the FreeType 2 library is too old. + If you have different versions of FreeType 2, make sure that + correct values for --with-ft-prefix or --with-ft-exec-prefix + are used, or set the FT2_CONFIG environment variable to the + full path to freetype-config. + ]) + else + AC_MSG_WARN([ + + The FreeType test program failed to run. If your system uses + shared libraries and they are installed outside the normal + system library path, make sure the variable LD_LIBRARY_PATH + (or whatever is appropiate for your system) is correctly set. + ]) + fi + fi + + FT2_CFLAGS="" + FT2_LIBS="" + m4_if([$3], [], [:], [$3]) + fi + + AC_SUBST([FT2_CFLAGS]) + AC_SUBST([FT2_LIBS])]) + +# end of freetype2.m4 diff --git a/macros/glib-2.0.m4 b/macros/glib-2.0.m4 new file mode 100644 index 0000000..d6413ff --- /dev/null +++ b/macros/glib-2.0.m4 @@ -0,0 +1,215 @@ +# Configure paths for GLIB +# Owen Taylor 1997-2001 + +dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or +dnl gthread is specified in MODULES, pass to pkg-config +dnl +AC_DEFUN([AM_PATH_GLIB_2_0], +[dnl +dnl Get the cflags and libraries from pkg-config +dnl +AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], + , enable_glibtest=yes) + + pkg_config_args=glib-2.0 + for module in . $4 + do + case "$module" in + gmodule) + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gmodule-no-export) + pkg_config_args="$pkg_config_args gmodule-no-export-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" + ;; + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + esac + done + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + + no_glib="" + + if test x$PKG_CONFIG != xno ; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then + : + else + echo *** pkg-config too old; version 0.7 or better required. + no_glib=yes + PKG_CONFIG=no + fi + else + no_glib=yes + fi + + min_glib_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi + + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi + + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" +dnl +dnl Now check if the installed GLIB is sufficiently new. (Also sanity +dnl checks the results of pkg-config to some extent) +dnl + rm -f conf.glibtest + AC_TRY_RUN([ +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + AC_SUBST(GLIB_GENMARSHAL) + AC_SUBST(GOBJECT_QUERY) + AC_SUBST(GLIB_MKENUMS) + rm -f conf.glibtest +]) diff --git a/macros/glib.m4 b/macros/glib.m4 new file mode 100644 index 0000000..b3c632b --- /dev/null +++ b/macros/glib.m4 @@ -0,0 +1,196 @@ +# Configure paths for GLIB +# Owen Taylor 97-11-3 + +dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or +dnl gthread is specified in MODULES, pass to glib-config +dnl +AC_DEFUN([AM_PATH_GLIB], +[dnl +dnl Get the cflags and libraries from the glib-config script +dnl +AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], + glib_config_prefix="$withval", glib_config_prefix="") +AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], + glib_config_exec_prefix="$withval", glib_config_exec_prefix="") +AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], + , enable_glibtest=yes) + + if test x$glib_config_exec_prefix != x ; then + glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config + fi + fi + if test x$glib_config_prefix != x ; then + glib_config_args="$glib_config_args --prefix=$glib_config_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_prefix/bin/glib-config + fi + fi + + for module in . $4 + do + case "$module" in + gmodule) + glib_config_args="$glib_config_args gmodule" + ;; + gthread) + glib_config_args="$glib_config_args gthread" + ;; + esac + done + + AC_PATH_PROG(GLIB_CONFIG, glib-config, no) + min_glib_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + no_glib="" + if test "$GLIB_CONFIG" = "no" ; then + no_glib=yes + else + GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` + GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` + glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" +dnl +dnl Now check if the installed GLIB is sufficiently new. (Also sanity +dnl checks the results of glib-config to some extent +dnl + rm -f conf.glibtest + AC_TRY_RUN([ +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If glib-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); + printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the glib-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); + printf("*** correct copy of glib-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GLIB_CONFIG" = "no" ; then + echo "*** The glib-config script installed by GLIB could not be found" + echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GLIB_CONFIG environment variable to the" + echo "*** full path to glib-config." + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB was incorrectly installed" + echo "*** or that you have moved GLIB since it was installed. In the latter case, you" + echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + rm -f conf.glibtest +]) diff --git a/macros/gtk-2.0.m4 b/macros/gtk-2.0.m4 new file mode 100644 index 0000000..3deba01 --- /dev/null +++ b/macros/gtk-2.0.m4 @@ -0,0 +1,196 @@ +# Configure paths for GTK+ +# Owen Taylor 1997-2001 + +dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, +dnl pass to pkg-config +dnl +AC_DEFUN([AM_PATH_GTK_2_0], +[dnl +dnl Get the cflags and libraries from pkg-config +dnl +AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], + , enable_gtktest=yes) + + pkg_config_args=gtk+-2.0 + for module in . $4 + do + case "$module" in + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + esac + done + + no_gtk="" + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + + if test x$PKG_CONFIG != xno ; then + if pkg-config --atleast-pkgconfig-version 0.7 ; then + : + else + echo "*** pkg-config too old; version 0.7 or better required." + no_gtk=yes + PKG_CONFIG=no + fi + else + no_gtk=yes + fi + + min_gtk_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" + enable_gtktest=no + fi + + if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then + : + else + no_gtk=yes + fi + fi + + if test x"$no_gtk" = x ; then + GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` + GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` + gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" +dnl +dnl Now check if the installed GTK+ is sufficiently new. (Also sanity +dnl checks the results of pkg-config to some extent) +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://pkgconfig.sourceforge.net" + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK+ test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK+ or finding the wrong" + echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) diff --git a/macros/gtk.m4 b/macros/gtk.m4 new file mode 100644 index 0000000..f2dd472 --- /dev/null +++ b/macros/gtk.m4 @@ -0,0 +1,194 @@ +# Configure paths for GTK+ +# Owen Taylor 97-11-3 + +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN([AM_PATH_GTK], +[dnl +dnl Get the cflags and libraries from the gtk-config script +dnl +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], + , enable_gtktest=yes) + + for module in . $4 + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" +dnl +dnl Now check if the installed GTK is sufficiently new. (Also sanity +dnl checks the results of gtk-config to some extent +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) diff --git a/macros/libtool.m4 b/macros/libtool.m4 new file mode 100644 index 0000000..dac046e --- /dev/null +++ b/macros/libtool.m4 @@ -0,0 +1,6414 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This file is free software; the Free Software Foundation gives +## unlimited permission to copy and/or distribute it, with or without +## modifications, as long as this notice is preserved. + +# serial 48 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])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_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)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 +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +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 + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_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 MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +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 "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +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 "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# 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="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# 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_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--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 + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _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], +[_LT_AC_SHELL_INIT([ +# 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 </dev/null 2>&1 && unset CDPATH + +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. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + 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="$lt_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) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([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) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _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], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#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); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-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" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_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_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = 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 +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + 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}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $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 + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + 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 + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# 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], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# 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_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# 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], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# 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_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# 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], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# 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_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# 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_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [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]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&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="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_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* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_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 + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL 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, lt_dlinit, + [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 + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + 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]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + 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 + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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 + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | 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, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# 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=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# 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=$lt_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_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# 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_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# 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_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +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_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# 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_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# 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_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_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=$_LT_AC_TAGVAR(hardcode_action, $1) + +# 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_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# 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=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# 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="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# 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_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +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" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +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. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# 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 from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (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 + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + 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 < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -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 +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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 + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_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= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&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 + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II 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't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&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 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|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. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + 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. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$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. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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 + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$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' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #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 +# 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 */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# 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]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) diff --git a/macros/ogg.m4 b/macros/ogg.m4 new file mode 100644 index 0000000..0da1102 --- /dev/null +++ b/macros/ogg.m4 @@ -0,0 +1,91 @@ +# Configure paths for libogg +# Jack Moffitt 10-21-2000 +# Shamelessly stolen from Owen Taylor and Manish Singh + +dnl AM_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS +dnl +AC_DEFUN([AM_PATH_OGG], +[dnl +dnl Get the cflags and libraries +dnl +AC_ARG_WITH(ogg-prefix,[ --with-ogg-prefix=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="") +AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes) + + if test x$ogg_prefix != x ; then + ogg_args="$ogg_args --prefix=$ogg_prefix" + OGG_CFLAGS="-I$ogg_prefix/include" + OGG_LIBS="-L$ogg_prefix/lib" + fi + + OGG_LIBS="$OGG_LIBS -logg" + + AC_MSG_CHECKING(for Ogg) + no_ogg="" + + + if test "x$enable_oggtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $OGG_LIBS" +dnl +dnl Now check if the installed Ogg is sufficiently new. +dnl + rm -f conf.oggtest + AC_TRY_RUN([ +#include +#include +#include +#include + +int main () +{ + system("touch conf.oggtest"); + return 0; +} + +],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + if test "x$no_ogg" = x ; then + AC_MSG_RESULT(yes) + ifelse([$1], , :, [$1]) + else + AC_MSG_RESULT(no) + if test -f conf.oggtest ; then + : + else + echo "*** Could not run Ogg test program, checking why..." + CFLAGS="$CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $OGG_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Ogg or finding the wrong" + echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means Ogg was incorrectly installed" + echo "*** or that you have moved Ogg since it was installed. In the latter case, you" + echo "*** may want to edit the ogg-config script: $OGG_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + OGG_CFLAGS="" + OGG_LIBS="" + ifelse([$2], , :, [$2]) + fi + AC_SUBST(OGG_CFLAGS) + AC_SUBST(OGG_LIBS) + rm -f conf.oggtest +]) diff --git a/macros/pkg.m4 b/macros/pkg.m4 new file mode 100644 index 0000000..cbb46db --- /dev/null +++ b/macros/pkg.m4 @@ -0,0 +1,156 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright 息 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [$4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff --git a/macros/sdl.m4 b/macros/sdl.m4 new file mode 100644 index 0000000..09b72e4 --- /dev/null +++ b/macros/sdl.m4 @@ -0,0 +1,180 @@ +# Configure paths for SDL +# Sam Lantinga 9/21/99 +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN([AM_PATH_SDL], +[dnl +dnl Get the cflags and libraries from the sdl-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + AC_REQUIRE([AC_CANONICAL_TARGET]) + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH]) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_CXXFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) diff --git a/macros/vorbis.m4 b/macros/vorbis.m4 new file mode 100644 index 0000000..cda229d --- /dev/null +++ b/macros/vorbis.m4 @@ -0,0 +1,96 @@ +# Configure paths for libvorbis +# Jack Moffitt 10-21-2000 +# Shamelessly stolen from Owen Taylor and Manish Singh + +dnl AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS +dnl +AC_DEFUN([AM_PATH_VORBIS], +[dnl +dnl Get the cflags and libraries +dnl +AC_ARG_WITH(vorbis-prefix,[ --with-vorbis-prefix=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="") +AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes) + + if test x$vorbis_prefix != x ; then + vorbis_args="$vorbis_args --prefix=$vorbis_prefix" + VORBIS_CFLAGS="-I$vorbis_prefix/include" + VORBIS_LIBDIR="-L$vorbis_prefix/lib" + fi + + VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm" + VORBISFILE_LIBS="-lvorbisfile" + VORBISENC_LIBS="-lvorbisenc" + + AC_MSG_CHECKING(for Vorbis) + no_vorbis="" + + + if test "x$enable_vorbistest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $VORBIS_CFLAGS" + LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" +dnl +dnl Now check if the installed Vorbis is sufficiently new. +dnl + rm -f conf.vorbistest + AC_TRY_RUN([ +#include +#include +#include +#include + +int main () +{ + system("touch conf.vorbistest"); + return 0; +} + +],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + if test "x$no_vorbis" = x ; then + AC_MSG_RESULT(yes) + ifelse([$1], , :, [$1]) + else + AC_MSG_RESULT(no) + if test -f conf.vorbistest ; then + : + else + echo "*** Could not run Vorbis test program, checking why..." + CFLAGS="$CFLAGS $VORBIS_CFLAGS" + LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Vorbis or finding the wrong" + echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means Vorbis was incorrectly installed" + echo "*** or that you have moved Vorbis since it was installed." ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + VORBIS_CFLAGS="" + VORBIS_LIBS="" + VORBISFILE_LIBS="" + VORBISENC_LIBS="" + ifelse([$2], , :, [$2]) + fi + AC_SUBST(VORBIS_CFLAGS) + AC_SUBST(VORBIS_LIBS) + AC_SUBST(VORBISFILE_LIBS) + AC_SUBST(VORBISENC_LIBS) + rm -f conf.vorbistest +]) diff --git a/missing b/missing new file mode 100755 index 0000000..894e786 --- /dev/null +++ b/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..259dbfc --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,158 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2005-06-29.22 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/modules/AliceLogo/AliceLogo.c b/modules/AliceLogo/AliceLogo.c new file mode 100644 index 0000000..01ddb4b --- /dev/null +++ b/modules/AliceLogo/AliceLogo.c @@ -0,0 +1,34 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + +void Init() { + int p1 = getCaliValue(); /* ISys3x */ + int p2 = getCaliValue(); /* IWinMsg */ + int p3 = getCaliValue(); /* ITimer */ + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("AliceLogo.Init %d,%d,%d,%p:\n", p1, p2, p3, var); +} + +void SetWaveNum() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("AliceLogo.SetWaveNum %d,%d:\n", p1, p2); +} + +void Run() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("AliceLogo.Run %d,%d:\n", p1, p2); +} + diff --git a/modules/AliceLogo/Makefile.am b/modules/AliceLogo/Makefile.am new file mode 100644 index 0000000..c5ca4b6 --- /dev/null +++ b/modules/AliceLogo/Makefile.am @@ -0,0 +1,13 @@ +pkglib_LTLIBRARIES = AliceLogo.la + +AliceLogo_la_LDFLAGS = -module -export-dynamic -avoid-version +AliceLogo_la_SOURCES = AliceLogo.c +AliceLogo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/AliceLogo -I$(top_srcdir)/modules/AliceLogo diff --git a/modules/AliceLogo/Makefile.in b/modules/AliceLogo/Makefile.in new file mode 100644 index 0000000..c81eda4 --- /dev/null +++ b/modules/AliceLogo/Makefile.in @@ -0,0 +1,559 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/AliceLogo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +AliceLogo_la_DEPENDENCIES = ../lib/libgraph.la ../lib/libalk.la +am_AliceLogo_la_OBJECTS = AliceLogo.lo +AliceLogo_la_OBJECTS = $(am_AliceLogo_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(AliceLogo_la_SOURCES) +DIST_SOURCES = $(AliceLogo_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = AliceLogo.la +AliceLogo_la_LDFLAGS = -module -export-dynamic -avoid-version +AliceLogo_la_SOURCES = AliceLogo.c +AliceLogo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/AliceLogo -I$(top_srcdir)/modules/AliceLogo + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/AliceLogo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/AliceLogo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +AliceLogo.la: $(AliceLogo_la_OBJECTS) $(AliceLogo_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(AliceLogo_la_LDFLAGS) $(AliceLogo_la_OBJECTS) $(AliceLogo_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AliceLogo.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/Confirm/Confirm.c b/modules/Confirm/Confirm.c new file mode 100644 index 0000000..85cd48e --- /dev/null +++ b/modules/Confirm/Confirm.c @@ -0,0 +1,43 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +void Init() { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("Confirm.Init %d:\n", p1); +} + +void ExistKeyFile() { + char *p1 = sys_getString(0); + int *p2 = getCaliVariable(); + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("Confirm.ExistKeyFile %s,%p,%p:\n",p1, p2, var); +} + +void CheckProtectFile() { + char *p1 = sys_getString(0); + int *p2 = getCaliVariable(); + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("Confirm.CheckProtectFile %s,%p,%p:\n", p1,p2,var); +} + +void CreateKeyFile() { + char *p1 = sys_getString(0); + int *p2 = getCaliVariable(); + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("Confirm.CreateKeyFile %s,%p,%p:\n", p1,p2,var); +} diff --git a/modules/Confirm/Makefile.am b/modules/Confirm/Makefile.am new file mode 100644 index 0000000..23fca1a --- /dev/null +++ b/modules/Confirm/Makefile.am @@ -0,0 +1,13 @@ +pkglib_LTLIBRARIES = Confirm.la + +Confirm_la_LDFLAGS = -module -export-dynamic -avoid-version +Confirm_la_SOURCES = Confirm.c +Confirm_la_LIBADD = + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/Confirm -I$(top_srcdir)/modules/Confirm diff --git a/modules/Confirm/Makefile.in b/modules/Confirm/Makefile.in new file mode 100644 index 0000000..132b6e1 --- /dev/null +++ b/modules/Confirm/Makefile.in @@ -0,0 +1,559 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/Confirm +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +Confirm_la_DEPENDENCIES = +am_Confirm_la_OBJECTS = Confirm.lo +Confirm_la_OBJECTS = $(am_Confirm_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(Confirm_la_SOURCES) +DIST_SOURCES = $(Confirm_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = Confirm.la +Confirm_la_LDFLAGS = -module -export-dynamic -avoid-version +Confirm_la_SOURCES = Confirm.c +Confirm_la_LIBADD = +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/Confirm -I$(top_srcdir)/modules/Confirm + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/Confirm/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/Confirm/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +Confirm.la: $(Confirm_la_OBJECTS) $(Confirm_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(Confirm_la_LDFLAGS) $(Confirm_la_OBJECTS) $(Confirm_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Confirm.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/Gpx/Gpx.c b/modules/Gpx/Gpx.c new file mode 100644 index 0000000..00267f2 --- /dev/null +++ b/modules/Gpx/Gpx.c @@ -0,0 +1,1176 @@ +/* + * Gpx.c Graphics 汎用関数 + * + * OnlyYou -リ・クスル + * system3.9化 鬼畜王ランス + * 大悪司 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: Gpx.c,v 1.11 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +#include "ags.h" +#include "cg.h" +#include "image.h" +#include "counter.h" +#include "imput.h" +// #include "alpha_plane.h" +#include "surface.h" +#include "graph.h" +// #include "graph2.h" + +#include "effectcopy.h" +#include "ngraph.h" + +#define MAX_SURFACE 256 + + + + +static int pre_freesurfno; /* 直前に開放した surface no */ +static surface_t *suf[MAX_SURFACE]; + +static int find_null_surface() { + int i; + + if (suf[pre_freesurfno] == NULL) return pre_freesurfno; + + for (i = 1; i < MAX_SURFACE; i++) { + if (suf[i] == NULL) return i; + } + + SYSERROR("no free surface\n"); + return 0; +} + +static int sf_free_one(int no) { + surface_t *s; + if (no == 0) return NG; + + s = suf[no]; + if (s == NULL) return NG; + + if (s->pixel) g_free(s->pixel); + if (s->alpha) g_free(s->alpha); + g_free(s); + + suf[no] = NULL; + pre_freesurfno = no; + return OK; +} + +static int sf_free_all() { + int i; + surface_t *s; + + for (i = 1; i < MAX_SURFACE; i++) { + if (suf[i] == NULL) continue; + s = suf[i]; + if (s->pixel) g_free(s->pixel); + if (s->alpha) g_free(s->alpha); + g_free(s); + suf[i] = NULL; + } + + pre_freesurfno = 1; + return OK; +} + +static surface_t *sf_get(int no) { + if (no == 0) { + return nact->ags.dib; + } + return suf[no]; +} + +static int load_cg_main(int no) { + surface_t *sf = sf_loadcg_no(no); + int sno; + + if (sf == NULL) { + WARNING("load fail(cg==NULL,no=%d)\n", no); + return 0; + } + + sno = find_null_surface(); + + sf->no = sno; + suf[sno] = sf; + + return sf->no; +} + +void Init() { + /* + Gpx.Init(): Gpx モジュールの初期化 + */ + int p1 = getCaliValue(); /* ISys3x */ + + suf[0] = NULL; + gr_init(); + + // surface0 を pre_freesurfno として返さないように。 + pre_freesurfno = 1; + + DEBUG_COMMAND("Gpx.Init %d:\n", p1); +} + +void Create() { + /* + Gpx.Create(): 新規 surface の作成(PixelとAlphaマップの両方) + + var : 作成した surface の番号を返す変数 + 作成に失敗した場合は 0 を返す + width : surface の幅 + height: surface の高さ + bpp : surface の深さ(オリジナルでは24bppのみサポート, + xsystem35 では display の depth と同じ) + */ + int *var = getCaliVariable(); + int width = getCaliValue(); + int height = getCaliValue(); + int bpp = getCaliValue(); + surface_t *s; + + //get_surface0(); + s = sf_create_surface(width, height, sf_get(0)->depth); + + if (s == NULL) { + *var = 0; + } else { + int no = find_null_surface(); + *var = s->no = no; + suf[no] = s; + } + + DEBUG_COMMAND("Gpx.Create %p,%d,%d,%d:\n", var, width, height, bpp); +} + +void CreatePixelOnly() { + /* + Gpx.CreatePixelOnly(): 新規 surface の作成(Pixelのみ) + + var : 作成した surface の番号を返す変数 + width : surface の幅 + height: surface の高さ + bpp : surface の深さ(24bpp only) + */ + int *var = getCaliVariable(); + int width = getCaliValue(); + int height = getCaliValue(); + int bpp = getCaliValue(); + surface_t *s; + + s = sf_create_pixel(width, height, sf_get(0)->depth); + + if (s == NULL) { + *var = 0; + } else { + int no = find_null_surface(); + *var = s->no = no; + suf[no] = s; + } + + DEBUG_COMMAND("Gpx.CreatePixelOnly %d,%d,%d,%d:\n", *var, width, height, bpp); +} + +void CreateAMapOnly() { + /* + Gpx.CreateAMapOnly(): 新規 surface の作成(AlphaMapのみ) + + var : 作成した surface の番号を返す変数 + width : surface の幅 + height: surface の高さ + */ + int *var = getCaliVariable(); + int width = getCaliValue(); + int height = getCaliValue(); + surface_t *s; + + s = sf_create_alpha(width, height); + + if (s == NULL) { + *var = 0; + } else { + int no = find_null_surface(); + *var = s->no = no; + suf[no] = s; + } + + DEBUG_COMMAND("Gpx.CreateAMapOnly %p,%d,%d:\n", var, width, height); +} + +void IsSurface() { + /* + Gpx.IsSurface(): 指定の番号の surface が surface かどうか + (pixel と alpha の両方のデータを持つ)を調べる + + p1 : surface 番号 + var : 結果を返す変数。surface ならば 1, !surface ならば 0 + */ + int p1 = getCaliValue(); + int *var = getCaliVariable(); + surface_t *s; + + s = sf_get(p1); + + if (s == NULL) { + *var = 0; + } else { + *var = (s->has_alpha && s->has_pixel) ? 1 : 0; + } + + DEBUG_COMMAND("Gpx.IsSurface %d,%p:\n", p1, var); +} + +void IsPixel() { + /* + Gpx.IsPixel(): 指定の番号の surface が pixelデータかどうかを調べる + + p1 : surface 番号 + var : 結果を返す変数。pixel ならば 1, !pixel ならば 0 + */ + int p1 = getCaliValue(); + int *var = getCaliVariable(); + surface_t *s; + + s = sf_get(p1); + + if (s == NULL) { + *var = 0; + } else { + *var = s->has_pixel ? 1 : 0; + } + + DEBUG_COMMAND("Gpx.IsPixel %d,%p:\n", p1, var); +} + +void IsAlpha() { + /* + Gpx.IsAlpha(): 指定の番号の surface が alpha mapかどうかを調べる + + p1 : surface 番号 + var : 結果を返す変数。alpha ならば 1, !alpha ならば 0 + */ + int p1 = getCaliValue(); + int *var = getCaliVariable(); + surface_t *s; + + s = sf_get(p1); + + if (s == NULL) { + *var = 0; + } else { + *var = s->has_alpha ? 1 : 0; + } + + DEBUG_COMMAND("Gpx.IsAlpha %d,%p:\n", p1, var); +} + +void GetWidth() { + /* + Gpx.GetWidth(): 指定の番号の surface の幅を取得する + + p1 : surface 番号 + var : 結果を返す変数。 + */ + int p1 = getCaliValue(); + int *var = getCaliVariable(); + surface_t *s; + + s = sf_get(p1); + + if (s == NULL) { + *var = 0; + } else { + *var = s->width; + } + + DEBUG_COMMAND("Gpx.GetWidth %d,%d:\n", p1, *var); +} + +void GetHeight() { + /* + Gpx.GetWidth(): 指定の番号の surface の高さを取得する + + p1 : surface 番号 + var : 結果を返す変数。 + */ + int p1 = getCaliValue(); + int *var = getCaliVariable(); + surface_t *s; + + s = sf_get(p1); + + if (s == NULL) { + *var = 0; + } else { + *var = s->height; + } + + DEBUG_COMMAND("Gpx.GetHeight %d,%d:\n", p1, *var); +} + +void GetCreatedSurface() { /* not used ? */ + int *var = getCaliVariable(); + + DEBUG_COMMAND_YET("Gpx.GetCreatedSurface %p:\n", var); +} + +void LoadCG() { + /* + Gpx.LoadCG(): 新規 surface を作成してその上に CG を load + + var : 作成した surface の番号を返す変数 + p1 : 読み込む CG の番号 + */ + int *var = getCaliVariable(); + int p1 = getCaliValue(); + + *var = load_cg_main(p1 -1); + + DEBUG_COMMAND("Gpx.LoadCG %p,%d (%d):\n", var, p1, *var); +} + +void GetCGPosX() { /* not useed ? */ + int *var = getCaliVariable(); + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.GetCgPosX %p,%d:\n", var, p1); +} + +void GetCGPosY() { /* not useed ? */ + int *var = getCaliVariable(); + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.GetCgPosY %p,%d:\n", var, p1); +} + +void Free() { + /* + Gpx.Free(): 指定の surface を開放する + + p1: 開放する surface の番号 + */ + int p1 = getCaliValue(); + + DEBUG_COMMAND("Gpx.Free %d:\n", p1); + + if (p1 != 0) { + sf_free_one(p1); + } +} + +void FreeAll() { + /* + Gpx.FreeAll(): 全ての surface を開放する + */ + sf_free_all(); + + DEBUG_COMMAND("Gpx.FreeAll:\n"); +} + +void Copy() { + /* + Gpx.Copy(): 指定 surface 領域のコピー + + ds: 転送先 surface 番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + ss: 転送元 surface 番号 + sx: 転送元 x 座標 + sy: 転送元 y 座標 + sw: 転送元 幅 + sh: 転送元 高さ + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int ss = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + surface_t *src, *dst; + + DEBUG_COMMAND("Gpx.Copy %d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss, sx, sy, sw, sh); + + ags_sync(); + src = sf_get(ss); + dst = sf_get(ds); + gr_copy(dst, dx, dy, src, sx, sy, sw, sh); +} + +void CopyBright() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.CopyBright %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9); +} + +void CopyAMap() { + /* + Gpx.CopyAMap(): 指定 surface の alpha map 領域のコピー + + da: 転送先 surface(alpha map) 番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + sa: 転送元 surface(alpha map) 番号 + sx: 転送元 x 座標 + sy: 転送元 y 座標 + sw: 転送元 幅 + sh: 転送元 高さ + */ + int da = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int sa = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + surface_t *src, *dst; + + DEBUG_COMMAND("Gpx.CopyAMap %d,%d,%d,%d,%d,%d,%d,%d:\n", da, dx, dy, sa, sx, sy, sw, sh); + + ags_sync(); + src = sf_get(sa); + dst = sf_get(da); + gr_copy_alpha_map(dst, dx, dy, src, sx, sy, sw, sh); +} + +void Blend() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.Blend %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9); +} + +void BlendSrcBright() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendSrcBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); +} + +void BlendAddSatur() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAddStatur %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + +void BlendAMap() { + /* + Gpx.BlendAMap(): 転送元の alpha map を参照して 指定領域を alpha blend + + ds: 転送先 surface 番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + ss: 転送元 surface 番号 + sx: 転送元 x 座標 + sy: 転送元 y 座標 + sw: 転送元 幅 + sh: 転送元 高さ + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int ss = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + surface_t *src, *dst; + + DEBUG_COMMAND("Gpx.BlendAMap %d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss, sx, sy, sw, sh); + + ags_sync(); + src = sf_get(ss); + dst = sf_get(ds); + gr_blend_alpha_map(dst, dx, dy, src, sx, sy, sw, sh); +} + +void BlendAMapSrcOnly() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAMapSrcOnly %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + +void BlendAMapColor() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + int p11 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); +} + +void BlendAMapColorAlpha() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + int p11 = getCaliValue(); + int p12 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAMapColorAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); +} + +void BlendAMapAlpha() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAMapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9); +} + +void BlendAMapBright() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9); +} + +void BlendAMapAlphaSrcBright() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); +} + +void BlendUseAMapColor() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + int p11 = getCaliValue(); + int p12 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendUseAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); +} + +void BlendScreen() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendScreen %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + +void BlendMultiply() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendMultiply %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + +void BlendScreenAlpha() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendScreenAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9); +} + +void Fill() { + /* + Gpx.Fill(): 指定領域の塗りつぶし + + ds: 塗りつぶし surface 番号 + dx: 領域 x 座標 + dy: 領域 y 座標 + dw: 領域 幅 + dh: 領域 高さ + r : 塗りつぶし色 赤 + g : 塗りつぶし色 緑 + b : 塗りつぶし色 青 + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int r = getCaliValue(); + int g = getCaliValue(); + int b = getCaliValue(); + surface_t *dst; + + DEBUG_COMMAND("Gpx.Fill %d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, r, g, b); + + ags_sync(); + dst = sf_get(ds); + gr_fill(dst, dx, dy, dw, dh, r, g, b); +} + +void FillAlphaColor() { /* not used ? */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int r = getCaliValue(); + int g = getCaliValue(); + int b = getCaliValue(); + int lv = getCaliValue(); + surface_t *dst; + + DEBUG_COMMAND_YET("Gpx.FillAlphaColor %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, r, g, b, lv); + + ags_sync(); + dst = sf_get(ds); + gr_fill_alpha_color(dst, dx, dy, dw, dh, r, g, b, lv); +} + +void FillAMap() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.FillAMap %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6); +} + +void FillAMapOverBorder() { + /* + Gpx.FillAMapOverBorder(): 矩形領域中の 閾値以上の alpha 値を持つ + ものを指定の alpha 値に置き換え。 + + ds: 塗りつぶし surface 番号 + dx: 領域 x 座標 + dy: 領域 y 座標 + dw: 領域 幅 + dh: 領域 高さ + s : 閾値 + d : 閾値を超えた場合の設定値 + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int s = getCaliValue(); + int d = getCaliValue(); + surface_t *dst; + + DEBUG_COMMAND("Gpx.BlendAMapOverBorder %d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, s, d); + + dst = sf_get(ds); + gr_fill_alpha_overborder(dst, dx, dy, dw, dh, s, d); +} + +void FillAMapUnderBorder() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.BlendAMapUnderBorder %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7); +} + +void SaturDP_DPxSA() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.SaturDP_DPxSA %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + +void ScreenDA_DAxSA() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.ScreenDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + +void AddDA_DAxSA() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.AddDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + +void SpriteCopyAMap() { + /* + Gpx.SpriteCopyAMap(): 指定の alpha 値以外の領域の alpha map コピー + + da: 転送先 surface(alpha map) 番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + ss: 転送元 surface(alpha map) 番号 + sx: 転送元 x 座標 + sy: 転送元 y 座標 + sw: 転送元 幅 + sh: 転送元 高さ + cl: 転送しない alpha 値 + */ + int da = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int sa = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + int cl = getCaliValue(); + surface_t *src, *dst; + + DEBUG_COMMAND("Gpx.SpriteCopyAMap %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", da, dx, dy, sa, sx, sy, sw, sh, cl); + + ags_sync(); + src = sf_get(sa); + dst = sf_get(da); + gr_copy_alpha_map_sprite(dst, dx, dy, src, sx, sy, sw, sh, cl); + +} + +void BrightDestOnly() { + /* + Gpx.BrightDestOnly(): 指定領域の明るさを設定 + + ds: 明るさを設定する surface 番号 + dx: 領域 x 座標 + dy: 領域 y 座標 + dw: 領域 幅 + dh: 領域 高さ + r : 指定明るさ (255: 明るさ 100%, pixel値そのもの) + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int r = getCaliValue(); + surface_t *dst; + + DEBUG_COMMAND("Gpx.BrightDestOnly %d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, r); + + ags_sync(); + dst = sf_get(ds); + + gr_bright_dst_only(dst, dx, dy, dw, dh, r); +} + +void CopyTextureWrap() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + int p11 = getCaliValue(); + int p12 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.CopyTextureWrap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); +} + +void CopyTextureWrapAlpha() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + int p11 = getCaliValue(); + int p12 = getCaliValue(); + int p13 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.CopyTextureWrapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); +} + +void CopyStretch() { + /* + Gpx.CopyStretch(): 拡大・縮小 + + ds: 転送先 surface 番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + dw: 転送先 幅 + dh: 転送先 高さ + ss: 転送元 surface 番号 + sx: 転送元 x 座標 + sy: 転送元 y 座標 + sw: 転送元 幅 + sh: 転送元 高さ + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int ss = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + surface_t *src, *dst; + + DEBUG_COMMAND_YET("Gpx.CopyStretch %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh); + + src = sf_get(ss); + dst = sf_get(ds); + gr_copy_stretch(dst, dx, dy, dw, dh, src, sx, sy, sw, sh); +} + +void CopyStretchBlend() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + int p9 = getCaliValue(); + int p10 = getCaliValue(); + int p11 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.CopyStretchBlend %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); +} + +void CopyStretchBlendAMap() { + /* + Gpx.CopyStretchBlendAMap(): 拡大・縮小しながら alpha blend + + ds: 転送先 surface 番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + dw: 転送先 幅 + dh: 転送先 高さ + ss: 転送元 surface 番号 + sx: 転送元 x 座標 + sy: 転送元 y 座標 + sw: 転送元 幅 + sh: 転送元 高さ + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int ss = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + surface_t *src, *dst; + + DEBUG_COMMAND("Gpx.CopyStretchBlendAMap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh); + + ags_sync(); + src = sf_get(ss); + dst = sf_get(ds); + gr_copy_stretch_blend_alpha_map(dst, dx, dy, dw, dh, src, sx, sy, sw, sh); +} + +void StretchBlendScreen2x2() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.StretchBlendScreen2x2 %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8); +} + + +void StretchBlendScreen2x2WDS() { + /* + Gpx.StretchBlenfScreen2x2WDS(): 2枚の surface を縦横2倍に拡大しつつ + alpha blend (飽和加算)する + + ds: 転送先 surface 番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + ss1: 転送元 surface 番号 (拡大元 surface) ss1の方が小さい + sx1: 転送元 x 座標 + sy1: 転送元 y 座標 + ss2: 転送元 surface 番号 (重ね先の surface) + sx2: 転送元 x 座標 + sy2: 転送元 y 座標 + sw: 転送元 幅 (sw*2, sh*2)の大きさに拡大 + sh: 転送元 高さ + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int ss1 = getCaliValue(); + int sx1 = getCaliValue(); + int sy1 = getCaliValue(); + int ss2 = getCaliValue(); + int sx2 = getCaliValue(); + int sy2 = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + surface_t *src1, *src2, *dst; + + DEBUG_COMMAND("Gpx.StretchBlendScreen2x2WDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh); + + ags_sync(); + src1 = sf_get(ss1); + src2 = sf_get(ss2); + dst = sf_get(ds); + gr_blend_alpha_wds_stretch2x2(src1, sx1, sy1, src2, sx2, sy2, sw, sh, dst, dx, dy); +} + +void BlendScreenWDS() { + /* + Gpx.BlendScreenWDS(): 飽和加算 alpha blend + + ds : 転送先 surface 番号 + dx : 転送先 x 座標 + dy : 転送先 y 座標 + ss1: 転送元 surface 番号 (重ね元の surface) + sx1: 転送元 x 座標 + sy1: 転送元 y 座標 + ss2: 転送元 surface 番号 (重ね先の surface) + sx2: 転送元 x 座標 + sy2: 転送元 y 座標 + sw : 転送元 幅 + sh : 転送元 高さ + */ + int ds = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int ss1 = getCaliValue(); + int sx1 = getCaliValue(); + int sy1 = getCaliValue(); + int ss2 = getCaliValue(); + int sx2 = getCaliValue(); + int sy2 = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + surface_t *src1, *src2, *dst; + + DEBUG_COMMAND("Gpx.BlendScreenWDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh); + + ags_sync(); + src1 = sf_get(ss1); + src2 = sf_get(ss2); + dst = sf_get(ds); + gr_blend_alpha_wds(src1, sx1, sy1, src2, sx2, sy2, sw, sh, dst, dx, dy); +} + +void EffectCopy() { + /* + Gpx.EffectCopy(): 効果つき領域コピー + + no: 効果番号 + dx: 転送先 x 座標 + dy: 転送先 y 座標 + ss1: 転送元 surface 番号 (重ね元の surface) + sx1: 転送元 x 座標 + sy1: 転送元 y 座標 + ss2: 転送元 surface 番号 (重ね先の surface) + sx2: 転送元 x 座標 + sy2: 転送元 y 座標 + sw: 転送元 幅 + sh: 転送元 高さ + time: 実行時間(ms) (0の場合はそれぞのれ効果毎のデフォルト値) + var: キー入力があったかないか?(?????) + + + effect no: + 1: CE31 (cross fade) + 2: CE29 (fade out) + 3: CE27 (fade in) + 4: CE30 (white out) + 5: CE28 (white in) + 7: CE11 (すだれ落ち) + 11: CE53 (線形ぼかし) + 12: CE35 (上->下クロスフェード) + 13: CE36 (下->上クロスフェード) + */ + int no = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int ss1 = getCaliValue(); + int sx1 = getCaliValue(); + int sy1 = getCaliValue(); + int ss2 = getCaliValue(); + int sx2 = getCaliValue(); + int sy2 = getCaliValue(); + int sw = getCaliValue(); + int sh = getCaliValue(); + int time = getCaliValue(); + int *var = getCaliVariable(); + surface_t *dib, *dst, *src; + + switch(no) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 7: + case 11: + case 12: + case 13: + DEBUG_COMMAND("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var); + break; + default: + DEBUG_COMMAND_YET("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var); + } + ags_sync(); + dib = sf_get(0); + dst = sf_get(ss1); + src = sf_get(ss2); + gpx_effect(no, dib, dx, dy, dst, sx1, sy1, src, sx2, sy2, sw, sh, time, var); + +} + +void SetClickCancelFlag() { /* not used ? */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("Gpx.SetClikCancelFlag %d:\n", p1); +} diff --git a/modules/Gpx/Makefile.am b/modules/Gpx/Makefile.am new file mode 100644 index 0000000..1ff3faf --- /dev/null +++ b/modules/Gpx/Makefile.am @@ -0,0 +1,14 @@ +pkglib_LTLIBRARIES = Gpx.la + +Gpx_la_LDFLAGS = -module -export-dynamic -avoid-version +Gpx_la_LIBADD = ../lib/libgraph.la @GLIB_LIBS@ +Gpx_la_SOURCES = Gpx.c \ + effectcopy.c + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/modules/Gpx -I$(top_srcdir)/modules/Gpx diff --git a/modules/Gpx/Makefile.in b/modules/Gpx/Makefile.in new file mode 100644 index 0000000..6f96754 --- /dev/null +++ b/modules/Gpx/Makefile.in @@ -0,0 +1,562 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/Gpx +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +Gpx_la_DEPENDENCIES = ../lib/libgraph.la +am_Gpx_la_OBJECTS = Gpx.lo effectcopy.lo +Gpx_la_OBJECTS = $(am_Gpx_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(Gpx_la_SOURCES) +DIST_SOURCES = $(Gpx_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = Gpx.la +Gpx_la_LDFLAGS = -module -export-dynamic -avoid-version +Gpx_la_LIBADD = ../lib/libgraph.la @GLIB_LIBS@ +Gpx_la_SOURCES = Gpx.c \ + effectcopy.c + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/modules/Gpx -I$(top_srcdir)/modules/Gpx + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/Gpx/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/Gpx/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +Gpx.la: $(Gpx_la_OBJECTS) $(Gpx_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(Gpx_la_LDFLAGS) $(Gpx_la_OBJECTS) $(Gpx_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gpx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/effectcopy.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/Gpx/effectcopy.c b/modules/Gpx/effectcopy.c new file mode 100644 index 0000000..a3c28e3 --- /dev/null +++ b/modules/Gpx/effectcopy.c @@ -0,0 +1,422 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "surface.h" +// #include "gleffectcopy.h" +#include "counter.h" +#include "ags.h" +#include "imput.h" +#include "graph.h" +#include "ngraph.h" + +/* saved parameter */ +struct ecopyparam { + surface_t *src; + int sx; + int sy; + surface_t *dst; + int dx; + int dy; + int w; + int h; + surface_t *write; + int wx; + int wy; + int time; + boolean cancel; + int spCol; + int extp[10]; + + // for ec11 + surface_t *ss[8]; + surface_t *sd[8]; +}; +typedef struct ecopyparam ecopyparam_t; +static ecopyparam_t ecp; + + + +#define ECA7_D 16 +#define ECA12_D 256 + +static void ec1_cb(int step); +static void ec2_cb(int step); +static void ec3_cb(int step); +static void ec4_cb(int step); +static void ec5_cb(int step); +static void ec7_cb(); +static void ec11_cb(int step); +static void ec11_prepare(void); +static void ec12_cb(int step); +static void ec13_cb(int step); + +static int get_ecounter(void) { + return get_high_counter(SYSTEMCOUNTER_MSEC); +} + +#if 0 +void gle_set_check_clik() { +} +void gle_set_itimer() { +} +#endif + +void gpx_effect(int no, + surface_t *write, int wx, int wy, + surface_t *dst, int dx, int dy, + surface_t *src, int sx, int sy, + int width, int height, + int time, + int *endtype) { + + ags_faderinfo_t i; + + if (!gr_clip(dst, &dx, &dy, &width, &height, write, &wx, &wy)) return; + if (!gr_clip(src, &sx, &sy, &width, &height, write, &wx, &wy)) return; + + ecp.write = write; + ecp.wx = wx; + ecp.wy = wy; + ecp.dst = dst; + ecp.dx = dx; + ecp.dy = dy; + ecp.src = src; + ecp.sx = sx; + ecp.sy = sy; + ecp.w = width; + ecp.h = height; + ecp.time = time; + + switch(no) { + case 1: + i.step_max = 64; + i.effect_time = time == 0 ? 2700 : time; + i.cancel = FALSE; + i.callback = ec1_cb; + ags_fader(&i); + break; + case 2: + i.step_max = 64; + i.effect_time = time == 0 ? 2700 : time; + i.cancel = FALSE; + i.callback = ec2_cb; + ags_fader(&i); + break; + case 3: + i.step_max = 64; + i.effect_time = time == 0 ? 2700 : time; + i.cancel = FALSE; + i.callback = ec3_cb; + ags_fader(&i); + break; + case 4: + i.step_max = 64; + i.effect_time = time == 0 ? 2700 : time; + i.cancel = FALSE; + i.callback = ec4_cb; + ags_fader(&i); + break; + case 5: + i.step_max = 64; + i.effect_time = time == 0 ? 2700 : time; + i.cancel = FALSE; + i.callback = ec5_cb; + ags_fader(&i); + break; + case 7: + ec7_cb(); + break; + case 11: + ec11_prepare(); + i.step_max = 6; + i.effect_time = time == 0 ? 2700 : time; + i.cancel = FALSE; + i.callback = ec11_cb; + ags_fader(&i); + break; + case 12: + i.step_max = ECA12_D + ecp.h; + i.effect_time = time == 0 ? 1150 : time; + i.cancel = FALSE; + i.callback = ec12_cb; + ags_fader(&i); + break; + case 13: + i.step_max = ECA12_D + ecp.h; + i.effect_time = time == 0 ? 1150 : time; + i.cancel = FALSE; + i.callback = ec13_cb; + ags_fader(&i); + break; + default: + gr_copy(write, wx, wy, src, sx, sy, width, height); + ags_updateArea(wx, wy, width, height); + } + + *endtype = 0; + +} + +void sf_blend_white_level(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int lv) { + + int x, y; + BYTE *sp, *dp; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + switch(dst->depth) { + case 15: + { + WORD *yls, *yld; + + for (y = 0; y < sh; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < sw; x++) { + *yld = WHITELEVEL15(*yls, lv); + yls++; yld++; + } + } + break; + } + case 16: + { + WORD *yls, *yld; + + for (y = 0; y < sh; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < sw; x++) { + *yld = WHITELEVEL16(*yls, lv); + yls++; yld++; + } + } + break; + } + case 24: + case 32: + { + DWORD *yls, *yld; + + for (y = 0; y < sh; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < sw; x++) { + *yld = WHITELEVEL24(*yls, lv); + yls++; yld++; + } + } + break; + } + } +} + + +static void ec1_cb(int step) { + if (step == 64) { + gr_copy(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h); + } else { + gre_Blend(ecp.write, ecp.wx, ecp.wy, ecp.dst, ecp.dx, ecp.dy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, step * 4); + } + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} + +static void ec2_cb(int step) { + if (step == 0) { + gr_copy_bright(ecp.write, ecp.wx, ecp.wy, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h, 255); + } else if (step == 64) { + gr_copy_bright(ecp.write, ecp.wx, ecp.wy, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h, 0); + } else { + gr_copy_bright(ecp.write, ecp.wx, ecp.wy, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h, 255 - step * 4); + } + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} + +static void ec3_cb(int step) { + if (step != 64) { + gr_copy_bright(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, step * 4); + } else { + gr_copy_bright(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, 255); + } + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} + +static void ec4_cb(int step) { + if (step != 64) { + sf_blend_white_level(ecp.write, ecp.wx, ecp.wy, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h, step * 4); + } else { + sf_blend_white_level(ecp.write, ecp.wx, ecp.wy, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h, 255); + } + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} + +static void ec5_cb(int step) { + if (step == 0) { + sf_blend_white_level(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, 255); + } else if (step == 64) { + sf_blend_white_level(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, 0); + } else { + sf_blend_white_level(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, 255 - step * 4); + } + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} + +#define EC_WAIT \ + if ((key |= sys_getInputInfo()) && ecp.cancel) break; \ + key = sys_keywait(cnt - get_ecounter(), ecp.cancel); + +static void ec7_cb() { + int i, j, y, key = 0, cnt; + int waitcnt = ecp.time == 0 ? 40 : (ecp.time/60); + + cnt = get_ecounter(); + for (i = 0; i < ECA7_D + ecp.h / ECA7_D -1; i++) { + cnt += waitcnt; + for (j = 0; j < min(i + 1, ECA7_D); j++) { + y = j + ECA7_D * (i-j); + if (y < 0 || y >= ecp.h) continue; + gr_copy(ecp.write, ecp.wx, ecp.wy + y, ecp.src, ecp.sx, ecp.sy + y, ecp.w, 1); + } + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); + EC_WAIT; + } + + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} + +static void ec11_prepare() { + int i; + + ecp.ss[0] = sf_create_surface(ecp.w, ecp.h, ecp.write->depth); + ecp.sd[0] = sf_create_surface(ecp.w, ecp.h, ecp.write->depth); + gr_buller(ecp.ss[0], 0, 0, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, 1 << 2); + gr_buller(ecp.sd[0], 0, 0, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h, 1 << 2); + + for (i = 1; i < 6; i++) { + ecp.ss[i] = sf_create_surface(ecp.w, ecp.h, ecp.write->depth); + ecp.sd[i] = sf_create_surface(ecp.w, ecp.h, ecp.write->depth); + gr_buller(ecp.ss[i], 0, 0, ecp.ss[i-1], 0, 0, ecp.w, ecp.h, 1 << (i+2)); + gr_buller(ecp.sd[i], 0, 0, ecp.sd[i-1], 0, 0, ecp.w, ecp.h, 1 << (i+2)); + } +} + +static void ec11_cb(int step) { + int i; + + if (step == 6) { + for (i = 0; i < 6; i++) { + sf_free(ecp.ss[i]); + sf_free(ecp.sd[i]); + } + gr_copy(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h); + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); + return; + } + + gre_Blend(ecp.write, ecp.wx, ecp.wy, ecp.sd[step], 0, 0, ecp.ss[5-step], 0, 0, ecp.w, ecp.h, ((step+1)*256)/7); + + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} + +#if 0 +static void ec11_cb(int step) { + static surface_t *ss; + static surface_t *sd; + + if (step == 0) { + ss = sf_create_surface(ecp.w, ecp.h, ecp.write->depth); + sd = sf_create_surface(ecp.w, ecp.h, ecp.write->depth); + gr_copy(ss, 0, 0, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h); + gr_copy(sd, 0, 0, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + if (step == 6) { + sf_free(ss); + sf_free(sd); + gr_copy(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h); + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); + return; + } + + gr_buller(ss, 0, 0, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h, 1 << (7-step)); + gr_buller(sd, 0, 0, ecp.dst, ecp.dx, ecp.dy, ecp.w, ecp.h, 1 << (step+1)); + gre_Blend(ecp.write, ecp.wx, ecp.wy, sd, 0, 0, ss, 0, 0, ecp.w, ecp.h, (step*256)/6); + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); +} +#endif + +static void ec12_cb(int step) { + int j, l; + int st_i, ed_i; + static int last_i = 0; + + if (step == 0) { + return; + } + + if (step == ECA12_D + ecp.h) { + gr_copy(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h); + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); + return; + } + + st_i = max(0, step - ECA12_D + 1); + ed_i = min(ecp.h - 1, step); + l = ed_i - st_i + 1; + + for (j = st_i; j < ed_i; j++) { + gre_Blend(ecp.write, ecp.wx, ecp.wy + j, ecp.dst, ecp.dx, ecp.dy + j, ecp.src, ecp.sx, ecp.sy + j, ecp.w, 1, step - j); + } + + if ((st_i - last_i) > 1) { + gr_copy(ecp.write, ecp.wx, ecp.wy + last_i, ecp.src, ecp.sx, ecp.sy+last_i, ecp.w, st_i - last_i); + ags_updateArea(ecp.wx, ecp.wy + last_i, ecp.w, st_i - last_i); + } + + ags_updateArea(ecp.wx, ecp.wy + st_i, ecp.w, l); + + last_i = st_i; +} + +static void ec13_cb(int step) { + int j, l; + int st_i,ed_i; + static int last_i = 0; + int syy1 = ecp.dy + ecp.h -1; + int syy2 = ecp.sy + ecp.h -1; + int dyy = ecp.wy + ecp.h -1; + + if (step == 0) { + return; + } + + if (step == ECA12_D + ecp.h) { + gr_copy(ecp.write, ecp.wx, ecp.wy, ecp.src, ecp.sx, ecp.sy, ecp.w, ecp.h); + ags_updateArea(ecp.wx, ecp.wy, ecp.w, ecp.h); + return; + } + + st_i = max(0, step - ECA12_D + 1); + ed_i = min(ecp.h -1, step); + l = ed_i - st_i+1; + + for (j = st_i; j <= ed_i; j++) { + gre_Blend(ecp.write, ecp.wx, dyy - j, ecp.dst, ecp.dx, syy1 - j, ecp.src, ecp.sx, syy2 - j, ecp.w, 1, step - j); + } + + if ((st_i - last_i) > 1) { + gr_copy(ecp.write, ecp.wx, dyy - st_i + 1, ecp.src, ecp.sx, syy2 - st_i + 1, ecp.w, st_i - last_i); + ags_updateArea(ecp.wx, dyy - st_i + 1, ecp.w, st_i - last_i); + } + + ags_updateArea(ecp.wx, dyy-ed_i, ecp.w, l); + + last_i = st_i; +} diff --git a/modules/Gpx/effectcopy.h b/modules/Gpx/effectcopy.h new file mode 100644 index 0000000..a8c3290 --- /dev/null +++ b/modules/Gpx/effectcopy.h @@ -0,0 +1,14 @@ +#ifndef __GLEFFECTCOPY_H__ +#define __GLEFFECTCOPY_H__ + +#include "surface.h" + +extern void gpx_effect(int no, + surface_t *write, int wx, int wy, + surface_t *dst, int dx, int dy, + surface_t *src, int sx, int sy, + int width, int height, + int time, + int *endtype); + +#endif /* __GLEFFECTCOPY_H__ */ diff --git a/modules/MSGSKIP b/modules/MSGSKIP new file mode 120000 index 0000000..4d96d27 --- /dev/null +++ b/modules/MSGSKIP @@ -0,0 +1 @@ +MsgSkip \ No newline at end of file diff --git a/modules/Makefile.am b/modules/Makefile.am new file mode 100644 index 0000000..d076fe6 --- /dev/null +++ b/modules/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = lib ShArray ShCalc ShPort ShString nDEMO nDEMOE NIGHTDLL RandMT oujimisc Math Gpx MsgSkip ShGraph ShSound dDemo oDEMO SACT eDemo eeDemo tDemo Confirm AliceLogo NightDemonDemo diff --git a/modules/Makefile.in b/modules/Makefile.in new file mode 100644 index 0000000..76bf6e6 --- /dev/null +++ b/modules/Makefile.in @@ -0,0 +1,568 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +SUBDIRS = lib ShArray ShCalc ShPort ShString nDEMO nDEMOE NIGHTDLL RandMT oujimisc Math Gpx MsgSkip ShGraph ShSound dDemo oDEMO SACT eDemo eeDemo tDemo Confirm AliceLogo NightDemonDemo +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +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): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + 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: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + 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 + +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 + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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 Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +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 Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: 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 html \ + html-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 installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + 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/modules/Math/Makefile.am b/modules/Math/Makefile.am new file mode 100644 index 0000000..4a2d0d1 --- /dev/null +++ b/modules/Math/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = Math.la + +Math_la_LDFLAGS = -module -export-dynamic -avoid-version +Math_la_SOURCES = Math.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/Math -I$(top_srcdir)/modules/Math diff --git a/modules/Math/Makefile.in b/modules/Math/Makefile.in new file mode 100644 index 0000000..7cb3259 --- /dev/null +++ b/modules/Math/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/Math +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +Math_la_LIBADD = +am_Math_la_OBJECTS = Math.lo +Math_la_OBJECTS = $(am_Math_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(Math_la_SOURCES) +DIST_SOURCES = $(Math_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = Math.la +Math_la_LDFLAGS = -module -export-dynamic -avoid-version +Math_la_SOURCES = Math.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/Math -I$(top_srcdir)/modules/Math + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/Math/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/Math/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +Math.la: $(Math_la_OBJECTS) $(Math_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(Math_la_LDFLAGS) $(Math_la_OBJECTS) $(Math_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Math.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/Math/Math.c b/modules/Math/Math.c new file mode 100644 index 0000000..11f686b --- /dev/null +++ b/modules/Math/Math.c @@ -0,0 +1,90 @@ +/* + * Math.c 汎用数学関数? OnlyYou -リ・クスル他 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: Math.c,v 1.3 2001/11/29 11:21:44 chikama Exp $ */ + +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +#include "randMT.h" + +static int numtblmax; + +void RandMTInit() { + /* + (おそらく Mersenne Twister使用の) 乱数初期化 + + p1: 初期化用 seed + */ + int p1 = getCaliValue(); /* ITimer */ + + DEBUG_COMMAND("Math.RandMTInit %d:\n", p1); +} + +void RandMTGet() { + /* + 1 から num までの乱数を生成 + + num: 最大値 + var: 結果を返す変数 + */ + int num = getCaliValue(); + int *var = getCaliVariable(); + + if (num == 0 || num == 1) { + *var = num; + } else { + *var = (int)(genrand() * num) + 1; + } + + DEBUG_COMMAND("Math.RandMTGet %d,%p:\n", num, var); +} + +void RandMTMakeNumTable() { + /* + 乱数テーブルの最大値を設定 + + p1: 最大値 + */ + int p1 = getCaliValue(); + + numtblmax = p1; + + DEBUG_COMMAND("Math.RandMTMakeNumTable %d:\n", p1); +} + +void RandMTGetNumTable() { + /* + 乱数テーブルから値を取得 + + var: 乱数を格納する変数 + */ + int *var = getCaliVariable(); + + *var = (int)(genrand() * numtblmax) + 1; + + DEBUG_COMMAND("Math.RandMTGetNumTable %d:\n", *var); +} diff --git a/modules/MsgSkip/Makefile.am b/modules/MsgSkip/Makefile.am new file mode 100644 index 0000000..9b2130b --- /dev/null +++ b/modules/MsgSkip/Makefile.am @@ -0,0 +1,14 @@ +pkglib_LTLIBRARIES = MsgSkip.la MSGSKIP.la + +MsgSkip_la_LDFLAGS = -module -export-dynamic -avoid-version +MsgSkip_la_SOURCES = MsgSkip.c + +MSGSKIP_la_LDFLAGS = -module -export-dynamic -avoid-version +MSGSKIP_la_SOURCES = MsgSkip.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/MsgSkip -I$(top_srcdir)/modules/MsgSkip diff --git a/modules/MsgSkip/Makefile.in b/modules/MsgSkip/Makefile.in new file mode 100644 index 0000000..3c93a0b --- /dev/null +++ b/modules/MsgSkip/Makefile.in @@ -0,0 +1,564 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/MsgSkip +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +MSGSKIP_la_LIBADD = +am_MSGSKIP_la_OBJECTS = MsgSkip.lo +MSGSKIP_la_OBJECTS = $(am_MSGSKIP_la_OBJECTS) +MsgSkip_la_LIBADD = +am_MsgSkip_la_OBJECTS = MsgSkip.lo +MsgSkip_la_OBJECTS = $(am_MsgSkip_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(MSGSKIP_la_SOURCES) $(MsgSkip_la_SOURCES) +DIST_SOURCES = $(MSGSKIP_la_SOURCES) $(MsgSkip_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = MsgSkip.la MSGSKIP.la +MsgSkip_la_LDFLAGS = -module -export-dynamic -avoid-version +MsgSkip_la_SOURCES = MsgSkip.c +MSGSKIP_la_LDFLAGS = -module -export-dynamic -avoid-version +MSGSKIP_la_SOURCES = MsgSkip.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/MsgSkip -I$(top_srcdir)/modules/MsgSkip + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/MsgSkip/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/MsgSkip/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +MSGSKIP.la: $(MSGSKIP_la_OBJECTS) $(MSGSKIP_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(MSGSKIP_la_LDFLAGS) $(MSGSKIP_la_OBJECTS) $(MSGSKIP_la_LIBADD) $(LIBS) +MsgSkip.la: $(MsgSkip_la_OBJECTS) $(MsgSkip_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(MsgSkip_la_LDFLAGS) $(MsgSkip_la_OBJECTS) $(MsgSkip_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MsgSkip.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/MsgSkip/MsgSkip.c b/modules/MsgSkip/MsgSkip.c new file mode 100644 index 0000000..85feb19 --- /dev/null +++ b/modules/MsgSkip/MsgSkip.c @@ -0,0 +1,69 @@ +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +#include "message.h" + +static char *msgskipfile; + +void Init() { + int *p1 = getCaliVariable(); + int p2 = getCaliValue(); /* ISys3x */ + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + + DEBUG_COMMAND_YET("MsgSkip.Init %p,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void Start() { + int *p1 = getCaliVariable(); + int p2 = getCaliValue(); + + msgskipfile = strdup(v_str(p2 -1)); + + DEBUG_COMMAND_YET("MsgSkip.Start %p,%d:\n", p1, p2); +} + +void SetValid() { + int p1 = getCaliValue(); + + + DEBUG_COMMAND("MsgSkip.SetValid %d:\n", p1); +} + +void GetValid() { + int *p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("MsgSkip.GetValid %p:\n", p1); +} + +void SetAction() { + int p1 = getCaliValue(); + + DEBUG_COMMAND("MsgSkip.SetAcion %d:\n", p1); +} + +void GetAction() { + int *p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("MsgSkip.GetAcion %p:\n", p1); +} + +void PushStr() { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("MsgSkip.PushStr %d:\n", p1); +} + +void PopStr() { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("MsgSkip.PopStr %d:\n", p1); +} + diff --git a/modules/NIGHTDLL/Makefile.am b/modules/NIGHTDLL/Makefile.am new file mode 100644 index 0000000..49e9ecb --- /dev/null +++ b/modules/NIGHTDLL/Makefile.am @@ -0,0 +1,26 @@ +pkglib_LTLIBRARIES = NIGHTDLL.la + +NIGHTDLL_la_LDFLAGS = -module -export-dynamic -avoid-version +NIGHTDLL_la_LIBADD = ../lib/libgraph.la ../lib/libdrawtext.la @GLIB_LIBS@ +NIGHTDLL_la_SOURCES = \ + NIGHTDLL.c \ + nt_scenario.c \ + sactcg.c \ + sactstring.c \ + sprite.c \ + sprite_draw.c \ + sprite_update.c \ + sprite_eupdate.c \ + nt_event.c \ + nt_msg.c \ + nt_sel.c \ + nt_graph.c \ + nt_sound.c + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/modules/NIGHTDLL -I$(top_srcdir)/modules/NIGHTDLL diff --git a/modules/NIGHTDLL/Makefile.in b/modules/NIGHTDLL/Makefile.in new file mode 100644 index 0000000..0900f2e --- /dev/null +++ b/modules/NIGHTDLL/Makefile.in @@ -0,0 +1,588 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/NIGHTDLL +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +NIGHTDLL_la_DEPENDENCIES = ../lib/libgraph.la ../lib/libdrawtext.la +am_NIGHTDLL_la_OBJECTS = NIGHTDLL.lo nt_scenario.lo sactcg.lo \ + sactstring.lo sprite.lo sprite_draw.lo sprite_update.lo \ + sprite_eupdate.lo nt_event.lo nt_msg.lo nt_sel.lo nt_graph.lo \ + nt_sound.lo +NIGHTDLL_la_OBJECTS = $(am_NIGHTDLL_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(NIGHTDLL_la_SOURCES) +DIST_SOURCES = $(NIGHTDLL_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = NIGHTDLL.la +NIGHTDLL_la_LDFLAGS = -module -export-dynamic -avoid-version +NIGHTDLL_la_LIBADD = ../lib/libgraph.la ../lib/libdrawtext.la @GLIB_LIBS@ +NIGHTDLL_la_SOURCES = \ + NIGHTDLL.c \ + nt_scenario.c \ + sactcg.c \ + sactstring.c \ + sprite.c \ + sprite_draw.c \ + sprite_update.c \ + sprite_eupdate.c \ + nt_event.c \ + nt_msg.c \ + nt_sel.c \ + nt_graph.c \ + nt_sound.c + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/modules/NIGHTDLL -I$(top_srcdir)/modules/NIGHTDLL + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/NIGHTDLL/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/NIGHTDLL/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +NIGHTDLL.la: $(NIGHTDLL_la_OBJECTS) $(NIGHTDLL_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(NIGHTDLL_la_LDFLAGS) $(NIGHTDLL_la_OBJECTS) $(NIGHTDLL_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NIGHTDLL.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nt_event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nt_graph.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nt_msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nt_scenario.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nt_sel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nt_sound.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactcg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactstring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_draw.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_eupdate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_update.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/NIGHTDLL/NIGHTDLL.c b/modules/NIGHTDLL/NIGHTDLL.c new file mode 100644 index 0000000..27be803 --- /dev/null +++ b/modules/NIGHTDLL/NIGHTDLL.c @@ -0,0 +1,582 @@ +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +#include "night.h" +#include "nt_sound.h" +#include "nt_graph.h" +#include "nt_scenario.h" +#include "nt_msg.h" +#include "nt_event.h" + +#include "sactstring.h" + +// NIGHTDLL用データ +night_t nightprv; + + +void Init(void) { /* 0 */ + int *var = getCaliVariable(); + int p1 = getCaliValue(); /* ISys3xCG */ + int p2 = getCaliValue(); /* ISys3xDIB */ + int p3 = getCaliValue(); /* ISys3xMsgString */ + int p4 = getCaliValue(); /* ISys3xStringTable */ + int p5 = getCaliValue(); /* ISys3xSystem */ + int p6 = getCaliValue(); /* ITimer */ + int p7 = getCaliValue(); /* IUI */ + int p8 = getCaliValue(); /* IWinMsg */ + int p9 = getCaliValue(); /* ISys3x */ + int p10 = getCaliValue(); /* ISys3xInputDevice */ + + *var = 1; + + DEBUG_COMMAND_YET("NIGHTDLL.Init %p:\n", var); +} + +void InitGame() { /* 1 */ + nact->ags.font->antialiase_on = TRUE; + sys_setHankakuMode(2); + + nact->msgout = ntmsg_add; + nact->ags.eventcb = ntev_callback; + nact->callback = ntev_main; + + nt_gr_init(); + ntmsg_init(); + sstr_init(); + + DEBUG_COMMAND_YET("NIGHTDLL.InitGame:\n"); +} + +// メッセージの枠の表示 +void SetMsgFrame() { /* 2 */ + int p1 = getCaliValue(); // 0=枠消去, 1=枠あり, 2=中央 + + ntmsg_set_frame(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetMsgFram %d:\n", p1); +} + +// メッセージの表示位置の設定 +void SetMsgPlaceMethod(void) { /* 3 */ + int p1 = getCaliValue(); // 0=メッセージ枠内, 1=中央, + // 2=メッセージ枠+顔つき + ntmsg_set_place(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetMsgPlaceMethod %d:\n", p1); +} + +// 未実装? +void SetMsgDrawEffect(void) { /* 4 */ + int p1 = getCaliValue(); // 0, 1, 2, 3 (実際にはどれも機能しない?) + + DEBUG_COMMAND_YET("NIGHTDLL.SetMsgDrawEffect %d:\n", p1); +} + +// 未実装? +void SetMsgClearEffect(void) { /* 5 */ + int p1 = getCaliValue(); // 0, 1, 2, 4 (実際にはどれも機能しない?) + + DEBUG_COMMAND_YET("NIGHTDLL.SetMsgClearEffect %d:\n", p1); +} + +// 壁紙CGの設定 +void SetWallPaper(void) { /* 6 */ + int p1 = getCaliValue(); // 壁紙CG番号 + + nt_gr_set_wallpaper(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetWallPaper %d:\n", p1); +} + +// 背景CGの設定 +void SetScenery(void) { /* 7 */ + int p1 = getCaliValue(); // 背景GC番号 + + nt_gr_set_scenery(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetScenery %d:\n", p1); +} + +// 顔CGの設定 +void SetFace(void) { /* 8 */ + int p1 = getCaliValue(); // 顔CG番号 + + nt_gr_set_face(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetFace %d:\n", p1); +} + +// 立ち絵左の設定 +void SetSpriteL(void) { /* 9 */ + int p1 = getCaliValue(); // 左人物スプライト番号 + + nt_gr_set_spL(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteL %d:\n", p1); +} + +// 立ち絵中央の設定 +void SetSpriteM(void) { /* 10 */ + int p1 = getCaliValue(); // 中央人物スプライト番号 + + nt_gr_set_spM(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteM %d:\n", p1); +} + +// 立ち絵右の設定 +void SetSpriteR(void) { /* 11 */ + int p1 = getCaliValue(); // 右人物スプライト番号 + + nt_gr_set_spR(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteR %d:\n", p1); +} + +// 立ち絵左の設定(季節違い?) +void SetSpriteSeasonL(void) { /* 12 */ + int p1 = getCaliValue(); // 左人物スプライト番号 + + nt_gr_set_spsL(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonL %d:\n", p1); +} + +// 立ち絵中央の設定(季節違い?) +void SetSpriteSeasonM(void) { /* 13 */ + int p1 = getCaliValue(); // 中央人物スプライト番号 + + nt_gr_set_spM(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonM %d:\n", p1); +} + +// 立ち絵右の設定(季節違い?) +void SetSpriteSeasonR(void) { /* 14 */ + int p1 = getCaliValue(); // 右人物スプライト番号 + + nt_gr_set_spsR(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonR %d:\n", p1); +} + +// 改行 +void StartNewLine(void) { /* 15 */ + ntmsg_newline(); + + DEBUG_COMMAND_YET("NIGHTDLL.StartNewLine:\n"); +} + +// メッセージフォントサイズの設定 +void SetFontSize(void) { /* 16 */ + int p1 = getCaliValue(); // メッセージフォントサイズ + + night.fontsize = p1; + + DEBUG_COMMAND_YET("NIGHTDLL.SetFontSize %d:\n", p1); +} + +// フォントの種類の設定 +void SetFont(void) { /* 17 */ + int p1 = getCaliValue(); // 0: ゴシック, 1: 明朝 + + night.fonttype = p1; + + DEBUG_COMMAND_YET("NIGHTDLL.SetFont %d:\n", p1); +} + +// 選択肢モード ON +void SetSelMode(void) { /* 18 */ + int p1 = getCaliValue(); // 0, 1(ほとんど0) + + night.selmode = p1; + + DEBUG_COMMAND_YET("NIGHTDLL.SetSelMode %d:\n", p1); +} + +// キー入力待ち後、改ページ +void AnalyzeMessage(void) { /* 19 */ + int *var = getCaliVariable(); // 入力されたキー + + *var = ntmsg_ana(); + + DEBUG_COMMAND_YET("NIGHTDLL.AnalyzeMessage %p:\n", var); +} + +// ~DRAWの効果時間 +void SetDrawTime(void) { /* 20 */ + int p1 = getCaliValue(); // 効果時間 (未使用?) + + nt_gr_set_drawtime(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetDrawTime %d:\n", p1); +} + +// 効果つき画面更新 +void Draw(void) { /* 21 */ + int p1 = getCaliValue(); // 効果番号 + + nt_gr_draw(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.Draw %d:\n", p1); +} + +// 音声データを再生 +void SetVoice(void) { /* 22 */ + int p1 = getCaliValue(); // ファイル番号 + + nt_voice_set(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SetVoice %d:\n", p1); +} + +// 未使用 +void WaitKey(void) { /* 23 */ + int p1 = getCaliValue(); // + + DEBUG_COMMAND_YET("NIGHTDLL.WaitKey %d:\n", p1); +} + +void AddFeeling(void) { /* 24 */ + int p1 = getCaliValue(); // person(1:新開,2:星川,3:百瀬,4:いずみ,5:鏡花,6:真言美,7:マコト + int p2 = getCaliValue(); // val + + DEBUG_COMMAND_YET("NIGHTDLL.AddFeeling %d:\n", p1); + +} + +void SubFeeling(void) { /* 25 */ + int p1 = getCaliValue(); // person + int p2 = getCaliValue(); // val + + DEBUG_COMMAND_YET("NIGHTDLL.SubFeeling %d:\n", p1); +} + +void CallEvent(void) { /* 26 */ + int p1 = getCaliValue(); // 1, 2 (Event Number) + + nt_sco_callevent(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.CallEvent %d:\n", p1); +} + +void ScreenCG(void) { /* 27 */ + /* + CG を読み込んで、surface0 と BlendScreen で重ね合わせ + + x : 表示位置 X + y : 表示位置 Y + no: 読み込むCG番号 + */ + int p1 = getCaliValue(); /* ISys3xDIB */ + int p2 = getCaliValue(); /* ISys3xCG */ + int x = getCaliValue(); + int y = getCaliValue(); + int no = getCaliValue(); + + nt_gr_screencg(no, x, y); + + DEBUG_COMMAND_YET("NIGHTDLL.ScreenCG %d,%d,%d:\n", x, y, no); +} + +void RunGameMain(void) { /* 28 */ + int *p1 = getCaliVariable(); // result + int p2 = getCaliValue(); // month + int p3 = getCaliValue(); // day + int p4 = getCaliValue(); // day of week + int p5 = getCaliValue(); // 0=はじめから,1=途中から + + night.Month = p2; + night.Day = p3; + night.DayOfWeek = p4; + + *p1 = nt_sco_main(p5); + + DEBUG_COMMAND_YET("NIGHTDLL.RunGameMain %p,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5); +} + +void CheckNewGame(void) { /* 29 */ + int *p1 = getCaliVariable(); + + *p1 = 0; + + DEBUG_COMMAND_YET("NIGHTDLL.CheckNewGame %p:\n", p1); +} + +void SaveStartData(void) { /* 30 */ + DEBUG_COMMAND_YET("NIGHTDLL.SaveStartData:\n"); +} + +void PrintExitSystem(void) { /* 31 */ + DEBUG_COMMAND_YET("NIGHTDLL.PrintExitSystem:\n"); +} + +void SetCalendar(void) { /* 32 */ + int p1 = getCaliValue(); // 0, 1, 2 + + DEBUG_COMMAND_YET("NIGHTDLL.SetCalendar %d:\n", p1); +} + +void SetDate(void) { /* 33 */ + int p1 = getCaliValue(); // month + int p2 = getCaliValue(); // day + int p3 = getCaliValue(); // day of week + + night.Month = p1; + night.Day = p2; + night.DayOfWeek = p3; + + DEBUG_COMMAND_YET("NIGHTDLL.SetDate %d,%d,%d:\n", p1, p2, p3); +} + +void GetDate(void) { /* 34 */ + int *p1 = getCaliVariable(); // month + int *p2 = getCaliVariable(); // day + int *p3 = getCaliVariable(); // day of weeek + + *p1 = night.Month; + *p2 = night.Day; + *p3 = night.DayOfWeek; + + DEBUG_COMMAND_YET("NIGHTDLL.GetDate %p,%p,%p:\n", p1, p2, p3); +} + +void SelectGameLevel(void) { /* 35 */ + DEBUG_COMMAND_YET("NIGHTDLL.SelectGameLevel:\n"); +} + +void RunEventDungeon(void) { /* 36 */ + int *p1 = getCaliVariable(); + int p2 = getCaliValue(); + + *p1 = 1; + + DEBUG_COMMAND_YET("NIGHTDLL.RunEventDungeon %p,%d:\n", p1, p2); +} + +void RunEventBattle(void) { /* 37 */ + int p1 = getCaliValue(); // 実際には機能しない? + + DEBUG_COMMAND_YET("NIGHTDLL.RunEventBattle %d:\n", p1); +} + +// CD再生開始 +void CDPlay(void) { /* 38 */ + int p1 = getCaliValue(); // no + + nt_cd_play(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.CDPlay %d:\n", p1); +} + +// CD再生停止 +void CDStop(void) { /* 39 */ + int p1 = getCaliValue(); // time(msec) + + nt_cd_stop(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.CDStop %d:\n", p1); +} + +// CDのmute +void CDMute(void) { /* 40 */ + int p1 = getCaliValue(); // 0: mute off, 1: mute on + + nt_cd_mute(p1 == 0 ? FALSE : TRUE); + + DEBUG_COMMAND_YET("NIGHTDLL.CDMute %d:\n", p1); +} + +// ch に効果音番号をセット +void SoundEffectSetWave(void) { /* 41 */ + int p1 = getCaliValue(); // ch + int p2 = getCaliValue(); // linkno + + nt_snd_setwave(p1, p2); + + DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetWave %d,%d:\n", p1, p2); +} + +// ch にくり返し数をセット +void SoundEffectSetLoop(void) { /* 42 */ + int p1 = getCaliValue(); // ch + int p2 = getCaliValue(); // numloop + + nt_snd_setloop(p1, p2); + + DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetLoop %d,%d:\n", p1, p2); +} + +// ch に音量をセット +void SoundEffectSetVolume(void) { /* 43 */ + int p1 = getCaliValue(); // ch + int p2 = getCaliValue(); // vol + + nt_snd_setvol(p1, p2); + + DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetVolue %d,%d:\n", p1, p2); +} + +// 効果音の再生を終るまで待つか待たないか? +void SoundEffectSetSyncFlag(void) { /* 44 */ + int p1 = getCaliValue(); // ch + int p2 = getCaliValue(); // 0: 終るまで待たない, 1: 待つ + + nt_snd_waitend(p1, p2 == 0 ? FALSE : TRUE); + + DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetSyncFlag %d,%d:\n", p1, p2); +} + +// ch の効果音を再生 +void SoundEffectPlay(void) { /* 45 */ + int p1 = getCaliValue(); // ch + + nt_snd_play(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectPlay %d:\n", p1); +} + +// ch の効果音を停止 +void SoundEffectStop(void) { /* 46 */ + int p1 = getCaliValue(); // ch + int p2 = getCaliValue(); // time (止まるまでの時間) + + nt_snd_stop(p1, p2); + + DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStop %d,%d:\n", p1,p2); +} + +// 全てのチャンネルの再生を停止 +void SoundEffectStopAll(void) { /* 47 */ + int p1 = getCaliValue(); // time (止まるまでの時間) + + nt_snd_stopall(p1); + + DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStopAll %d:\n", p1); +} + +void RunSoundMode(void) { /* 48 */ + + DEBUG_COMMAND_YET("NIGHTDLL.RunSoundMode:\n"); +} + +void RunMapEditor(void) { /* 49 */ + int *p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("NIGHTDLL.RunMapEditor %p:\n", p1); +} + +void VisualListClear(void) { /* 50 */ + + DEBUG_COMMAND_YET("NIGHTDLL.VisualListClear:\n"); +} + +void VisualListAdd(void) { /* 51 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("NIGHTDLL.VisualListAdd %d:\n", p1); +} + +void GetLocalCountCG(void) { /* 52 */ + int *p1 = getCaliVariable(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("NIGHTDLL.GetLocalCountCG %p,%d:\n", p1, p2); +} + +void PlayMemory(void) { /* 53 */ + int *p1 = getCaliVariable(); // 回想ページ + int *p2 = getCaliVariable(); // 回想RESULT + + DEBUG_COMMAND_YET("NIGHTDLL.PlayMemory %p,%p:\n", p1, p2); +} + +void GetEventFlagTotal(void) { /* 54 */ + int *p1 = getCaliVariable(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("NIGHTDLL.GetEventFlagTotal %p,%d:\n", p1, p2); +} + +void SetPlayerName(void) { /* 55 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("NIGHTDLL.SetPlayerName %d:\n", p1); +} + +void GetPlayerName(void) { /* 56 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("NIGHTDLL.GetPlayerName %d:\n", p1); +} + +void SaveGame(void) { /* 57 */ + int *p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("NIGHTDLL.SaveGame %p:\n", p1); +} + +void LoadGame(void) { /* 58 */ + int *p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("NIGHTDLL.LoadGame %p:\n", p1); +} + +void ExistSaveData(void) { /* 59 */ + int *p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("NIGHTDLL.ExistSaveData %p:\n", p1); +} + +void ExistStartData(void) { /* 60 */ + int *p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("NIGHTDLL.ExistStartData %p:\n", p1); +} + +void SetAreaData(void) { /* 61 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + + DEBUG_COMMAND_YET("NIGHTDLL.SetAreaData %d,%d,%d:\n", p1, p2, p3); +} + +void RunBattleTest(void) { /* 62 */ + DEBUG_COMMAND_YET("NIGHTDLL.RunBattleTest:\n"); +} + +void RunTrainingTest(void) { /* 63 */ + DEBUG_COMMAND_YET("NIGHTDLL.RunTrainingTest:\n"); +} + +void TestEventCall(void) { /* 64 */ + DEBUG_COMMAND_YET("NIGHTDLL.TestEventCall:\n"); +} + +void Test(void) { /* 65 */ + DEBUG_COMMAND_YET("NIGHTDLL.Test:\n"); +} + +void DebugScenario(void) { /* 66 */ + DEBUG_COMMAND_YET("NIGHTDLL.DebugScenario:\n"); +} + +void GetDLLTime(void) { /* 67 */ + int *p1 = getCaliVariable(); + int *p2 = getCaliVariable(); + int *p3 = getCaliVariable(); + int *p4 = getCaliVariable(); + int *p5 = getCaliVariable(); + int *p6 = getCaliVariable(); + int *p7 = getCaliVariable(); + + DEBUG_COMMAND_YET("NIGHTDLL.GetDLLTime %p,%p,%p,%p,%p,%p,%p:\n", p1, p2, p3, p4, p5, p6, p7); +} + diff --git a/modules/NIGHTDLL/night.h b/modules/NIGHTDLL/night.h new file mode 100644 index 0000000..ec6c6dd --- /dev/null +++ b/modules/NIGHTDLL/night.h @@ -0,0 +1,80 @@ +#ifndef __NIGHT_H__ +#define __NIGHT_H__ + +#include "config.h" +#include +#include "portab.h" +#include "graphics.h" +#include "surface.h" +#include "ags.h" +#include "sprite.h" + + + +// キーウェイトの種類 +#define KEYWAIT_NONE 0 +#define KEYWAIT_SIMPLE 1 +#define KEYWAIT_SPRITE 2 +#define KEYWAIT_MESSAGE 3 +#define KEYWAIT_SELECT 4 +#define KEYWAIT_BACKLOG 5 + +#define MSGBUFMAX 512 + +#if 0 +// 文字列置換用 +typedef struct { + char *src; // 置き換え元文字列 + char *dst; // 置き換え文字列 +} strexchange_t; +#endif + +struct _night { + // scenario + int Month; + int Day; + int DayOfWeek; + + // keyevent + int waittype; + int waitskiplv; + int waitkey; + + + // graph + // cginfo_t *cg[CGMAX]; + + MyRectangle updaterect; + + int fonttype; + int fontsize; + + sprite_t *sp[SPRITEMAX]; + + int msgplace; + int msgframe; + + // msg + char msgbuf[MSGBUFMAX]; + boolean zhiding; + struct { + void (* cbmove)(agsevent_t *); + void (* cbrelease)(agsevent_t *); + } msg; + //GSList *strreplace; + + // sel + int selmode; + struct { + void (* cbmove)(agsevent_t *); + void (* cbrelease)(agsevent_t *); + } sel; +}; + +typedef struct _night night_t; + +#define night nightprv +extern night_t night; + + +#endif /* __NIGHT_H__ */ diff --git a/modules/NIGHTDLL/nt_event.c b/modules/NIGHTDLL/nt_event.c new file mode 100644 index 0000000..39e2b83 --- /dev/null +++ b/modules/NIGHTDLL/nt_event.c @@ -0,0 +1,108 @@ +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "menu.h" +#include "imput.h" +#include "nact.h" +#include "key.h" +#include "night.h" +#include "sprite.h" + +/* + Messageキー入力待ち時の +*/ +static void cb_waitkey_message(agsevent_t *e) { + switch (e->type) { + case AGSEVENT_BUTTON_RELEASE: + case AGSEVENT_KEY_RELEASE: + night.msg.cbrelease(e); + break; + case AGSEVENT_MOUSE_MOTION: + night.msg.cbmove(e); + break; + } +} + +/* + WaitKeySimpleのcallback +*/ +static void cb_waitkey_simple(agsevent_t *e) { + switch (e->type) { + case AGSEVENT_BUTTON_RELEASE: + case AGSEVENT_KEY_RELEASE: + night.waitkey = e->d3; + break; + } +} + +/* + 選択肢 Window Open 時の callback +*/ +static void cb_waitkey_selection(agsevent_t *e) { + switch (e->type) { + case AGSEVENT_BUTTON_RELEASE: + night.sel.cbrelease(e); + break; + + case AGSEVENT_MOUSE_MOTION: + night.sel.cbmove(e); + break; + } +} + +void ntev_callback(agsevent_t *e) { + // menu open中は無視 + if (nact->popupmenu_opened) { + return; + } + + if (e->type == AGSEVENT_KEY_PRESS && e->d3 == KEY_CTRL) { + night.waitskiplv = 2; + night.waitkey = e->d3; + return; + } + + if (e->type == AGSEVENT_KEY_RELEASE && e->d3 == KEY_CTRL) { + night.waitskiplv = 0; + night.waitkey = e->d3; + return; + } + + switch (night.waittype) { + case KEYWAIT_MESSAGE: + cb_waitkey_message(e); + break; + + case KEYWAIT_SIMPLE: + cb_waitkey_simple(e); + break; + + case KEYWAIT_SPRITE: + cb_waitkey_sprite(e); + break; + + case KEYWAIT_SELECT: + cb_waitkey_selection(e); + break; + + default: + return; + } + +} + +/* + system35のメインループからで呼ばれるコールバック +*/ +void ntev_main() { + // デフォルトのコールバックのうち、ここで必要なものだけ処理。 + if (nact->popupmenu_opened) { + menu_gtkmainiteration(); + if (nact->is_quit) sys_exit(0); + } +} diff --git a/modules/NIGHTDLL/nt_event.h b/modules/NIGHTDLL/nt_event.h new file mode 100644 index 0000000..da4b558 --- /dev/null +++ b/modules/NIGHTDLL/nt_event.h @@ -0,0 +1,8 @@ +#ifndef __NT_EVENT_H__ +#define __NT_EVENT_H__ + +extern void ntev_callback(agsevent_t *e); +extern void ntev_main(); + + +#endif /* __NT_EVENT_H__ */ diff --git a/modules/NIGHTDLL/nt_graph.c b/modules/NIGHTDLL/nt_graph.c new file mode 100644 index 0000000..4c8adb3 --- /dev/null +++ b/modules/NIGHTDLL/nt_graph.c @@ -0,0 +1,207 @@ +#include + +#include "portab.h" +#include "system.h" +#include "cg.h" +#include "ags.h" +#include "surface.h" +#include "ngraph.h" +#include "night.h" +#include "sprite.h" +#include "nt_scenario.h" +#include "sactcg.h" + +// 壁紙スプライト表示位置 +#define WALL_LOC_X 0 +#define WALL_LOC_Y 0 +// 風景スプライト表示位置 +#define SCENERY_LOC_X 0 +#define SCENERY_LOC_Y 64 +// 顔スプライト表示位置 +#define FACE_LOC_X 6 +#define FACE_LOC_Y 272 +// 立ち絵左スプライト表示位置 +#define TACHI_L_LOC_X 0 +#define TACHI_L_LOC_Y 0 +// 立ち絵中央スプライト位置 +#define TACHI_M_LOC_X 160 +#define TACHI_M_LOC_Y 0 +// 立ち絵右スプライト位置 +#define TACHI_R_LOC_X 360 +#define TACHI_R_LOC_Y 0 + +static int effecttime; + +void nt_gr_init() { +} + +void nt_gr_set_wallpaper(int no) { + sprite_t *sp = night.sp[SPNO_WALL]; + + if (sp) { + sp_remove_updatelist(sp); + sp_free(sp); + } + + if (no == 1013 && nt_sco_is_natsu()) { + no = 1011; + } + + if (no == 1014 && nt_sco_is_natsu()) { + no = 1012; + } + + sp = sp_new(SPNO_WALL, no, 0, 0, SPRITE_WP); + sp_add_updatelist(sp); + if (no == 0) { + sp->cursize.width = sf0->width; + sp->cursize.height = sf0->height; + sp->update = sp_draw_wall; + } + + night.sp[SPNO_WALL] = sp; +} + +void nt_gr_set_scenery(int no) { + sprite_t *sp = night.sp[SPNO_SCENERY]; + + if (sp) { + sp_remove_updatelist(sp); + sp_free(sp); + sp = NULL; + } + + if (no) { + sp = sp_new(SPNO_SCENERY, no, 0, 0, SPRITE_NORMAL); + sp_add_updatelist(sp); + sp_set_loc(sp, SCENERY_LOC_X, SCENERY_LOC_Y); + } + + night.sp[SPNO_SCENERY] = sp; +} + +void nt_gr_set_face(int no) { + sprite_t *sp = night.sp[SPNO_FACE]; + + if (sp) { + sp_remove_updatelist(sp); + sp_free(sp); + sp = NULL; + } + if (no) { + sp = sp_new(SPNO_FACE, no, 0, 0, SPRITE_NORMAL); + sp_add_updatelist(sp); + sp_set_loc(sp, FACE_LOC_X, FACE_LOC_Y); + night.msgplace = 2; + } else { + night.msgplace = 0; + } + night.sp[SPNO_FACE] = sp; +} + +void nt_gr_set_spL(int no) { + sprite_t *sp = night.sp[SPNO_TACHI_L]; + + if (sp) { + sp_remove_updatelist(sp); + sp_free(sp); + sp = NULL; + } + if (no) { + sp = sp_new(SPNO_TACHI_L, no, 0, 0, SPRITE_NORMAL); + sp_add_updatelist(sp); + sp_set_loc(sp, TACHI_L_LOC_X, TACHI_L_LOC_Y); + } + night.sp[SPNO_TACHI_L] = sp; +} + +void nt_gr_set_spM(int no) { + sprite_t *sp = night.sp[SPNO_TACHI_M]; + + if (sp) { + sp_remove_updatelist(sp); + sp_free(sp); + sp = NULL; + } + if (no) { + sp = sp_new(SPNO_TACHI_M, no, 0, 0, SPRITE_NORMAL); + sp_add_updatelist(sp); + sp_set_loc(sp, TACHI_M_LOC_X, TACHI_M_LOC_Y); + } + night.sp[SPNO_TACHI_M] = sp; +} + +void nt_gr_set_spR(int no) { + sprite_t *sp = night.sp[SPNO_TACHI_R]; + + if (sp) { + sp_remove_updatelist(sp); + sp_free(sp); + sp = NULL; + } + if (no) { + sp = sp_new(SPNO_TACHI_R, no, 0, 0, SPRITE_NORMAL); + sp_add_updatelist(sp); + sp_set_loc(sp, TACHI_R_LOC_X, TACHI_R_LOC_Y); + } + night.sp[SPNO_TACHI_R] = sp; +} + +void nt_gr_set_spsL(int no) { + if (no) { + if (nt_sco_is_natsu()) no++; + } + nt_gr_set_spL(no); +} + +void nt_gr_set_spsM(int no) { + if (no) { + if (nt_sco_is_natsu()) no++; + } + nt_gr_set_spM(no); +} + +void nt_gr_set_spsR(int no) { + if (no) { + if (nt_sco_is_natsu()) no++; + } + nt_gr_set_spR(no); +} + +void nt_gr_set_drawtime(int msec) { + effecttime = msec; +} + +void nt_gr_draw(int effectno) { + switch(effectno) { + case 0: + // 全消し + break; + case 1: + sp_update_all(TRUE); + break; + default: + if (night.waitskiplv > 1) { + sp_update_all(TRUE); + break; + } + //sp_eupdate(effectno, effecttime, TRUE); + sp_eupdate(effectno, 1000, TRUE); + } +} + +void nt_gr_screencg(int no, int x, int y) { + surface_t *sf; + + ags_sync(); + + sf = sf_loadcg_no(no -1); + + gre_BlendScreen(sf0, x, y, sf0, x, y, sf, 0, 0, sf->width, sf->height); + + ags_updateArea(x, y, sf->width, sf->height); + + sf_free(sf); +} + + diff --git a/modules/NIGHTDLL/nt_graph.h b/modules/NIGHTDLL/nt_graph.h new file mode 100644 index 0000000..88c7ad8 --- /dev/null +++ b/modules/NIGHTDLL/nt_graph.h @@ -0,0 +1,18 @@ +#ifndef __NT_GRAPH_H__ +#define __NT_GRAPH_H__ + +extern void nt_gr_init(); +extern void nt_gr_set_wallpaper(int no); +extern void nt_gr_set_scenery(int no); +extern void nt_gr_set_face(int no); +extern void nt_gr_set_spL(int no); +extern void nt_gr_set_spM(int no); +extern void nt_gr_set_spR(int no); +extern void nt_gr_set_spsL(int no); +extern void nt_gr_set_spsM(int no); +extern void nt_gr_set_spsR(int no); +extern void nt_gr_set_drawtime(int msec); +extern void nt_gr_draw(int effectno); +extern void nt_gr_screencg(int no, int x, int y); + +#endif /* __NT_GRAPH_H__ */ diff --git a/modules/NIGHTDLL/nt_msg.c b/modules/NIGHTDLL/nt_msg.c new file mode 100644 index 0000000..bb1fa13 --- /dev/null +++ b/modules/NIGHTDLL/nt_msg.c @@ -0,0 +1,512 @@ +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "ags.h" +#include "nact.h" +#include "imput.h" +#include "ngraph.h" +#include "drawtext.h" +#include "night.h" +#include "nt_msg.h" +#include "sprite.h" +#include "sactcg.h" +#include "sjisname.h" +#include "sactstring.h" + + +extern int ntsel_dosel(void); + +// 通常メッセージ表示位置と大きさ +#define MSGFRAME_0_X 6 +#define MSGFRAME_0_Y 347 +#define MSGFRAME_0_WIDTH 628 +#define MSGFRAME_0_HEIGHT 125 + +// 画面全体メッセージ表示位置と大きさ +#define MSGFRAME_1_X 0 +#define MSGFRAME_1_Y 0 +#define MSGFRAME_1_WIDTH 640 +#define MSGFRAME_1_HEIGHT 480 + +// 通常メッセージ(顔つき)表示位置と大きさ +#define MSGFRAME_2_X (6+160) +#define MSGFRAME_2_Y 347 +#define MSGFRAME_2_WIDTH (628-160) +#define MSGFRAME_2_HEIGHT 125 + +// キー入力アニメーション位置 +#define HAKANIM_LOC_X 620 +#define HAKANIM_LOC_Y 450 +// キー入力アニメーション間隔 +#define HAKANIM_INTERVAL 250 + +// デフォルトメッセージフォントサイズ +#define MSG_DEFFONTSIZE 24 + + +static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace); +static void set_align(char *msg, sprite_t *sp, int wSize); +static BYTE *get_char(BYTE *msg, char *mbuf, int bufmax); +static void cb_keyrelease(agsevent_t *e); +static void cb_mousemove(agsevent_t *e); +static void setup_hakanim(); +static void hakanim(int i); +static int ntmsg_keywait(); +static void ntmsg_clear(int wNum); + + +// 初期化 +void ntmsg_init() { + sprite_t *sp; + + // メッセージスプライト + sp = night.sp[SPNO_MSGFRAME_FG] = sp_msg_new(SPNO_MSGFRAME_FG, 0, 0, sf0->width, sf0->height); + sp_add_updatelist(sp); + + // メッセージ背景用CG + sp = night.sp[SPNO_MSGFRAME_BG] = sp_new(SPNO_MSGFRAME_BG, CGNO_MSGFRAME_LCG, 0, 0, SPRITE_NORMAL); + sp_add_updatelist(sp); + + // 文字背景CG作成 + scg_create(CGNO_MSGFR_BG, + sf0->width, sf0->height, + 0, 0, 0, 255); + // night.cg[CGNO_MSGFR_BG]->refcnt++; + + // 文字背景CGのためのsprite + sp = night.sp[SPNO_MSGBG] = sp_new(SPNO_MSGBG, CGNO_MSGFR_BG, 0, 0, SPRITE_NORMAL); + sp_add_updatelist(sp); + + // キー入力アニメーションCG作成 + scg_cut(CGNO_MSGHAK_1, CGNO_MSGHAK_LCG, 0, 0, 9, 9); + //night.cg[CGNO_MSGHAK_1]->refcnt++; + scg_cut(CGNO_MSGHAK_2, CGNO_MSGHAK_LCG, 0, 9, 9, 9); + //night.cg[CGNO_MSGHAK_2]->refcnt++; + sp = night.sp[SPNO_MSG_KEYANIM] = sp_new(SPNO_MSG_KEYANIM, CGNO_MSGHAK_1, CGNO_MSGHAK_2, 0, SPRITE_ANIME); + sp->u.anime.interval = HAKANIM_INTERVAL; + sp_add_updatelist(sp); + sp_set_loc(sp, HAKANIM_LOC_X, HAKANIM_LOC_Y); + sp_set_show(sp, FALSE); + sp->update = sp_draw_scg; + + + + + + + // 主人公名前 + sstr_regist_replace(SNAME_RYO, SNAME_RYO_DEF); + + night.msg.cbmove = cb_mousemove; + night.msg.cbrelease = cb_keyrelease; + + ntmsg_set_frame(0); + ntmsg_set_place(0); + + night.selmode = -1; + +} + +// メッセージ枠の種類 +// type=0 消去 +// type=1 枠あり +// type=2 中央 +void ntmsg_set_frame(int type) { + surface_t *sf; + + night.msgframe = type; + + sf = night.sp[SPNO_MSGBG]->curcg->sf; + memset(sf->pixel, 0, sf->bytes_per_line * sf->height); + memset(sf->alpha, 0, sf->width * sf->height); + + switch(type) { + case 0: + sp_set_show(night.sp[SPNO_MSGBG], FALSE); + sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE); + sp_set_show(night.sp[SPNO_MSGFRAME_FG], FALSE); + break; + case 1: + sp_set_show(night.sp[SPNO_MSGBG], TRUE); + sp_set_show(night.sp[SPNO_MSGFRAME_BG], TRUE); + sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE); + + gr_fill(sf, MSGFRAME_0_X, MSGFRAME_0_Y, + MSGFRAME_0_WIDTH, MSGFRAME_0_HEIGHT, + 16, 32, 64); + gr_fill_alpha_map(sf, MSGFRAME_0_X, MSGFRAME_0_Y, + MSGFRAME_0_WIDTH, MSGFRAME_0_HEIGHT, 192); + ntmsg_clear(SPNO_MSGFRAME_FG); + sp_update_all(TRUE); + break; + case 2: + sp_set_show(night.sp[SPNO_MSGBG], TRUE); + sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE); + sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE); + + gr_fill(sf, MSGFRAME_1_X, MSGFRAME_1_Y, + MSGFRAME_1_WIDTH, MSGFRAME_1_HEIGHT, + 32, 32, 32); + gr_fill_alpha_map(sf, MSGFRAME_1_X, MSGFRAME_1_Y, + MSGFRAME_1_WIDTH, MSGFRAME_1_HEIGHT, 128); + ntmsg_clear(SPNO_MSGFRAME_FG); + sp_update_all(TRUE); + + break; + } +} + +/* + メッセージ領域の設定 + type=0: 628x125+6+347 + type=1: 640x480+0+0 + type=2: (628-120)x125+(6+120)+347 + +*/ +void ntmsg_set_place(int type) { + night.msgplace = type; +} + +void ntmsg_newline() { + BYTE buf[2] = {'\n', '\0'}; + ntmsg_add(buf); +} + +void ntmsg_add(char *msg) { + int len; + + WARNING("len = %d\n", strlen(msg)); + + if (msg[0] == '\0') return; + + if (0) { + char *b = sjis2euc(msg); + fprintf(stderr, "add msg '%s'\n", b); + free(b); + } + + len = MSGBUFMAX - (int)strlen(night.msgbuf); + if (len < 0) { + WARNING("buf shortage (%d)\n", len); + return; + } + strncat(night.msgbuf, msg, len); + night.msgbuf[MSGBUFMAX -1] = '\0'; +} + +int ntmsg_ana(void) { + int ret; + + if (night.selmode == 0) { + // sel start + ret = ntsel_dosel(); + } else { + // msg newpage + ntmsg_out(SPNO_MSGFRAME_FG, night.fontsize, 255, 255, 255, night.fonttype, 0, 2); + sp_update_clipped(); + ret = ntmsg_keywait(); + + // clear msgsprite + ntmsg_clear(SPNO_MSGFRAME_FG); + //sp_update_clipped(); + } + + night.selmode = -1; + return ret; +} + +static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace) { + char *msg; + sprite_t *sp; + boolean needupdate = FALSE; + MyRectangle uparea = {0,0,0,0}; + int savex; + + if (night.msgbuf[0] == '\0') return; + + // shortcut + sp = night.sp[wNum]; + + msg = sstr_replacestr(night.msgbuf); + + // 文字アラインメントの調整 + set_align(msg, sp, wSize); + savex = sp->u.msg.dspcur.x; + + + while (*msg) { + char mbuf[20]; + int cw, delta, wcnt; + + wcnt = get_high_counter(SYSTEMCOUNTER_MSEC); + + mbuf[0] = '\0'; + msg = get_char(msg, mbuf, sizeof(mbuf) -1); + + if (mbuf[0] == '\n') { + sp->u.msg.dspcur.x = savex; + sp->u.msg.dspcur.y += (wSize + wLineSpace); + continue; + } + + dt_setfont(wFont, wSize); + + if (1) { + char *b = sjis2euc(mbuf); + fprintf(stderr, "msg '%s'\n", b); + free(b); + } + + cw = dt_drawtext_col(sp->u.msg.canvas, + sp->u.msg.dspcur.x, + sp->u.msg.dspcur.y, + mbuf, + wColorR, wColorG, wColorB); + + needupdate = TRUE; + + if (wSpeed > 0) { + sp_updateme_part(sp, + sp->u.msg.dspcur.x, + sp->u.msg.dspcur.y, + cw, + wSize); + sp_update_clipped(); + needupdate = FALSE; + + // keywait + delta = get_high_counter(SYSTEMCOUNTER_MSEC) - wcnt; + if (delta < wSpeed) { + if (sys_keywait(wSpeed - delta, FALSE)) { + + wSpeed = 0; + } + } + } + + sp->u.msg.dspcur.x += cw; + } + + // バッファリング中の文字のクリア + night.msgbuf[0] = '\0'; + + // Waitなしの出力は最後にupdate + if (needupdate) { + uparea.width = sp->cursize.width; + uparea.height = min(sp->cursize.height, uparea.y - sp->u.msg.dspcur.y + wLineSpace + wLineSpace); + sp_updateme_part(sp, uparea.x, uparea.y, uparea.width, uparea.height); + } + +} + +/* + メッセージキー入力待ち + @param: none + @return: 入力されたキー + */ +static int ntmsg_keywait() { + int i = 0; + + if (night.waitskiplv > 0) return 0; + + // アニメパターンの初期化 + setup_hakanim(); + + night.waittype = KEYWAIT_MESSAGE; + night.waitkey = -1; + + while (night.waitkey == -1) { + int st = get_high_counter(SYSTEMCOUNTER_MSEC); + int interval = 25; + + if (!night.zhiding) { + interval = night.sp[SPNO_MSG_KEYANIM]->u.anime.interval; + hakanim(i++); + } + sys_keywait(interval - (get_high_counter(SYSTEMCOUNTER_MSEC) - st), FALSE); + } + + night.waittype = KEYWAIT_NONE; + + return night.waitkey; +} + + +static void set_align(char *msg, sprite_t *sp, int wSize) { + int line, maxchar, c; + + switch(night.msgplace) { + case 0: + sp->u.msg.dspcur.x = MSGFRAME_0_X; + sp->u.msg.dspcur.y = MSGFRAME_0_Y + 8; + break; + + case 1: + // もっとも長い行が中心にくるようにし、 + // 他の行はその行の先頭に先頭をあわせる + line = 0; maxchar = 0; + + c = 0; + while (*msg) { + if (*msg == '\n') { + line++; + maxchar = MAX(maxchar, c); + c = 0; + msg++; + continue; + } + msg++; c++; + } + + maxchar = MAX(maxchar, c); + line++; + sp->u.msg.dspcur.x = (sp->cursize.width - (maxchar * wSize/2)) /2; + sp->u.msg.dspcur.y = (sp->cursize.height - (line * (wSize+2))) /2; + break; + case 2: + sp->u.msg.dspcur.x = MSGFRAME_2_X; + sp->u.msg.dspcur.y = MSGFRAME_2_Y + 8; + break; + } + +} + +static BYTE *get_char(BYTE *msg, char *mbuf, int bufmax) { + int c1; + + // 改行 + if (msg[0] == '\n') { + mbuf[0] = '\n'; + mbuf[1] = '\0'; + return msg +1; + } + + c1 = *msg++; + + *mbuf++ = c1; + + if ((c1 >= 0x81 && c1 < 0xa0) || (c1 >= 0xe0 && c1 <= 0xee)) { + *mbuf++ = *msg++; + } + *mbuf = '\0'; + + return msg; +} + +static void is_in_icon() { + +} + + +static void cb_keyrelease(agsevent_t *e) { + int x = e->d1, y = e->d2; + + switch (e->d3) { + case AGSEVENT_BUTTON_LEFT: +#if 0 + if (is_in_icon()) { + do_icon(x, y); + break; + } +#endif + // fall through + case AGSEVENT_BUTTON_RIGHT: + if (night.zhiding) { + // unhide(); + break; + } + night.waitkey = e->d3; + break; + } + +} + +static void cb_mousemove(agsevent_t *e) { + int x = e->d1, y = e->d2; + + // 音声mute/メッセージスキップ/メッセージ枠消去の領域に + // マウスが移動したら、その部分のアイコンを変化させる + + +} + +// メッセージ表示時に、キー入力を促すアニメーションの設定 +static void setup_hakanim() { +} + +// メッセージ表示時のキー入力を促すアニメーション +static void hakanim(int i) { + sprite_t *sp; + boolean show; + + sp = night.sp[SPNO_MSG_KEYANIM]; + if (sp == NULL) return; + show = sp->show; + if (i%2) { + sp->curcg = sp->cg1; + } else { + sp->curcg = sp->cg2; + } + sp->show = TRUE; + sp_updateme(sp); + sp_update_clipped(); + + sp->show = show; +} + +int ntmsg_update(sprite_t *sp, MyRectangle *r) { + int sx, sy, w, h, dx, dy; + surface_t update; + + // canvas が clean のときはなにもしない + // -> 説明スプライトのように、SetShowされたときに対応できないからだめ + //if (sact.msgbufempty) return OK; + + update.width = r->width; + update.height = r->height; + + dx = sp->cur.x - r->x; + dy = sp->cur.y - r->y; + + w = sp->cursize.width; + h = sp->cursize.height; + + sx = 0; sy = 0; + + if (!gr_clip(sp->u.msg.canvas, &sx, &sy, &w, &h, &update, &dx, &dy)) { + return NG; + } + + dx += r->x; + dy += r->y; + + gre_BlendUseAMap(sf0, dx, dy, sf0, dx, dy, sp->u.msg.canvas, sx, sy, w, h, sp->u.msg.canvas, sx, sy, sp->blendrate); + + WARNING("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n", + sp->no, sx, sy, w, h, dx, dy); + + return OK; +} + +static void ntmsg_clear(int wNum) { + sprite_t *sp = night.sp[wNum]; + surface_t *sf; + + sp->u.msg.dspcur.x = 0; + sp->u.msg.dspcur.y = 0; + + night.msgbuf[0] = '\0'; + + // キャンバスのクリア + sf = sp->u.msg.canvas; + memset(sf->pixel, 0, sf->bytes_per_line * sf->height); + memset(sf->alpha, 0, sf->width * sf->height); + + sp_updateme(sp); +} diff --git a/modules/NIGHTDLL/nt_msg.h b/modules/NIGHTDLL/nt_msg.h new file mode 100644 index 0000000..6af9a32 --- /dev/null +++ b/modules/NIGHTDLL/nt_msg.h @@ -0,0 +1,12 @@ +#ifndef __NT_MSG_H__ +#define __NT_MSG_H__ + +extern void ntmsg_init(); +extern void ntmsg_set_frame(int type); +extern void ntmsg_set_place(int type); +extern void ntmsg_newline(); +extern void ntmsg_add(char *msg); +extern int ntmsg_ana(void); +extern int ntmsg_update(sprite_t *sp, MyRectangle *r); + +#endif /* __NT_MSG_H__ */ diff --git a/modules/NIGHTDLL/nt_scenario.c b/modules/NIGHTDLL/nt_scenario.c new file mode 100644 index 0000000..51fb1d2 --- /dev/null +++ b/modules/NIGHTDLL/nt_scenario.c @@ -0,0 +1,125 @@ +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "imput.h" +#include "xsystem35.h" +#include "nact.h" +#include "scenario.h" +#include "s39ain.h" +#include "night.h" +#include "nt_msg.h" + +/* defined by cmd_check.c */ +extern void check_command(int c0); + +#define MAINLOOP_EVENTCHECK_INTERVAL 16 /* 16 msec */ + + +struct _scoadr { + int page; + int index; +}; + +static struct _scoadr scene2adr(int no) { + int i; + char label[7] = {0}; + struct _scoadr adr = {0, 0}; + + snprintf(label, 7, "E%05d", no); + WARNING("seaching %6s\n", label); + for (i = 0; i < nact->ain.fncnum; i++) { + if (0 == strncmp(nact->ain.fnc[i].name, label, 6)) { + adr.page = nact->ain.fnc[i].page; + adr.index = nact->ain.fnc[i].index; + return adr; + } + } + + WARNING("no scene %d\n", no); + return adr; +} + + +void nt_sco_init() { +} + +static void ntmain(struct _scoadr inadr) { + int scono = 0, cnt = 0; + struct _scoadr curadr; + + while (!nact->is_quit) { + DEBUG_MESSAGE("%d:%x\n", sl_getPage(), sl_getIndex()); + //WARNING("%d:%x\n", sl_getPage(), sl_getIndex()); + if (!nact->popupmenu_opened) { + check_command(sl_getc()); + if (sl_getPage() == inadr.page && + sl_getIndex() == inadr.index) { + // ~E%05dからの戻り + if (nact->fnc_return_value == 0) { + break; + } else { + scono = nact->fnc_return_value; + } + curadr = scene2adr(scono); + sl_callFar2(curadr.page -1, curadr.index); + } + } + + if (!nact->is_message_locked) { + if (get_high_counter(SYSTEMCOUNTER_MAINLOOP)) { + sys_getInputInfo(); + reset_counter_high(SYSTEMCOUNTER_MAINLOOP, MAINLOOP_EVENTCHECK_INTERVAL, 0); + } + } + if (cnt == 10000) { + usleep(10); /* XXXX */ + cnt = 0; + } + cnt++; + nact->callback(); + } +} + +/* + mode = 0: はじめから + 1: 途中から +*/ +int nt_sco_main(int mode) { + int scono = 1, cnt = 0; + struct _scoadr stadr, curadr; + + sys_exit(2); + + return 1; +} + +void nt_sco_callevent(int ev) { + struct _scoadr stadr, curadr; + + // InitGameMainが呼ばれたときのアドレス=関数終了時の戻りアドレス + stadr.page = sl_getPage(); + stadr.index = sl_getIndex(); + + // シーン1 + curadr = scene2adr(ev); + sl_callFar2(curadr.page -1, curadr.index); + + ntmain(stadr); + + sl_jmpFar2(stadr.page, stadr.index); +} + + +boolean nt_sco_is_natsu() { + if (night.Month < 6 || night.Month > 9) return FALSE; + if (night.Month == 6 && night.Day < 11) return FALSE; + return TRUE; +} + diff --git a/modules/NIGHTDLL/nt_scenario.h b/modules/NIGHTDLL/nt_scenario.h new file mode 100644 index 0000000..a151c6d --- /dev/null +++ b/modules/NIGHTDLL/nt_scenario.h @@ -0,0 +1,9 @@ +#ifndef __NT_SCENARIO_H__ +#define __NT_SCENARIO_H__ + +extern void nt_sco_init(); +extern int nt_sco_main(int mode); +extern boolean nt_sco_is_natsu(); +extern void nt_sco_callevent(int ev); + +#endif /* __NT_SCENARIO_H__ */ diff --git a/modules/NIGHTDLL/nt_sel.c b/modules/NIGHTDLL/nt_sel.c new file mode 100644 index 0000000..a9126df --- /dev/null +++ b/modules/NIGHTDLL/nt_sel.c @@ -0,0 +1,5 @@ +int ntsel_dosel(int mode) { + // 選択肢を描画 + // + return 0; +} diff --git a/modules/NIGHTDLL/nt_sound.c b/modules/NIGHTDLL/nt_sound.c new file mode 100644 index 0000000..4aa078a --- /dev/null +++ b/modules/NIGHTDLL/nt_sound.c @@ -0,0 +1,87 @@ +#include "config.h" + +#include +#include "portab.h" + +#include "music_client.h" +#include "night.h" + +struct _ntsnd { + int no; + int vol; + int loop; + boolean waitend; +}; +static struct _ntsnd ntsnd[10]; + + +void nt_voice_set(int no) { + if (night.waitskiplv < 1) { + mus_wav_load(100, no); + mus_wav_play(100, 1); + } +} + +void nt_cd_play(int no) { + mus_cdrom_stop(); + mus_cdrom_start(no +1, 0); +} + +void nt_cd_stop(int msec) { + mus_mixer_fadeout_start(MIX_CD, msec, 0, TRUE); +} + +void nt_cd_mute(boolean mute) { + if (mute) { + mus_mixer_fadeout_start(MIX_CD, 0, 0, FALSE); + } else { + mus_mixer_fadeout_start(MIX_CD, 0, 100, FALSE); + } +} + +void nt_snd_setwave(int ch, int no) { + if (ch < 1) return; + ntsnd[ch -1].no = no; + mus_wav_load(ch, no); +} + +void nt_snd_setloop(int ch, int num) { + if (ch < 1) return; + + ntsnd[ch -1].loop = num; +} + +void nt_snd_setvol(int ch, int vol) { + if (ch < 1) return; + + ntsnd[ch -1].vol = vol; +} + +void nt_snd_waitend(int ch, boolean waitend) { + if (ch < 1) return; + + ntsnd[ch -1].waitend = waitend; +} + +void nt_snd_play(int ch) { + if (ch < 1) return; + + mus_wav_play(ch, ntsnd[ch -1].loop); + if (ntsnd[ch -1].waitend) { + mus_wav_waitend(ch); + } +} + +void nt_snd_stop(int ch, int msec) { + if (ch < 1) return; + + mus_wav_fadeout_start(ch, msec, 0, TRUE); +} + +void nt_snd_stopall(int msec) { + int i; + + for (i = 1; i <= 10; i++) { + mus_wav_fadeout_start(i, msec, 0, TRUE); + } +} diff --git a/modules/NIGHTDLL/nt_sound.h b/modules/NIGHTDLL/nt_sound.h new file mode 100644 index 0000000..4bfda52 --- /dev/null +++ b/modules/NIGHTDLL/nt_sound.h @@ -0,0 +1,18 @@ +#ifndef __NT_SOUND_H__ +#define __NT_SOUND_H__ + +#include "portab.h" + +extern void nt_voice_set(int no); +extern void nt_cd_play(int no); +extern void nt_cd_stop(int msec); +extern void nt_cd_mute(boolean mute); +extern void nt_snd_setwave(int ch, int no); +extern void nt_snd_setloop(int ch, int num); +extern void nt_snd_setvol(int ch, int vol); +extern void nt_snd_waitend(int ch, boolean waitend); +extern void nt_snd_play(int ch); +extern void nt_snd_stop(int ch, int msec); +extern void nt_snd_stopall(int msec); + +#endif /* __NT_SOUND_H__ */ diff --git a/modules/NIGHTDLL/sactcg.c b/modules/NIGHTDLL/sactcg.c new file mode 100644 index 0000000..2e96bd2 --- /dev/null +++ b/modules/NIGHTDLL/sactcg.c @@ -0,0 +1,506 @@ +/* + * sactcg.c: CG作成 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactcg.c,v 1.2 2003/11/16 15:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "nact.h" +#include "system.h" +#include "ags.h" +#include "surface.h" +#include "ngraph.h" +#include "sactcg.h" + +#define CGMAX 65536 +static cginfo_t *cgs[CGMAX]; + +#include "sactcg_stretch.c" +#include "sactcg_blend.c" + + +#define spcg_assert_no(no) \ + if ((no) > (CGMAX -1)) { \ + WARNING("no is too large (should be %d < %d)\n", (no), CGMAX); \ + return NG; \ + } \ + + +/* + cgの読み込み + + 指定の番号のCGをリンクファイルから読み込んだり、 + CG_xxxで作成したCGを参照する + + @param no: 読み込むCG番号 + @param refinc: 参照カウンタを増やすかどうか。 + spriteから参照されるときは増やし、CG_xxxを作る時に + 参照されるときは増やさない。 +*/ +cginfo_t *scg_loadcg_no(int no, boolean refinc) { + cginfo_t *i; + + if (no >= (CGMAX -1)) { + WARNING("no is too large (should be %d < %d)\n", (no), CGMAX); + return NULL; + } + + // すでに ロードされているか、CG_xxx で作成ずみの場合は + // 参照カウンタを増やす + if (cgs[no] != NULL) { + if (refinc) { + cgs[no]->refcnt++; + } + return cgs[no]; + } + + i = g_new(cginfo_t, 1); + i->type = CG_LINKED; + i->no = no; + i->refcnt = (refinc ? 1 : 0); + i->sf = sf_loadcg_no(no -1); + if (i->sf == NULL) { + WARNING("load fail (%d)\n", no -1); + g_free(i); + return NULL; + } + + cgs[no] = i; + + return i; +} + +// 指定の大きさ、色の矩形の CG を作成 +int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate) { + cginfo_t *i; + + spcg_assert_no(wNumCG); + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumCG; + i->refcnt = 1; + i->sf = sf_create_surface(wWidth, wHeight, sf0->depth); + gr_fill(i->sf, 0, 0, wWidth, wHeight, wR, wG, wB); + gr_fill_alpha_map(i->sf, 0, 0, wWidth, wHeight, wBlendRate); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + cgs[wNumCG] = i; + + return OK; +} + +// 指定のCGを反転させたCGを作成 +int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY) { + cginfo_t *i, *srccg; + surface_t *src; + + spcg_assert_no(wNumCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_REVERSE; + i->no = wNumCG; + i->refcnt = 0; + + src = srccg->sf; + i->sf = stretch(src, src->width, src->height, (wReverseX << 1) | wReverseY); + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + cgs[wNumCG] = i; + + return OK; +} + +// 指定のCGを拡大/縮小したCGを作成 +int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) { + cginfo_t *i, *srccg; + surface_t *src; + + spcg_assert_no(wNumCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_STRETCH; + i->no = wNumCG; + i->refcnt = 0; + + src = srccg->sf; + i->sf = stretch(src, wWidth, wHeight, 0); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + cgs[wNumCG] = i; + + return OK; +} + +// ベースCGの上にブレンドCGを重ねた CG を作成 +int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode) { + cginfo_t *i, *basecg, *blendcg; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumBaseCG); + spcg_assert_no(wNumBlendCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + basecg = scg_loadcg_no(wNumBaseCG, FALSE); + blendcg = scg_loadcg_no(wNumBlendCG, FALSE); + if (basecg == NULL || blendcg == NULL) return NG; + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + + i->sf = blend(basecg->sf, wX , wY, blendcg->sf, wAlphaMapMode); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + cgs[wNumDstCG] = i; + + return OK; +} + +// 指定の文字列のCGを作成 +int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText) { + cginfo_t *i; + agsurface_t *glyph; + FONT *font; + + if (0) { + char *b = sjis2euc(cText); + WARNING("str = '%s'\n", b); + free(b); + } + + spcg_assert_no(wNumCG); + + // 勝手に出ていいのかな? + if (strlen(cText) == 0) return OK; + + font = nact->ags.font; + font->sel_font(FONT_GOTHIC, wSize); + + glyph = font->get_glyph(cText); + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumCG; + i->refcnt = 0; + + i->sf = sf_create_surface(glyph->width, wSize, nact->ags.dib->depth); + gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB); + gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + cgs[wNumCG] = i; + + return OK; +} + +// 数字文字列のCGを作成 +int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue) { + cginfo_t *i; + agsurface_t *glyph; + FONT *font; + char s[256], ss[256]; + + spcg_assert_no(wNumCG); + + if (wZeroPadding) { + char *sss = "%%0%dd"; + sprintf(ss, sss, wFigs); + } else { + char *sss = "%%%dd"; + sprintf(ss, sss, wFigs); + } + sprintf(s, ss, wValue); + + font = nact->ags.font; + font->sel_font(FONT_GOTHIC, wSize); + glyph = font->get_glyph(s); + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumCG; + i->refcnt = 0; + i->sf = sf_create_surface(glyph->width, wSize, nact->ags.dib->depth); + gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB); + gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + cgs[wNumCG] = i; + + return OK; +} + +// CGを複製 +int scg_copy(int wNumDstCG, int wNumSrcCG) { + cginfo_t *i, *srccg; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + i->sf = sf_dup(srccg->sf); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + cgs[wNumDstCG] = i; + + return OK; +} + +// CGの一部を切りぬいたCGを作成 +int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) { + cginfo_t *i, *srccg; + surface_t *dst, *src; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + + src = srccg->sf; + if (src->has_alpha) { + dst = sf_create_surface(wWidth, wHeight, src->depth); + } else { + dst = sf_create_pixel(wWidth, wHeight, src->depth); + } + if (src->has_pixel) { + gr_copy(dst, 0, 0, src, wX, wY, wWidth, wHeight); + } + if (src->has_alpha) { + gr_copy_alpha_map(dst, 0, 0, src, wX, wY, wWidth, wHeight); + } + + i->sf = dst; + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + cgs[wNumDstCG] = i; + + return OK; +} + +// 元のCGの一部を切りぬいたCGを作成 +int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) { + cginfo_t *i, *srccg; + surface_t *dst, *src; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + + src = srccg->sf; + if (src->has_alpha) { + dst = sf_create_surface(src->width, src->height, src->depth); + gr_fill_alpha_map(dst, 0, 0, src->width, src->height, 255); + } else { + dst = sf_create_pixel(src->width, src->height, src->depth); + } + + if (src->has_pixel) { + gr_copy(dst, wX, wY, src, wX, wY, wWidth, wHeight); + } + if (src->has_alpha) { + gr_copy_alpha_map(dst, wX, wY, src, wX, wY, wWidth, wHeight); + } + + i->sf = dst; + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + cgs[wNumDstCG] = i; + + return OK; +} + +// 全てのCGの開放 +int scg_freeall() { + int i; + + for (i = 1; i < CGMAX; i++) { + scg_free(i); + } + return OK; +} + +/** + * 指定の番号の CG をオブジェクトリストから消し、オブジェクトがどこからも参照 + * されていない(参照数が0の)場合のみ、オブジェクトを削除 + */ +int scg_free(int no) { + cginfo_t *cg; + + spcg_assert_no(no); + + if (NULL == (cg = cgs[no])) return NG; + + // 参照数が0の時のみオブジェクトを開放 + if (cg->refcnt == 0) { + scg_free_cgobj(cg); + } + + // 番号で消したときはオブジェクトが開放されなくても + // オブジェクトリストから削除 + cgs[no] = NULL; + + return OK; +} + +/** + * CG オブジェクトの開放 + */ +int scg_free_cgobj(cginfo_t *cg) { + if (cg == NULL) return NG; + + (cg->refcnt)--; + // 他でまだ参照していれば開放しない + if (cg->refcnt > 0) { + return NG; + } + + // CG本体の開放 + if (cg->sf) { + sf_free(cg->sf); + } + + // 削除するオブジェクトを参照しているオブジェクトリストも削除 + if (cg == cgs[cg->no]) { + cgs[cg->no] = NULL; + } + + g_free(cg); + + return OK; +} + +// CGの種類を取得 +int scg_querytype(int wNumCG, int *ret) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (cgs[wNumCG] == NULL) goto errexit; + + *ret = cgs[wNumCG]->type; + + return OK; + + errexit: + *ret = CG_NOTUSED; + return NG; +} + +// CGの大きさを取得 +int scg_querysize(int wNumCG, int *w, int *h) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (cgs[wNumCG] == NULL) goto errexit; + if (cgs[wNumCG]->sf == NULL) goto errexit; + + *w = cgs[wNumCG]->sf->width; + *h = cgs[wNumCG]->sf->height; + + return OK; + + errexit: + *w = *h = 0; + return NG; +} + +// CGのBPPを取得 +int scg_querybpp(int wNumCG, int *ret) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (cgs[wNumCG] == NULL) goto errexit; + if (cgs[wNumCG]->sf == NULL) goto errexit; + + *ret = cgs[wNumCG]->sf->depth; + + return OK; + + errexit: + *ret = 0; + return NG; +} + +// CGの alphamap が存在するかを取得 +int scg_existalphamap(int wNumCG, int *ret) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (cgs[wNumCG] == NULL) goto errexit; + if (cgs[wNumCG]->sf == NULL) goto errexit; + + *ret = cgs[wNumCG]->sf->has_alpha ? 1 : 0; + + errexit: + *ret = 0; + return NG; +} diff --git a/modules/NIGHTDLL/sactcg.h b/modules/NIGHTDLL/sactcg.h new file mode 100644 index 0000000..4db8dc5 --- /dev/null +++ b/modules/NIGHTDLL/sactcg.h @@ -0,0 +1,49 @@ +/* + * sactcg.h: CG作成 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactcg.h,v 1.2 2003/11/16 15:29:52 chikama Exp $ */ + +#ifndef __SACTCG_H__ +#define __SACTCG_H__ + +#include "portab.h" +#include "night.h" + +extern cginfo_t *scg_loadcg_no(int no, boolean refinc); +extern int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate); +extern int scg_create_reverse(int NumCG, int wNumSrcCG, int wReverseX, int wReverseY); +extern int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG); +extern int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode); +extern int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cText); +extern int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue); +extern int scg_copy(int wNumDstCG, int wNumSrcCG); +extern int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight); +extern int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight); +extern int scg_freeall(); +extern int scg_free(int cg); +extern int scg_free_cgobj(cginfo_t *cg); +extern int scg_querytype(int wNumCG, int *ret); +extern int scg_querysize(int wNumCG, int *w, int *h); +extern int scg_querybpp(int wNumCG, int *ret); +extern int scg_existalphamap(int wNumCG, int *ret); +extern int scg_linkcgfree(int no); + +#endif diff --git a/modules/NIGHTDLL/sactcg_blend.c b/modules/NIGHTDLL/sactcg_blend.c new file mode 100644 index 0000000..0360404 --- /dev/null +++ b/modules/NIGHTDLL/sactcg_blend.c @@ -0,0 +1,31 @@ +// +static surface_t *blend(surface_t *base, int x, int y, surface_t *blend, int mode) { + surface_t *dst = sf_create_surface(base->width, base->height, base->depth); + + gr_copy(dst, 0, 0, base, 0, 0, base->width, base->height); + + if (base->has_alpha) { + // ベースに alpha map がある場合はそれをコピー + gr_copy_alpha_map(dst, 0, 0, base, 0, 0, base->width, base->height); + } else { + // 無い場合は全て 255 の map を作成 + gr_fill_alpha_map(dst, 0, 0, base->width, base->height, 255); + } + + if (blend->has_alpha) { + // 重ね合わせ先の alpha map があるときはそれを使う + gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, blend, 0, 0, 255); + } else { + // 無いときは dst の alpha map を使う + gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, dst, x, y, 255); + } + + // alpha 作成モードが dst + blend の時は飽和加算 + if (mode == 1) { + gr_saturadd_alpha_map(dst, x, y, blend, 0, 0, blend->width, blend->height); + } + + return dst; +} + + diff --git a/modules/NIGHTDLL/sactcg_stretch.c b/modules/NIGHTDLL/sactcg_stretch.c new file mode 100644 index 0000000..5b29489 --- /dev/null +++ b/modules/NIGHTDLL/sactcg_stretch.c @@ -0,0 +1,117 @@ +// 拡大縮小 +static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) { + surface_t *dst = g_new0(surface_t, 1); + float a1, a2, xd, yd; + int sw, sh; + int *row, *col; + int x, y; + BYTE *sdata, *ddata; + + dst->width = dw; + dst->height = dh; + dst->depth = src->depth; + dst->bytes_per_line = dw * src->bytes_per_pixel; + dst->bytes_per_pixel = src->bytes_per_pixel; + dst->has_pixel = src->has_pixel; + dst->has_alpha = src->has_alpha; + + if (src->has_pixel) { + dst->pixel = g_malloc(dh * dst->bytes_per_line); + } + if (src->has_alpha) { + dst->alpha = g_malloc(dw * dh); + } + + + sdata = GETOFFSET_PIXEL(src, 0, 0); + ddata = GETOFFSET_PIXEL(dst, 0, 0); + sw = src->width; + sh = src->height; + + a1 = (float)sw / (float)dw; + a2 = (float)sh / (float)dh; + row = g_new(int, dw); + // 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる + // 可能性がある。 + col = g_new0(int, dh +1); + + if (mirror & 1) { + /* 上下反転 added by tajiri@wizard */ + for (yd = sh - a2, y = 0; y < dh; y++) { + col[y] = yd; yd -= a2; + } + } else { + for (yd = 0.0, y = 0; y < dh; y++) { + col[y] = yd; yd += a2; + } + } + if (mirror & 2) { + /* 左右反転 added by tajiri@wizard */ + for (xd = sw - a1, x = 0; x < dw; x++) { + row[x] = xd; xd -= a1; + } + } else { + for (xd = 0.0, x = 0; x < dw; x++) { + row[x] = xd; xd += a1; + } + } + +#define SCALEDCOPYAREA(type) { \ + int x, y; \ + type *sl, *dl; \ + BYTE *_sl, *_dl; \ + for (y = 0; y < dh; y++) { \ + sl = (type *)(sdata + *(y + col) * src->bytes_per_line);\ + dl = (type *)(ddata + y * dst->bytes_per_line);\ + for (x = 0; x < dw; x++) { \ + *(dl + x) = *(sl + *(row + x)); \ + } \ + _dl = (BYTE *)dl; \ + while(*(col + y) == *(col + y + 1)) { \ + _sl = _dl; \ + _dl += dst->bytes_per_line; \ + memcpy(_dl, _sl, dw * sizeof(type)); \ + y++; \ + } \ + }} + + switch(dst->depth) { + case 8: + SCALEDCOPYAREA(BYTE); break; + case 15: + case 16: + SCALEDCOPYAREA(WORD); break; + case 24: + case 32: + SCALEDCOPYAREA(DWORD); break; + default: + break; + } + + if (src->has_alpha) { + int x, y; + BYTE *sl, *dl; + BYTE *_sl, *_dl; + sdata = GETOFFSET_ALPHA(src, 0, 0); + ddata = GETOFFSET_ALPHA(dst, 0, 0); + for (y = 0; y < dh; y++) { + sl = (BYTE *)(sdata + *(y + col) * src->width); + dl = (BYTE *)(ddata + y * dst->width); + for (x = 0; x < dw; x++) { + *(dl + x) = *(sl + *(row + x)); + } + _dl = (BYTE *)dl; + while(*(col + y) == *(col + y + 1)) { + _sl = _dl; + _dl += dst->width; + memcpy(_dl, _sl, dw); + y++; + } + } + } + + g_free(row); + g_free(col); + + return dst; +} diff --git a/modules/NIGHTDLL/sactstring.c b/modules/NIGHTDLL/sactstring.c new file mode 100644 index 0000000..cf10aea --- /dev/null +++ b/modules/NIGHTDLL/sactstring.c @@ -0,0 +1,161 @@ +/* + * sactstring.c: SACTの文字列操作関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactstring.c,v 1.1 2003/11/09 15:06:12 chikama Exp $ */ + +#include "config.h" +#include +#include +#include +#include "portab.h" +#include "system.h" +#include "variable.h" + +// 文字列置換用 +typedef struct { + char *src; // 置き換え元文字列 + char *dst; // 置き換え文字列 +} strexchange_t; + +#define DEFSTACKSIZE 100 +static char **stack; // stack本体 +static int idx; // stack pointer +static int idxmax; // stack pointerの最大 + +// 文字列置き換え用 (表示時にon-the-flyで変換して表示) +#define REPLACEBUFSIZE 3000 +static char repbuf[2][REPLACEBUFSIZE]; +static GSList *strreplace; +static char *replacesrc; +static char *replacedst; + +/** + * 文字列変数スタックの初期化 + */ +int sstr_init() { + stack = g_new(char *, DEFSTACKSIZE); + idx = 0; + idxmax = DEFSTACKSIZE; + return OK; +} + +/** + * 文字列変数スタックに文字列を積む + * @param strno: シナリオ上での文字列変数番号 + */ +int sstr_push(char *str) { + if (idx >= idxmax) { + stack = g_renew(char *, stack, idx*2); + idxmax = idx*2; + } + + stack[idx++] = g_strdup(str); + + return OK; +} + +/** + * 文字列変数スタックから文字列を取り出す + * @param strno: スタックから戻した文字列を格納する文字列変数番号 + */ +int sstr_pop(char *str, int maxlen) { + if (idx == 0) return NG; + + strncpy(str, stack[--idx], maxlen); + g_free(stack[idx]); + + return OK; +} + +/** + * 文字列の置き換え + * @param sstrno: 変換元文字列変数番号 + * @param dstrno: 変換先文字列変数番号 + */ +int sstr_regist_replace(char *sstr, char *dstr) { + strexchange_t *ex; + + if (sstr == dstr) return NG; + + ex = g_new(strexchange_t, 1); + ex->src = strdup(sstr); + ex->dst = strdup(dstr); + strreplace = g_slist_append(strreplace, ex); + return OK; +} + +/** + * 数値 -> 文字列化 + */ +int sstr_num2str(int strno, int fig, int nzeropad, int num) { + char s[256], ss[256]; + + if (nzeropad) { + char *sss = "%%0%dd"; + sprintf(ss, sss, fig); + } else { + char *sss = "%%%dd"; + sprintf(ss, sss, fig); + } + + sprintf(s, ss, num); + v_strcpy(strno -1, s); + + return OK; +} + +// 文字列の置き換え処理 +static void replacestr_cb(gpointer data, gpointer userdata) { + strexchange_t *ex = (strexchange_t *)data; + char *start, *next, *out; + + if (ex == NULL) return; + + start = replacesrc; + out = replacedst; + + while (TRUE) { + next = strstr(start, ex->src); + if (next == NULL) break; + strncat(out, start, (size_t)(next - start)); + strncat(out, ex->dst, max(0, (REPLACEBUFSIZE - (int)strlen(out)))); + start = next + strlen(ex->src); + } + strncat(out, start, max(0, REPLACEBUFSIZE - (int)strlen(out))); + + replacedst = replacesrc; + replacesrc = out; + replacedst[0] = '\0'; +} + +// 文字列の置き換え +char *sstr_replacestr(char *msg) { + if (strreplace == NULL) return msg; + + repbuf[0][0] = '\0'; + repbuf[1][0] = '\0'; + strncpy(repbuf[0], msg, REPLACEBUFSIZE); + replacesrc = repbuf[0]; + replacedst = repbuf[1]; + g_slist_foreach(strreplace, replacestr_cb, NULL); + + return (repbuf[0][0] == '\0') ? repbuf[1] : repbuf[0]; +} diff --git a/modules/NIGHTDLL/sactstring.h b/modules/NIGHTDLL/sactstring.h new file mode 100644 index 0000000..690effb --- /dev/null +++ b/modules/NIGHTDLL/sactstring.h @@ -0,0 +1,35 @@ +/* + * sactstring.h: SACTの文字列操作関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactstring.h,v 1.1 2003/11/09 15:06:12 chikama Exp $ */ + +#ifndef __SACTSTRING_H__ +#define __SACTSTRING_H__ + +extern int sstr_init(); +extern int sstr_push(char *str); +extern int sstr_pop(char *str, int maxlen); +extern int sstr_regist_replace(char *sstr, char *dstr); +extern int sstr_num2str(int strno, int fig, int nzeropad, int num); +extern char *sstr_replacestr(char *msg); + + +#endif /* __SACTSTRING_H__ */ diff --git a/modules/NIGHTDLL/sjisname.h b/modules/NIGHTDLL/sjisname.h new file mode 100644 index 0000000..771c589 --- /dev/null +++ b/modules/NIGHTDLL/sjisname.h @@ -0,0 +1,2 @@ +#define SNAME_RYO "���@�@�@�@" +#define SNAME_RYO_DEF "��" diff --git a/modules/NIGHTDLL/sprite.c b/modules/NIGHTDLL/sprite.c new file mode 100644 index 0000000..87c647d --- /dev/null +++ b/modules/NIGHTDLL/sprite.c @@ -0,0 +1,135 @@ +#include "config.h" +#include +#include + +#include "portab.h" +#include "sprite.h" +#include "sactcg.h" +#include "surface.h" +#include "ngraph.h" +#include "nt_msg.h" + +sprite_t *sp_new(int no, int cg1, int cg2, int cg3, int type) { + sprite_t *sp; + + sp = g_new0(sprite_t, 1); + + sp->no = no; + sp->type = type; + + if (cg1) sp->cg1 = scg_loadcg_no(cg1, TRUE); else sp->cg1 = NULL; + if (cg2) sp->cg2 = scg_loadcg_no(cg2, TRUE); else sp->cg2 = NULL; + if (cg3) sp->cg3 = scg_loadcg_no(cg3, TRUE); else sp->cg3 = NULL; + + sp->curcg = sp->cg1; + sp->show = TRUE; + sp->blendrate = 255; + sp->loc.x = 0; + sp->loc.y = 0; + sp->cur = sp->loc; + + if (sp->curcg == NULL) { + sp->cursize.width = 0; + sp->cursize.height = 0; + } else { + sp->cursize.width = sp->curcg->sf->width; + sp->cursize.height = sp->curcg->sf->height; + } + sp->update = DEFAULT_UPDATE; + + switch (type) { + case SPRITE_ANIME: + // sp_anime_setup(sp); + break; + } + + + return sp; +} + +sprite_t *sp_msg_new(int no, int x, int y, int width, int height) { + sprite_t *sp; + + sp = g_new0(sprite_t, 1); + + sp->no = no; + sp->type = SPRITE_MSG; + sp->show = TRUE; + sp->blendrate = 255; + sp->loc.x = x; + sp->loc.y = y; + sp->cur = sp->loc; + sp->cursize.width = width; + sp->cursize.height = height; + sp->u.msg.dspcur.x = 0; + sp->u.msg.dspcur.y = 0; + sp->u.msg.canvas = sf_create_surface(width, height, sf0->depth); + sp->update = ntmsg_update; + + return sp; +} + +void sp_free(sprite_t *sp) { + if (sp == NULL) return; + + if (sp->cg1) scg_free_cgobj(sp->cg1); + if (sp->cg2) scg_free_cgobj(sp->cg2); + if (sp->cg3) scg_free_cgobj(sp->cg3); + + if (sp->type == SPRITE_MSG) { + sf_free(sp->u.msg.canvas); + } + + g_free(sp); +} + +void sp_set_show(sprite_t *sp, boolean show) { + boolean oldshow; + + if (sp == NULL) return; + + oldshow = sp->show; + sp->show = show; + + if (oldshow != show) { + sp_updateme(sp); + } +} + +#if 0 +void sp_set_cg(sprite_t *sp, int no) { + cginfo_t *cg; + + if (sp == NULL) return; + + if (sp->curcg) { + scg_free_cgobj(sp->curcg); + } + + if (no) { + cg = scg_loadcg_no(no, TRUE); + } else { + cg = NULL; + } + + if (cg == NULL) { + sp->cursize.width = 0; + sp->cursize.height = 0; + } else { + sp->cursize.width = cg->sf->width; + sp->cursize.height = cg->sf->height; + } + + sp->curcg = cg; +} +#endif + +void sp_set_loc(sprite_t *sp, int x, int y) { + if (sp == NULL) return; + sp->cur.x = sp->loc.x = x; + sp->cur.y = sp->loc.y = y; +} + +// #include "nt_sprite_draw.c" +// #include "nt_sprite_update.c" +// #include "nt_sprite_eupdate.c" diff --git a/modules/NIGHTDLL/sprite.h b/modules/NIGHTDLL/sprite.h new file mode 100644 index 0000000..f90db38 --- /dev/null +++ b/modules/NIGHTDLL/sprite.h @@ -0,0 +1,138 @@ + +#ifndef __SPRITE_H__ +#define __SPRITE_H__ + +#include + +#include "portab.h" +#include "surface.h" +#include "graphics.h" + +#define DEFAULT_UPDATE sp_draw + + +#define SPRITEMAX 20 +#define SPNO_WALL 0 // 壁紙 +#define SPNO_SCENERY 1 // 背景 +#define SPNO_TACHI_L 2 // 立ち絵左 +#define SPNO_TACHI_M 3 // 立ち絵中央 +#define SPNO_TACHI_R 4 // 立ち絵右 +#define SPNO_MSGBG 5 // 文字下地 +#define SPNO_MSGFRAME_BG 6 // メッセージウィンド枠 +#define SPNO_MSGFRAME_FG 7 // メッセージ文字描画キャンバス +#define SPNO_FACE 11 // 人物顔CG +#define SPNO_MSG_KEYANIM 12 // メッセージキー入力アニメーション +#define SPNO_MSG_ICON_MUTE 13 // メッセージウィンドアイコン + +#define CGMAX 65536 +// 0-9999: reserve for Link CG +// 2051: メッセージウィンド枠CG +#define CGNO_MSGFRAME_LCG 2051 +// 4017: メッセージウィンドで声をmuteにするCG +#define CGNO_MSGFRAME_NOVICE_LCG 4017 +// 4018: メッセージウィンドのアイコンにマウスが重なったときのCG +#define CGNO_MSGFRAME_ICONREV_LCG 4018 +// 4034: キー入力を促すアニメーションCG +#define CGNO_MSGHAK_LCG 4034 + +// 10000: メッセージウィンドでのキー待ちアニメ その1 +#define CGNO_MSGHAK_1 10000 +// 10001: メッセージウィンドでのキー待ちアニメ その2 +#define CGNO_MSGHAK_2 10001 +// 10002: 文字下地CG +#define CGNO_MSGFR_BG 10002 + + +// CG_XX で作るCGの種類 +enum cgtype { + CG_NOTUSED = 0, + CG_LINKED = 1, + CG_SET = 2, + CG_REVERSE = 3, + CG_STRETCH = 4 +}; + +// cgに関する情報 +struct _cginfo { + enum cgtype type; // CGの種類, 0: 未使用, 1:リンクされている, ... + int no; // CGの番号 + surface_t *sf; // CG本体 + int refcnt; // 参照カウンタ。0になったら開放してもよい。 +}; +typedef struct _cginfo cginfo_t; + + +enum spritetype { + SPRITE_NORMAL = 0, + SPRITE_ANIME = 5, + SPRITE_MSG = 100, + SPRITE_WP, + SPRITE_NONE = -1 +}; + +struct _sprite { + enum spritetype type; + + int no; + + MyDimension cursize; + + cginfo_t *curcg; + cginfo_t *cg1, *cg2, *cg3; + + boolean show; + + int blendrate; + + MyPoint loc; + + MyPoint cur; + + int (* update)(struct _sprite *sp, MyRectangle *updatearea); + + union { + struct { + int interval; + int startttime; + int npat; + unsigned int tick; + } anime; + + struct { + surface_t *canvas; + MyPoint dspcur; + } msg; + } u; +}; + +typedef struct _sprite sprite_t; + + +/* in nt_sprite.c */ +extern sprite_t *sp_new(int no, int cg1, int cg2, int cg3, int type); +extern sprite_t *sp_msg_new(int no, int x, int y, int width, int height); +extern void sp_free(sprite_t *sp); +extern void sp_set_show(sprite_t *sp, boolean show); +// extern void sp_set_cg(sprite_t *sp, int no); +extern void sp_set_loc(sprite_t *sp, int x, int y); + +/* in nt_sprite_update.c */ +extern int sp_update_clipped(); +extern int sp_update_all(boolean syncscreen); +extern int sp_updateme(sprite_t *sp); +extern int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h); +extern void sp_add_updatelist(sprite_t *sp); +extern void sp_remove_updatelist(sprite_t *sp); +extern int sp_draw_wall(sprite_t *sp, MyRectangle *r); + +/* in nt_sprite_draw.c */ +extern int sp_draw(sprite_t *sp, MyRectangle *r); +extern int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r); +extern void sp_draw_dmap(gpointer data, gpointer userdata); +extern int sp_draw_scg(sprite_t *sp, MyRectangle *r); + +/* in nt_sprite_eupdate.c */ +extern int sp_eupdate(int type, int time, int cancel); + + +#endif /* __SPRITE_H__ */ diff --git a/modules/NIGHTDLL/sprite_draw.c b/modules/NIGHTDLL/sprite_draw.c new file mode 100644 index 0000000..c0c364a --- /dev/null +++ b/modules/NIGHTDLL/sprite_draw.c @@ -0,0 +1,143 @@ +/* + * sprite_draw.c: スプライト再描画各種 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_draw.c,v 1.1 2003/11/09 15:06:12 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "ags.h" +#include "graphics.h" +#include "surface.h" +#include "ngraph.h" +#include "sprite.h" + +/* + 指定の sprite (の現在のCG)を surface0 に書く + @param sp: 描画するスプライト + @param r : 再描画する領域 +*/ +int sp_draw(sprite_t *sp, MyRectangle *r) { + if (sp == NULL) return NG; + + return sp_draw2(sp, sp->curcg, r); +} + +/* + 指定の spriteの指定のCGを surface0 に書く + (このインターフェイスはもう不要?) + + @param sp: 描画するスプライト + @param cg: 描画するCG + @param r : 再描画する領域 +*/ +int sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) { + surface_t update; + int sx, sy, w, h, dx, dy; + + if (cg == NULL) return NG; + if (cg->sf == NULL) return NG; + + // 更新領域の確定 + update.width = r->width; + update.height = r->height; + sx = 0; + sy = 0; + dx = sp->cur.x - r->x; + dy = sp->cur.y - r->y; + w = cg->sf->width; + h = cg->sf->height; + + if (!gr_clip(cg->sf, &sx, &sy, &w, &h, &update, &dx, &dy)) { + return NG; + } + + dx += r->x; + dy += r->y; + + if (cg->sf->has_alpha) { + // alpha map がある場合 + gre_BlendUseAMap(sf0, dx, dy, + sf0, dx, dy, + cg->sf, sx, sy, w, h, + cg->sf, sx, sy, + sp->blendrate); + } else { + if (sp->blendrate == 255) { + // alpha値指定が無い場合 + gr_copy(sf0, dx, dy, cg->sf, sx, sy, w, h); + } else if (sp->blendrate > 0) { + // alpha値指定がある場合 + gre_Blend(sf0, dx, dy, + sf0, dx, dy, + cg->sf, sx, sy, w, h, + sp->blendrate); + } + } + + WARNING("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n", + sp->no, sx, sy, w, h, dx, dy); + + return OK; +} + +// BlendScreenによる描画 +int sp_draw_scg(sprite_t *sp, MyRectangle *r) { + surface_t update; + cginfo_t *cg; + int sx, sy, w, h, dx, dy; + + if (sp == NULL) return NG; + + cg = sp->curcg; + + if (cg == NULL) return NG; + if (cg->sf == NULL) return NG; + + // 更新領域の確定 + update.width = r->width; + update.height = r->height; + sx = 0; + sy = 0; + dx = sp->cur.x - r->x; + dy = sp->cur.y - r->y; + w = cg->sf->width; + h = cg->sf->height; + + if (!gr_clip(cg->sf, &sx, &sy, &w, &h, &update, &dx, &dy)) { + return NG; + } + + dx += r->x; + dy += r->y; + + gre_BlendScreen(sf0, dx, dy, + sf0, dx, dy, + cg->sf, sx, sy, w, h); + + WARNING("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n", + sp->no, sx, sy, w, h, dx, dy); + +} diff --git a/modules/NIGHTDLL/sprite_eupdate.c b/modules/NIGHTDLL/sprite_eupdate.c new file mode 100644 index 0000000..114c47b --- /dev/null +++ b/modules/NIGHTDLL/sprite_eupdate.c @@ -0,0 +1,447 @@ +/* + * sprite_eupdate.c: 効果つき更新 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_eupdate.c,v 1.1 2003/11/09 15:06:12 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "ngraph.h" +#include "ags.h" +#include "nact.h" +#include "imput.h" +#include "sprite.h" +#include "surface.h" +#include "sactcg.h" +#include "counter.h" + + + +static void ec1_cb(surface_t *, surface_t *); +static void ec6_cb(surface_t *, surface_t *); +static void ec7_cb(surface_t *, surface_t *); +static void ec8_cb(surface_t *, surface_t *); +static void ec9_cb(surface_t *, surface_t *); +static void ec11_cb(surface_t *, surface_t *); +static void ec12_cb(surface_t *, surface_t *); +static void ec13_cb(surface_t *, surface_t *); +static void ec14_cb(surface_t *, surface_t *); +static void ec15_cb(surface_t *, surface_t *); +static void ec16_cb(surface_t *, surface_t *); +static void ec17_cb(surface_t *, surface_t *); +static void ec_dummy_cb(surface_t *, surface_t *); + +struct ecopyparam { + int sttime; + int curtime; + int edtime; + int curstep; + int oldstep; +}; +typedef struct ecopyparam ecopyparam_t; +static ecopyparam_t ecp; + +// #include "sprite_eupdate_perspect.c" +// #include "sprite_eupdate_mosaic.c" +// #include "sprite_eupdate_aff.c" +// #include "sprite_eupdate_uneune.c" +#include "sprite_eupdate_buller.c" +// #include "sprite_eupdate_zmbbul.c" + +typedef void entrypoint (surface_t *, surface_t *); + +static void ec_dummy_cb(surface_t *sfsrc, surface_t *sfdst) { + WARNING("NOT IMPLEMENTED\n"); +} + +// クロスフェード +static void ec1_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep; + + curstep = 255 * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + gre_Blend(sf0, 0, 0, sfsrc, 0, 0, sfdst, 0, 0, sfsrc->width, sfsrc->height, curstep); + + // WARNING("step = %d\n", curstep); + ags_updateFull(); + + ecp.oldstep = curstep; +} + +// すだれ落ち +static void ec7_cb(surface_t *sfsrc, surface_t *sfdst) { +#define EC7DELTA 16 + int curstep, maxstep = sfsrc->height / EC7DELTA + EC7DELTA; + int i, t, y; + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + //WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + t = ecp.oldstep; + while(t < curstep) { + for (i = 0; i < MIN(t + 1, EC7DELTA); i++) { + y = i + EC7DELTA * (t - i); + if (y < 0 || y >= sfsrc->height) continue; + gr_copy(sf0, 0, y, + sfdst, 0, y, sfsrc->width, 1); + } + t++; + } + + ecp.oldstep = curstep; + ags_updateFull(); +} + +// すだれ左->右 +static void ec8_cb(surface_t *sfsrc, surface_t *sfdst) { +#define EC8DELTA 16 + int curstep, maxstep = sfsrc->width / EC8DELTA + EC8DELTA; + int i, t, x; + + curstep = maxstep * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + //WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + t = ecp.oldstep; + while(t < curstep) { + for (i = 0; i < MIN(t + 1, EC8DELTA); i++) { + x = i + EC8DELTA * (t - i); + if (x < 0 || x >= sfsrc->width) continue; + gr_copy(sf0, x, 0, + sfdst, x, 0, 1, sfsrc->height); + } + t++; + } + + ecp.oldstep = curstep; + ags_updateFull(); +} + +// すだれ落ち&左->右 +static void ec9_cb(surface_t *sfsrc, surface_t *sfdst) { +#define EC9DELTA 16 + int curstep, maxstep; + int i, t, x, y; + + maxstep = MAX(sfsrc->height / EC9DELTA + EC9DELTA, + sfsrc->width / EC9DELTA + EC9DELTA); + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + //WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + t = ecp.oldstep; + while(t < curstep) { + for (i = 0; i < MIN(t + 1, EC9DELTA); i++) { + y = i + EC9DELTA * (t - i); + if (y < 0 || y >= sfsrc->height) continue; + gr_copy(sf0, 0, y, + sfdst, 0, y, sfsrc->width, 1); + } + for (i = 0; i < MIN(t + 1, EC9DELTA); i++) { + x = i + EC9DELTA * (t - i); + if (x < 0 || x >= sfsrc->width) continue; + gr_copy(sf0, x, 0, + sfdst, x, 0, 1, sfsrc->height); + } + t++; + } + + ecp.oldstep = curstep; + ags_updateFull(); +} + +// 上->下クロスフェード +static void ec12_cb(surface_t *src, surface_t *dst) { +#define EC12DELTA 256 + int curstep, maxstep = src->height + EC12DELTA; + int j, st_i, ed_i, l; + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); return; + } + + st_i = MAX(0, curstep - EC12DELTA + 1); + ed_i = MIN(src->height -1, curstep); + l = ed_i - st_i + 1; + for (j = st_i; j < ed_i; j++) { + gre_Blend(sf0, 0, j, src, 0, j, dst, 0, j, src->width, 1, curstep - j); + } + if ((st_i - ecp.oldstep) > 1) { + gr_copy(sf0, 0, ecp.oldstep, dst, 0, ecp.oldstep, src->width, st_i - ecp.oldstep); + ags_updateArea(0, ecp.oldstep, src->width, st_i - ecp.oldstep); + } + + ags_updateArea(0, st_i, src->width, l); + ecp.oldstep = st_i; +} + +// 下->上クロスフェード +static void ec13_cb(surface_t *src, surface_t *dst) { +#define EC13DELTA 256 + int curstep, maxstep = src->height + EC12DELTA; + int j, st_i, ed_i, l; + int syy1 = 0 + dst->height -1; + int syy2 = 0 + src->height -1; + int dyy = 0 + sf0->height -1; + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); return; + } + + st_i = MAX(0, curstep - EC13DELTA + 1); + ed_i = MIN(src->height -1, curstep); + l = ed_i - st_i + 1; + for (j = st_i; j < ed_i; j++) { + gre_Blend(sf0, 0, dyy - j, src, 0, syy1-j, dst, 0, syy2-j, src->width, 1, curstep - j); + } + if ((st_i - ecp.oldstep) > 1) { + gr_copy(sf0, 0, dyy-ecp.oldstep, dst, 0, syy2-ecp.oldstep, src->width, st_i - ecp.oldstep); + ags_updateArea(0, dyy-ecp.oldstep, src->width, st_i - ecp.oldstep); + } + + ags_updateArea(0, dyy-ed_i, src->width, l); + ecp.oldstep = st_i; +} + +// 五芒星 (内->外) +static void ec14_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 44, curstep); + ecp.oldstep = curstep; +} + +// 五芒星 (外->内) +static void ec15_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 45, curstep); + ecp.oldstep = curstep; +} + +// 六芒星 (内->外) +static void ec16_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 46, curstep); + ecp.oldstep = curstep; +} + +// 六芒星 (外->内) +static void ec17_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 47, curstep); + ecp.oldstep = curstep; +} + +// フェードイン +static void ec_fadein_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep; + + curstep = 255 * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + + gr_copy_bright(sf0, 0, 0, sfsrc, 0, 0, sfsrc->width, sfsrc->height, curstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + +static void ec_fadeout_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep; + + curstep = 255 * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + + gr_copy_bright(sf0, 0, 0, sfsrc, 0, 0, sfsrc->width, sfsrc->height, 255-curstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + +// ホワイトイン +static void ec_whitein_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep; + + curstep = 255 * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + + gr_copy_whiteout(sf0, 0, 0, sfsrc, 0, 0, sfsrc->width, sfsrc->height, 255 - curstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + +static void ec_whiteout_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep; + + curstep = 255 * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + + gr_copy_whiteout(sf0, 0, 0, sfsrc, 0, 0, sfsrc->width, sfsrc->height, curstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + + + +/* + 効果つき画面更新 + @param type: 効果の種類 + @param time: 実行時間(msec) + @param cancel: キー抜け(0:なし, 1:あり) +*/ +int sp_eupdate(int type, int time, int cancel) { + surface_t *sfsrc, *sfdst; + int key; + entrypoint *cb; + + // 現在の sf0 をセーブ + sfsrc = sf_dup(sf0); + + sp_update_all(FALSE); + + sfdst = sf_dup(sf0); + + sf_copyall(sf0, sfsrc); // 全部の効果タイプにこの処理は要らないんだけど + + ecp.sttime = ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC); + ecp.edtime = ecp.curtime + time; + ecp.oldstep = 0; + + switch(type) { + case 10: + cb = ec_dummy_cb; + break; + case 101: // クロスフェード + cb = ec1_cb; + break; + case 102: // フェードアウト + cb = ec_fadeout_cb; + break; + case 103: // フェードイン + cb = ec_fadein_cb; + break; + case 104: // ホワイトアウト + cb = ec_whiteout_cb; + break; + case 105: // ホワイトイン + cb = ec_whitein_cb; + break; + case 107: // 簾落ち + cb = ec7_cb; + break; + case 108: // 左->右すだれ + cb = ec8_cb; + break; + case 111: // 線形ぼかし + ec11_prepare(sfsrc, sfdst); + cb = ec11_cb; + break; + case 1011: + cb = ec_dummy_cb; + break; + case 1013: + sp_update_all(TRUE); return OK; + // cb = ec_dummy_cb; + break; + default: + cb = ec_dummy_cb; + break; + } + + while ((ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < ecp.edtime) { + int rest; + + cb(sfsrc, sfdst); + rest = 15 - (get_high_counter(SYSTEMCOUNTER_MSEC) - ecp.curtime); + key = sys_keywait(rest, cancel); + + if (cancel && key) break; + } + + sf_copyall(sf0, sfdst); + ags_updateFull(); + sf_free(sfsrc); + sf_free(sfdst); + + if (type == 111) { + ec11_drain(sfsrc, sfdst); + } + + return OK; +} diff --git a/modules/NIGHTDLL/sprite_eupdate_buller.c b/modules/NIGHTDLL/sprite_eupdate_buller.c new file mode 100644 index 0000000..1643b0a --- /dev/null +++ b/modules/NIGHTDLL/sprite_eupdate_buller.c @@ -0,0 +1,66 @@ +// 11 と 19 で共有 +static surface_t *ec11_ss[6]; +static surface_t *ec11_sd[6]; + +// 線形ブラー +static void ec11_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep = 6; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + if (curstep < 6) { + gre_Blend(sf0, 0, 0, ec11_ss[curstep], 0, 0, ec11_sd[5-curstep], 0, 0, sfsrc->width, sfsrc->height, (curstep+1)*256/7); + ags_updateFull(); + } +} + +static void ec11_prepare(surface_t *src, surface_t *dst) { + int i; + + ec11_ss[0] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[0] = sf_create_surface(src->width, src->height, src->depth); + gr_buller(ec11_ss[0], 0, 0, src, 0, 0, src->width, src->height, 1 << 2); + gr_buller(ec11_sd[0], 0, 0, dst, 0, 0, dst->width, dst->height, 1 << 2); + for (i = 1; i < 6; i++) { + ec11_ss[i] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[i] = sf_create_surface(dst->width, dst->height, dst->depth); + gr_buller(ec11_ss[i], 0, 0, ec11_ss[i-1], 0, 0, src->width, src->height, 1 << (i+2)); + gr_buller(ec11_sd[i], 0, 0, ec11_sd[i-1], 0, 0, dst->width, dst->height, 1 << (i+2)); + } +} + +static void ec11_drain(surface_t *src, surface_t *dst) { + int i; + + for (i = 0; i < 6; i++) { + sf_free(ec11_ss[i]); + sf_free(ec11_sd[i]); + } +} + +// 縦線形ブラー +static void ec19_cb(surface_t *sfsrc, surface_t *sfdst) { + ec11_cb(sfsrc, sfdst); +} + +static void ec19_prepare(surface_t *src, surface_t *dst) { + int i; + + ec11_ss[0] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[0] = sf_create_surface(src->width, src->height, src->depth); + gr_buller_v(ec11_ss[0], 0, 0, src, 0, 0, src->width, src->height, 1 << 2); + gr_buller_v(ec11_sd[0], 0, 0, dst, 0, 0, dst->width, dst->height, 1 << 2); + for (i = 1; i < 6; i++) { + ec11_ss[i] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[i] = sf_create_surface(dst->width, dst->height, dst->depth); + gr_buller_v(ec11_ss[i], 0, 0, ec11_ss[i-1], 0, 0, src->width, src->height, 1 << (i+2)); + gr_buller_v(ec11_sd[i], 0, 0, ec11_sd[i-1], 0, 0, dst->width, dst->height, 1 << (i+2)); + } +} + +static void ec19_drain(surface_t *src, surface_t *dst) { + int i; + + for (i = 0; i < 6; i++) { + sf_free(ec11_ss[i]); + sf_free(ec11_sd[i]); + } +} diff --git a/modules/NIGHTDLL/sprite_update.c b/modules/NIGHTDLL/sprite_update.c new file mode 100644 index 0000000..07a08cc --- /dev/null +++ b/modules/NIGHTDLL/sprite_update.c @@ -0,0 +1,263 @@ +/* + * sprite_update.c: spriteの通常更新いろいろ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_update.c,v 1.1 2003/11/09 15:06:12 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "ags.h" +#include "graphics.h" +// #include "sact.h" +#include "surface.h" +#include "ngraph.h" +#include "sprite.h" + +// スプライト再描画間の間に変更のあったスプライトの領域の和 +static GSList *updatearea; + +// 再描画するスプライトのリスト +static GSList *updatelist; + +static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst); +static void disjunction(gpointer region, gpointer data); +static MyRectangle get_updatearea(); +static void do_update_each(gpointer data, gpointer userdata); + +// 領域1と領域2の積を計算 +static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst) { + int x1 = max(r1->x, r2->x); + int x2 = min(r1->x + r1->width, r2->x + r2->width); + int y1 = max(r1->y, r2->y); + int y2 = min(r1->y + r1->height, r2->y + r2->height); + + rst->x = x1; + rst->y = y1; + rst->width = x2 - x1; + rst->height = y2 - y1; +} + +// 領域1と領域2をすべて含む矩形領域を計算 +static void disjunction(gpointer region, gpointer data) { + MyRectangle *r1 = (MyRectangle *)region; + MyRectangle *r2 = (MyRectangle *)data; + int x1, x2, y1, y2; + + //WARNING("r1x=%d,r1y=%d,r1w=%d,r1h=%d\n", r1->x, r1->y, r1->width, r1->height); + //WARNING("r2x=%d,r2y=%d,r2w=%d,r2h=%d\n", r2->x, r2->y, r2->width, r2->height); + + if (r2->width == 0) { + r2->x = r1->x; + r2->y = r1->y; + r2->width = r1->width; + r2->height = r1->height; + return; + } + + x1 = min(r1->x, r2->x); + x2 = max(r1->x + r1->width, r2->x + r2->width); + y1 = min(r1->y, r2->y); + y2 = max(r1->y + r1->height, r2->y + r2->height); + + r2->x = x1; + r2->y = y1; + r2->width = x2 - x1; + r2->height = y2 - y1; + + //WARNING("res:r2x=%d,r2y=%d,r2w=%d,r2h=%d\n", r2->x, r2->y, r2->width, r2->height); +} + +// 更新の必要なスプライトの領域の和をとってクリッピングする +static MyRectangle get_updatearea() { + MyRectangle clip = {0, 0, 0, 0}; + MyRectangle rsf0 = {0, 0, sf0->width, sf0->height}; + MyRectangle result; + + g_slist_foreach(updatearea, disjunction, &clip); + + g_slist_free(updatearea); + updatearea = NULL; + + // surface0との領域の積をとる + intersection(&rsf0, &clip, &result); + + WARNING("clipped area x=%d y=%d w=%d h=%d\n", + result.x, result.y, + result.width, result.height); + + return result; +} + +// updatelist に登録してあるすべてのスプライトを更新 +static void do_update_each(gpointer data, gpointer userdata) { + sprite_t *sp = (sprite_t *)data; + MyRectangle *r = (MyRectangle *)userdata; + + // 非表示の場合はなにもしない + if (!sp->show) return; + + // スプライト毎のupdateルーチンの呼び出し + if (sp->update) { + sp->update(sp, r); + } +} + +/* + 画面全体の更新 + @param syncscreen: surface0 に描画したものを Screen に反映させるかどうか + */ +int sp_update_all(boolean syncscreen) { + // 画面全体を更新領域に + MyRectangle r = {0, 0, sf0->width, sf0->height }; + + // updatelistに登録してあるスプライトを再描画 + // updatelistはスプライトの番号順に並んでいる + g_slist_foreach(updatelist, do_update_each, &r); + + // このルーチンが呼ばれるときはスプライトはドラッグ中ではない + + // screenと同期は必要なときは画面全体をWindowへ転送 + if (syncscreen) { + ags_updateFull(); + } + + return OK; +} + +/* + 画面の一部を更新 + updateme(_part)で登録した更新が必要なspriteの和の領域をupdate +*/ +int sp_update_clipped() { + MyRectangle r; + + // 更新領域の確定 + r = get_updatearea(); + + // 幅または高さが 0 の時はなにもしない + if (r.width == 0 || r.height == 0) { + return OK; + } + + // 更新領域に入っているスプライトの再描画 + g_slist_foreach(updatelist, do_update_each, &r); + + // 更新領域を Window に転送 + ags_updateArea(r.x, r.y, r.width, r.height); + + return OK; +} + +/* + sprite全体の更新を登録 + @param sp: 更新するスプライト +*/ +int sp_updateme(sprite_t *sp) { + MyRectangle *r; + + if (sp == NULL) return NG; + if (sp->cursize.width == 0 || sp->cursize.height == 0) return NG; + + r = g_new(MyRectangle, 1); + r->x = sp->cur.x; + r->y = sp->cur.y; + r->width = sp->cursize.width; + r->height = sp->cursize.height; + + updatearea = g_slist_append(updatearea, r); + + WARNING("x = %d, y = %d, spno = %d w=%d,h=%d\n", + r->x, r->y, sp->no, r->width, r->height); + + return OK; +} + +/* + spriteの一部更新を登録 + @param sp: 更新するスプライト + @param x: 更新領域X座標 + @param y: 更新領域Y座標 + @param w: 更新領域幅 + @param h: 更新領域高さ +*/ +int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) { + MyRectangle *r; + + if (sp == NULL) return NG; + if (w == 0 || h == 0) return NG; + + r = g_new(MyRectangle, 1); + r->x = sp->cur.x + x; + r->y = sp->cur.y + y; + r->width = w; + r->height = h; + + updatearea = g_slist_append(updatearea, r); + + WARNING("x = %d, y = %d, spno = %d w=%d,h=%d\n", + r->x, r->y, sp->no, r->width, r->height); + + return OK; +} + +// スプライトの番号順に更新するためにリストに順番に要れるためのcallbck +static gint compare_spriteno_smallfirst(gconstpointer a, gconstpointer b) { + sprite_t *sp1 = (sprite_t *)a; + sprite_t *sp2 = (sprite_t *)b; + + if (sp1->no < sp2->no) { + return -1; + } + if (sp1->no > sp2->no) { + return 1; + } + return 0; +} + +void sp_add_updatelist(sprite_t *sp) { + updatelist = g_slist_insert_sorted(updatelist, sp, compare_spriteno_smallfirst); +} + +void sp_remove_updatelist(sprite_t *sp) { + updatelist = g_slist_remove(updatelist, sp); +} + +// デフォルトの壁紙update +int sp_draw_wall(sprite_t *sp, MyRectangle *area) { + int sx, sy, w, h; + + sx = area->x; + sy = area->y; + w = area->width; + h = area->height; + gr_fill(sf0, sx, sy, w, h, 0, 0, 0); + + WARNING("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, \n", + sp->no, sx, sy, w, h); + + return OK; +} + diff --git a/modules/NightDemonDemo/Makefile.am b/modules/NightDemonDemo/Makefile.am new file mode 100644 index 0000000..b9dfcdb --- /dev/null +++ b/modules/NightDemonDemo/Makefile.am @@ -0,0 +1,13 @@ +pkglib_LTLIBRARIES = NightDemonDemo.la + +NightDemonDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +NightDemonDemo_la_SOURCES = NightDemonDemo.c ndd.c jpeg2surface.c +NightDemonDemo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la @GLIB_LIBS@ @JPEG_LIBS@ + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ @JPEG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/NightDemonDemo -I$(top_srcdir)/modules/NightDemonDemo diff --git a/modules/NightDemonDemo/Makefile.in b/modules/NightDemonDemo/Makefile.in new file mode 100644 index 0000000..69e12fd --- /dev/null +++ b/modules/NightDemonDemo/Makefile.in @@ -0,0 +1,562 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/NightDemonDemo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +NightDemonDemo_la_DEPENDENCIES = ../lib/libgraph.la ../lib/libalk.la +am_NightDemonDemo_la_OBJECTS = NightDemonDemo.lo ndd.lo \ + jpeg2surface.lo +NightDemonDemo_la_OBJECTS = $(am_NightDemonDemo_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(NightDemonDemo_la_SOURCES) +DIST_SOURCES = $(NightDemonDemo_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = NightDemonDemo.la +NightDemonDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +NightDemonDemo_la_SOURCES = NightDemonDemo.c ndd.c jpeg2surface.c +NightDemonDemo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la @GLIB_LIBS@ @JPEG_LIBS@ +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ @JPEG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/NightDemonDemo -I$(top_srcdir)/modules/NightDemonDemo + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/NightDemonDemo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/NightDemonDemo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +NightDemonDemo.la: $(NightDemonDemo_la_OBJECTS) $(NightDemonDemo_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(NightDemonDemo_la_LDFLAGS) $(NightDemonDemo_la_OBJECTS) $(NightDemonDemo_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NightDemonDemo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpeg2surface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ndd.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/NightDemonDemo/NightDemonDemo.c b/modules/NightDemonDemo/NightDemonDemo.c new file mode 100644 index 0000000..f587ffa --- /dev/null +++ b/modules/NightDemonDemo/NightDemonDemo.c @@ -0,0 +1,55 @@ +/* + * NightDemonDemo.c: + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: NightDemonDemo.c,v 1.2 2003/09/05 14:15:49 chikama Exp $ */ + +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + +extern void ndd_init(char *files[], int n); +extern void ndd_run(int demonum); + +void Init() { + int p1 = getCaliValue(); /* ISys3x */ + int p2 = getCaliValue(); /* IWinMsg */ + int p3 = getCaliValue(); /* ITimer */ + int *var = getCaliVariable(); + + ndd_init(nact->files.alk, 4); + *var = 1; + + DEBUG_COMMAND("NightDemonDemo.Init %d,%d,%d,%p:\n", p1, p2, p3, var); +} + +void Run() { + int p1 = getCaliValue(); // デモ番号 0,1,2 + int p2 = getCaliValue(); + + ndd_run(p1); + + DEBUG_COMMAND("NightDemonDemo.Run %d,%d:\n", p1, p2); +} diff --git a/modules/NightDemonDemo/jpeg2surface.c b/modules/NightDemonDemo/jpeg2surface.c new file mode 100644 index 0000000..ea6b500 --- /dev/null +++ b/modules/NightDemonDemo/jpeg2surface.c @@ -0,0 +1,106 @@ +/* + * jpeg2surface.c: + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: jpeg2surface.c,v 1.2 2003/11/09 15:06:12 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "ags.h" +#include "surface.h" +#include "ngraph.h" + +static void ppm2surface(surface_t *sf, int curscanline, unsigned char *src, int width) { + BYTE *dp = GETOFFSET_PIXEL(sf, 0, curscanline); + + switch (sf->depth) { + case 15: + { + WORD *dst = (WORD *)dp; + while (width--) { + *dst = PIX15(*src, *(src +1), *(src +2)); + dst++; src+= 3; + } + break; + + } + case 16: + { + WORD *dst = (WORD *)dp; + while (width--) { + *dst = PIX16(*src, *(src +1), *(src +2)); + dst++; src+= 3; + } + break; + } + case 24: + case 32: + { + DWORD *dst = (DWORD *)dp; + while (width--) { + *dst = PIX24(*src, *(src +1), *(src +2)); + dst++; src+= 3; + } + break; + }} +} + +// sf0 に直接描く(それでも遅いけど) +surface_t *jpeg2surface(FILE *fp, int offset) { + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + int row_stride; + surface_t *sf; + JSAMPARRAY buffer; + + fseek(fp, offset, SEEK_SET); + + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_decompress(&cinfo); + + jpeg_stdio_src(&cinfo, fp); + jpeg_read_header(&cinfo, TRUE); + + cinfo.do_fancy_upsampling = FALSE; + cinfo.do_block_smoothing = FALSE; + + jpeg_start_decompress(&cinfo); + //fprintf(stderr, "width = %d, height = %d\n", cinfo.output_width, cinfo.output_height); + + //sf = sf_create_pixel(cinfo.output_width, cinfo.output_height, sf0->depth); + sf = sf0; + + row_stride = cinfo.output_width * cinfo.output_components; + buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); + + while (cinfo.output_scanline < cinfo.output_height) { + jpeg_read_scanlines(&cinfo, buffer, 1); + ppm2surface(sf, cinfo.output_scanline -1, buffer[0], cinfo.output_width); + } + jpeg_finish_decompress(&cinfo); + jpeg_destroy_decompress(&cinfo); + + return sf; +} diff --git a/modules/NightDemonDemo/ndd.c b/modules/NightDemonDemo/ndd.c new file mode 100644 index 0000000..c230ba0 --- /dev/null +++ b/modules/NightDemonDemo/ndd.c @@ -0,0 +1,110 @@ +/* + * ndd.c: + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ndd.c,v 1.2 2003/11/09 15:06:12 chikama Exp $ */ + +#include +#include + +#include "portab.h" +#include "ags.h" +#include "alk.h" +#include "system.h" +#include "surface.h" +#include "music_client.h" +#include "counter.h" +#include "ngraph.h" +#include "imput.h" + +// 0: AliceSoft +// 1: Opening +// 2: Meteo + +struct nddemo { + char **fn; + alk_t *alk; + surface_t *sf[10]; +}; + +static struct nddemo ndd; +static int ndemo_alk[3] = {2, 3, 4}; +static int ndemo_mus[3] = {0, 1, 85}; +static int ndemo_nums[3] = {150, 603, 467}; + +extern surface_t *jpeg2surface(FILE *fp, int offset); + +// ALKファイルの登録 +void ndd_init(char *files[], int n) { + int i; + ndd.fn = g_new(char *, n); + + for (i = 1; i <= n; i++) { + ndd.fn[i] = files[i]; + } +} + +// デモ本体 +void ndd_run(int demonum) { + FILE *fp; + alk_t *alk; + int i, start, ct; + + // ファイルオフセットだけ alk からもらう + alk = alk_new(ndd.fn[ndemo_alk[demonum]]); + if (alk == NULL) return; + + // libjpeg には FILE* を渡す + if (NULL == (fp = fopen(ndd.fn[ndemo_alk[demonum]], "rb"))) { + WARNING("%s not found\n", ndd.fn[ndemo_alk[demonum]]); + return; + } + + // wait keyup + while (sys_getInputInfo()); + + mus_bgm_play(ndemo_mus[demonum], 0, 100); + start = get_high_counter(SYSTEMCOUNTER_MSEC); + ct = 0; + for (i = 0; i <= ndemo_nums[demonum];) { + int offset; + int cur1, cur = get_high_counter(SYSTEMCOUNTER_MSEC); + + offset = alk->offset[i]; + + jpeg2surface(fp, offset); ct++; + ags_updateFull(); + + cur1 = get_high_counter(SYSTEMCOUNTER_MSEC); + if (cur1 - cur < 33) { + if (sys_keywait(33 - (cur1 - cur), TRUE)) break; + } else { + if (sys_getInputInfo()) break; + } + + i = (cur - start) / 33; + } + + NOTICE("%d/%d processed\n", ct, ndemo_nums[demonum]); + mus_bgm_stop(ndemo_mus[demonum], 0); + + fclose(fp); + alk_free(alk); +} diff --git a/modules/RandMT/Makefile.am b/modules/RandMT/Makefile.am new file mode 100644 index 0000000..c6d4020 --- /dev/null +++ b/modules/RandMT/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = RandMT.la + +RandMT_la_LDFLAGS = -module -export-dynamic -avoid-version +RandMT_la_SOURCES = RandMT.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/RandMT -I$(top_srcdir)/modules/RandMT diff --git a/modules/RandMT/Makefile.in b/modules/RandMT/Makefile.in new file mode 100644 index 0000000..34a9dc1 --- /dev/null +++ b/modules/RandMT/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/RandMT +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +RandMT_la_LIBADD = +am_RandMT_la_OBJECTS = RandMT.lo +RandMT_la_OBJECTS = $(am_RandMT_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(RandMT_la_SOURCES) +DIST_SOURCES = $(RandMT_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = RandMT.la +RandMT_la_LDFLAGS = -module -export-dynamic -avoid-version +RandMT_la_SOURCES = RandMT.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/RandMT -I$(top_srcdir)/modules/RandMT + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/RandMT/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/RandMT/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +RandMT.la: $(RandMT_la_OBJECTS) $(RandMT_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(RandMT_la_LDFLAGS) $(RandMT_la_OBJECTS) $(RandMT_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RandMT.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/RandMT/RandMT.c b/modules/RandMT/RandMT.c new file mode 100644 index 0000000..da03d7d --- /dev/null +++ b/modules/RandMT/RandMT.c @@ -0,0 +1,70 @@ +/* + * RandMT.c 王子さま Lv1: (おそらく Mersenne Twister使用の)乱数生成 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: RandMT.c,v 1.3 2002/09/01 11:54:51 chikama Exp $ */ + +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +#include "randMT.h" + +void Init() { + /* + 乱数初期化 + + p1: 初期化用 seed + */ + int p1 = getCaliValue(); /* ITimer */ + + DEBUG_COMMAND_YET("RandMT.Init %p:\n", p1); +} + +void Get() { + /* + 1 から num までの乱数を生成 + + num: 最大値 + var: 結果を返す変数 + */ + int num = getCaliValue(); + int *var = getCaliVariable(); + + if (num == 0 || num == 1) { + *var = num; + } else { + *var = (int)(genrand() * num) + 1; + } + + DEBUG_COMMAND_YET("RandMT.Get %d,%p:\n", num, var); +} + +void GetNoOverlap() { /* not used ? */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int *var1 = getCaliVariable(); + + DEBUG_COMMAND_YET("RandMT.GetNoOverlap %p:\n", p1); +} diff --git a/modules/SACT/Makefile.am b/modules/SACT/Makefile.am new file mode 100644 index 0000000..be6a791 --- /dev/null +++ b/modules/SACT/Makefile.am @@ -0,0 +1,41 @@ +pkglib_LTLIBRARIES = SACT.la + +SACT_la_LDFLAGS = -module -export-dynamic -avoid-version +SACT_la_LIBADD = ../lib/libgraph.la ../lib/libdrawtext.la @GLIB_LIBS@ +SACT_la_SOURCES = \ + SACT.c \ + sactcg.c \ + sactsound.c \ + sactbgm.c \ + sacttimer.c \ + sactstring.c \ + sactcrypto.c \ + sactchart.c \ + sactamask.c \ + sactlog.c \ + sprite.c \ + sprite_event.c \ + sprite_tevent.c \ + sprite_move.c \ + sprite_anime.c \ + sprite_get.c \ + sprite_put.c \ + sprite_switch.c \ + sprite_sel.c \ + sprite_msg.c \ + sprite_draw.c \ + sprite_update.c \ + sprite_eupdate.c \ + sprite_quake.c \ + sprite_keywait.c \ + screen_quake.c \ + sprite_xmenu.c + + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/modules/SACT -I$(top_srcdir)/modules/SACT diff --git a/modules/SACT/Makefile.in b/modules/SACT/Makefile.in new file mode 100644 index 0000000..a90204e --- /dev/null +++ b/modules/SACT/Makefile.in @@ -0,0 +1,620 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/SACT +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +SACT_la_DEPENDENCIES = ../lib/libgraph.la ../lib/libdrawtext.la +am_SACT_la_OBJECTS = SACT.lo sactcg.lo sactsound.lo sactbgm.lo \ + sacttimer.lo sactstring.lo sactcrypto.lo sactchart.lo \ + sactamask.lo sactlog.lo sprite.lo sprite_event.lo \ + sprite_tevent.lo sprite_move.lo sprite_anime.lo sprite_get.lo \ + sprite_put.lo sprite_switch.lo sprite_sel.lo sprite_msg.lo \ + sprite_draw.lo sprite_update.lo sprite_eupdate.lo \ + sprite_quake.lo sprite_keywait.lo screen_quake.lo \ + sprite_xmenu.lo +SACT_la_OBJECTS = $(am_SACT_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(SACT_la_SOURCES) +DIST_SOURCES = $(SACT_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = SACT.la +SACT_la_LDFLAGS = -module -export-dynamic -avoid-version +SACT_la_LIBADD = ../lib/libgraph.la ../lib/libdrawtext.la @GLIB_LIBS@ +SACT_la_SOURCES = \ + SACT.c \ + sactcg.c \ + sactsound.c \ + sactbgm.c \ + sacttimer.c \ + sactstring.c \ + sactcrypto.c \ + sactchart.c \ + sactamask.c \ + sactlog.c \ + sprite.c \ + sprite_event.c \ + sprite_tevent.c \ + sprite_move.c \ + sprite_anime.c \ + sprite_get.c \ + sprite_put.c \ + sprite_switch.c \ + sprite_sel.c \ + sprite_msg.c \ + sprite_draw.c \ + sprite_update.c \ + sprite_eupdate.c \ + sprite_quake.c \ + sprite_keywait.c \ + screen_quake.c \ + sprite_xmenu.c + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/modules/SACT -I$(top_srcdir)/modules/SACT + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/SACT/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/SACT/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +SACT.la: $(SACT_la_OBJECTS) $(SACT_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(SACT_la_LDFLAGS) $(SACT_la_OBJECTS) $(SACT_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SACT.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactamask.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactbgm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactcg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactchart.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactcrypto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactlog.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactsound.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactstring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sacttimer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/screen_quake.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_anime.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_draw.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_eupdate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_get.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_keywait.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_move.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_put.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_quake.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_sel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_switch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_tevent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_update.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite_xmenu.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/SACT/SACT.c b/modules/SACT/SACT.c new file mode 100644 index 0000000..d3c19ab --- /dev/null +++ b/modules/SACT/SACT.c @@ -0,0 +1,2117 @@ +/* + * sact.c: SACT + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: SACT.c,v 1.10 2004/10/31 04:18:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "imput.h" +#include "xsystem35.h" +#include "gametitle.h" +#include "message.h" +#include "nact.h" +#include "sact.h" +#include "sprite.h" +#include "sactcg.h" +#include "sactstring.h" +#include "sactsound.h" +#include "sactbgm.h" +#include "sactcrypto.h" +#include "sactchart.h" +#include "ngraph.h" +#include "surface.h" +#include "sactamask.h" + +/* + MTコマンドで設定された文字列によって、バージョン間の違いを吸収 + + Version 1.0 : エスカレイヤー + 1.1 : Rance5D + 1.2(前期): 妻みぐい2 + 1.2(後期): SACT開発キット, シェル・クレイル, NightDemon +*/ + +/* + 妻みぐい2キー説明 + + メッセージスキップ(既読、未読関係なくスキップ) -> Ctrl + 自動メッセージ送り -> Aキー + Aキーを押すことで、自動的にメッセージがすすんで行きます。(自動メッセージ + 送りがONになると、メッセージウィンドの右下にある入力待ちカーソル(>>>>)が + 消えます。解除する場合は、セリフもしくは音声終了まで、Aキーを押し続けて + ください。Aキーを離したときに、入力待ちカーソルが表示されれば解除された + ことになります。 + バックログ -> ホイール +*/ + + +/* + wNum の範囲など、引数のチェックは各サブシステム上でする。 + + +実装確認事項 + SACT.CreateSprite はその呼ばれた瞬間のCGが使用される + ->SACT.DrawまでにCGが変更されても、Create時のCGを使用 + OutputMessageはメッセージが表示終るまでもどってこない。 + QuakeScreenは終了までもどってこない。(キー抜けあり) + 自動改行はしない + OutputMessage がきて始めて1文字づつ描画を行う。NewLineでは書かない。 + ~KEY 2: は直前の全てのSP_MOVEが終了するまでスイッチスプライト等は反応しない + drag中にスイッチスプライトは反応しない + アニメーションスプライトはつねに動作 + スイッチスプライトは、ボタンが押下状態でスプライト内に入って来たときも、 + cg3に変化する。このときボタンを離しても SpriteKeyWaitを抜けない。 + また、ボタンを押したままスプライト外に出ても、出た後はcg1に変化する + GETA/BもフォーカスインでCG2にボタン押下でCG3に + SWPUTはボタン押下で抜ける +*/ + + +// SACT 関連の情報 +sact_t sactprv; +extern char *xsys35_sact01; + +/** + * SACT.Init (1.0~) + * SACT全体の初期化 + */ +void Init() { + int p1 = getCaliValue(); /* ISys3x */ + + // ゲームタイトルによるバージョン設定 + if (0 == strcmp(nact->game_title_name, GT_ESUKA)) { + sact.version = 100; + } else if (0 == strcmp(nact->game_title_name, GT_RANCE5D)){ + sact.version = 110; + } else { + sact.version = 120; + } + + NOTICE("SACT version = %d\n", sact.version); + + // 初期座標原点 + sact.origin.x = 0; + sact.origin.y = 0; + + // 各サブシステム初期化 + sp_init(); + sstr_init(); + ssel_init(); + stimer_init(); + ssnd_init(); + + if (nact->files.sact01) { + smask_init(nact->files.sact01); + } + + // create depth map + sact.dmap = sf_create_pixel(sf0->width, sf0->height, 16); + + // その他 System35 のデフォルト動作の変更 + nact->ags.font->antialiase_on = TRUE; + sys_setHankakuMode(2); // 全角半角変換無し + ags_autorepeat(FALSE); // key auto repeat off + + if (sact.version >= 120) { + sact.logging = TRUE; + } else { + sact.logging = FALSE; + } + + DEBUG_COMMAND("SACT.Init %d:\n", p1); +} + +/** + * SACT.CreateSprite (1.0~) + * スプライト作成 + * @param wNum: スプライト番号 + * @param wNumCG1: 通常表示するCG番号 + * @param wNumCG2: マウスカーソルを重ねたときのCG番号 + * @param wNumCG3: クリックしたときのCG番号 + * @param wType: スプライトのタイプ + */ +void CreateSprite() { + int wNum = getCaliValue(); + int wNumCG1 = getCaliValue(); + int wNumCG2 = getCaliValue(); + int wNumCG3 = getCaliValue(); + int wType = getCaliValue(); + + sp_new(wNum, wNumCG1, wNumCG2, wNumCG3, wType); + + DEBUG_COMMAND_YET("SACT.CreateSprite %d,%d,%d,%d,%d:\n", wNum, wNumCG1, wNumCG2, wNumCG3, wType); +} + +/** + * SACT.CreateTextSprite (1.0~) + * メッセージを表示するスプライトの作成 + * @param wNum: スプライト番号 + * @param wX: 表示位置のX座標 + * @param wY: 表示位置のY座標 + * @param wWidth: スプライトの幅 + * @param wHeight: スプライトの高さ + */ +void CreateTextSprite() { + int wNum = getCaliValue(); + int wX = getCaliValue(); + int wY = getCaliValue(); + int wWidth = getCaliValue(); + int wHeight = getCaliValue(); + + sp_new_msg(wNum, wX, wY, wWidth, wHeight); + + DEBUG_COMMAND_YET("SACT.CreateTextSprite %d,%d,%d,%d,%d:\n", wNum, wX, wY, wWidth, wHeight); +} + +/** + * SACT.SetWallPaper (1.0~) + * 壁紙(画面背景)として表示するCGの設定 + * @param wNum: 壁紙(背景)として表示するCGの番号 + */ +void SetWallPaper() { + int wNum = getCaliValue(); + + sp_set_wall_paper(wNum); + + DEBUG_COMMAND_YET("SACT.SetWallPaper %d:\n", wNum); +} + +/** + * SACT.Clear (1.0~) + * 全スプライト削除(~SP_CLR) + */ +void Clear() { + sp_free_all(); + + DEBUG_COMMAND_YET("SACT.Clear:\n"); +} + +/** + * SACT.Delete (1.0~) + * スプライトの削除 + * @param wNum: 削除するスプライト番号 + */ +void Delete() { + int wNum = getCaliValue(); + + sp_free(wNum); + + DEBUG_COMMAND_YET("SACT.Delete %d:\n", wNum); +} + +/** + * SACT.SpriteDeleteCount (1.0~) + * wNum番からwCount個の範囲のスプライトの削除 + * @param wNum: 先頭スプライト番号 + * @param wCount: 範囲 + */ +void SpriteDeleteCount() { + int wNum = getCaliValue(); + int wCount = getCaliValue(); + int i; + + for (i = wNum; i < (wNum + wCount); i++) { + sp_free(i); + } + + DEBUG_COMMAND_YET("SACT.SpriteDeleteCount %d,%d:\n", wNum, wCount); +} + +/** + * SACT.Draw (1.0~) + * 現在設定されているスプライト状態を画面に反映(~SP_UPDATE) + */ +void Draw() { + sp_update_all(TRUE); + + DEBUG_COMMAND_YET("SACT.Draw:\n"); +} + +/** + * SCAT.DrawEffect (1.0~) + * 効果指定付き画面更新 + * @param wType: エフェクトタイプ + * @param wEffectTime: エフェクトの時間(1/100秒単位) + * @param wEffectKey: キー抜け設定 (1.1~) (1で有効) + */ +void DrawEffect() { + int wType = getCaliValue(); + int wEffectTime = getCaliValue(); + int wEffectkey = 1; + + if (sact.version >= 110) { + wEffectkey = getCaliValue(); + } + + sp_eupdate(wType, wEffectTime, wEffectkey); + + DEBUG_COMMAND_YET("SACT.DrawEffect %d,%d,%d:\n", wType, wEffectTime, wEffectkey); +} + +/** + * SCAT.DrawEffectAlphaMap (1.1~) + * αマスクつき画面更新 + * @param nIndexAlphaMap: マスクα番号 + * @param wEffectTime: エフェクトの時間(1/100秒単位) + * @param wEffectKey: キー抜け設定 + */ +void DrawEffectAlphaMap() { + int nIndexAlphaMap = getCaliValue(); + int wEffectTime = getCaliValue(); + int wEffectKey = getCaliValue(); + + sp_eupdate_amap(nIndexAlphaMap, wEffectTime, wEffectKey); + + DEBUG_COMMAND_YET("SACT.DrawEffectAlphaMap %d,%d,%d:\n", nIndexAlphaMap, wEffectTime, wEffectKey); +} + +/** + * SCAT.QuakeScreen (1.0~) + * 画面揺らし + * @param wType: 0=縦横, 1:回転 + * @param wParam1: wType=0のときx方向の振幅 + * wType=1のとき振幅 + * @param wParam2: wType=0のときy方向の振幅 + * wType=1のとき回転数 + * @param wCount: 時間(1/100秒) + * @param nfKeyEnable: キー抜け (1で有効) (1.1~) + */ +void QuakeScreen() { + int wType = getCaliValue(); + int wParam1 = getCaliValue(); + int wParam2 = getCaliValue(); + int wCount = getCaliValue(); + int nfKeyEnable = 1; + + if (sact.version >= 110) { + nfKeyEnable = getCaliValue(); + } + + sp_quake_screen(wType, wParam1, wParam2, wCount, nfKeyEnable); + + DEBUG_COMMAND_YET("SACT.QuakeScreen %d,%d,%d,%d,%d:\n", wType, wParam1, wParam2, wCount, nfKeyEnable); +} + +/** + * SACT.SetOrigin (1.0~) + * 基準座標変更 + * @param wX: 原点にするX座標の位置 + * @param wY: 原点にするY座標の位置 + */ +void SetOrigin() { + int wX = getCaliValue(); + int wY = getCaliValue(); + + sact.origin.x = wX; + sact.origin.y = wY; + + DEBUG_COMMAND_YET("SACT.SetOrigin %d,%d:\n", wX, wY); +} + +/** + * SACT.SetShow (1.0~) + * スプライトの表示状態の変更 + * @param wNum: 先頭のスプライト番号 + * @param wCount: 表示する個数 + * @param wShow: 0:非表示, 1:表示 + */ +void SetShow() { + int wNum = getCaliValue(); + int wCount = getCaliValue(); + int wShow = getCaliValue(); + + sp_set_show(wNum, wCount, wShow); + + DEBUG_COMMAND_YET("SACT.SetShow %d,%d,%d:\n", wNum, wCount, wShow); +} + +/** + * SACT.SetBlendRate (1.1~) + * スプライトの表示状態の変更 + * @param wNum: 先頭のスプライト番号 + * @param wCount: 表示する個数 + * @param nBlendRate: ブレンド率 + */ +void SetBlendRate() { + int wNum = getCaliValue(); + int wCount = getCaliValue(); + int nBlendRate = getCaliValue(); + + sp_set_blendrate(wNum, wCount, nBlendRate); + + DEBUG_COMMAND_YET("SACT.SetBlendRate %d,%d,%d:\n", wNum, wCount, nBlendRate); +} + +/** + * SACT.SetPos (1.0~) + * スプライトの表示位置を設定(変更) + * @param wNum: スプライト番号 + * @param wX: 表示X座標 + * @param wY: 表示Y座標 + */ +void SetPos() { + int wNum = getCaliValue(); + int wX = getCaliValue(); + int wY = getCaliValue(); + + sp_set_pos(wNum, wX, wY); + + DEBUG_COMMAND_YET("SACT.SetPos %d,%d,%d:\n", wNum, wX, wY); +} + +/** + * SACT.SetMove (1.0~) + * スプライトの移動 (すぐに処理を戻す) + * @param wNum: スプライト番号 + * @param wX: 表示X座標 + * @param wY: 表示Y座標 + */ +void SetMove() { + int wNum = getCaliValue(); + int wX = getCaliValue(); + int wY = getCaliValue(); + + sp_set_move(wNum, wX, wY); + + DEBUG_COMMAND_YET("SACT.SetMove %d,%d,%d:\n", wNum, wX, wY); +} + +/** + * SACT.SetMoveTime (1.0~) + * SetMoveによるスプライト移動の時間の設定 + * @param wNum: スプライト番号 + * @param wTime: 移動を完了するまでの時間(1/100秒単位) + */ +void SetMoveTime() { + int wNum = getCaliValue(); + int wTime = getCaliValue(); + + sp_set_movetime(wNum, wTime); + + DEBUG_COMMAND_YET("SACT.SetMoveTime %d,%d:\n", wNum, wTime); +} + +/** + * SACT.SetMoveSpeed (1.0~) + * SetMoveによるスプライト移動の速度を設定 + * @param wNum: スプライト番号 + * @param wSpeed: 移動速度(デフォルトを100%とした%指定) + */ +void SetMoveSpeed() { + int wNum = getCaliValue(); + int wSpeed = getCaliValue(); + + sp_set_movespeed(wNum, wSpeed); + + DEBUG_COMMAND_YET("SACT.SetMoveSpeed %d,%d:\n", wNum, wSpeed); +} + +/** + * SACT.SetMoveSpeedCount (1.0~) + * 複数のスプライトに対するスプライト移動の速度の設定 + * @param wNum: 先頭スプライト番号 + * @param wCount: 範囲 + * @param wSpeed: 移動速度(デフォルトを100%とした%指定) + */ +void SetMoveSpeedCount() { + int wNum = getCaliValue(); + int wCount = getCaliValue(); + int wSpeed = getCaliValue(); + int i; + + for (i = wNum; i < (wNum + wCount); i++) { + sp_set_movespeed(i, wSpeed); + } + + DEBUG_COMMAND_YET("SACT.SetMoveSpeedCount %d,%d,%d:\n", wNum, wCount, wSpeed); +} + +/** + * SACT.SetSpriteAnimeTimeInterval (1.1~) + * 複数のスプライトに対するアニメーションスプライトの間隔 + * @param wNum: 先頭スプライト番号 + * @param wCount: 範囲 + * @param nTime: 間隔 + */ +void SetSpriteAnimeTimeInterval() { + int wNum = getCaliValue(); + int wCount = getCaliValue(); + int nTime = getCaliValue(); + int i; + + for (i = wNum; i < (wNum + wCount); i++) { + sp_set_animeinterval(i, nTime); + } + + DEBUG_COMMAND_YET("SACT.SetSpriteAnimeTimeInterval %d,%d,%d:\n", wNum, wCount, nTime); +} + +/** + * SACT.AddZKeyHideSprite (1.0~) + * キー入力待ちでZキーが押されたときに表示OFFになるスプライトの登録 + * @param wNum: スプライト番号 + */ +void AddZKeyHideSprite() { + int wNum = getCaliValue(); + + sp_add_zkey_hidesprite(wNum); + + DEBUG_COMMAND_YET("SACT.AddZKeyHideSprite %d:\n", wNum); +} + +/** + * SACT.ClearZKeyHideSprite (1.0~) + * AddZKeyHideSpriteで登録したスプライト番号を全てクリア + */ +void ClearZKeyHideSprite() { + sp_clear_zkey_hidesprite_all(); + + DEBUG_COMMAND_YET("SACT.ClearZKeyHideSprite:\n"); +} + +/** + * SACT.SpriteFreeze (1.0~) + * スプライトスイッチをwIndexの状態で固定し、~KEY 2:などで反応しない + * ようにする + * @param wNum: スプライト番号 + * @param wIndex: 固定する状態番号(1-3) + */ +void SpriteFreeze() { + int wNum = getCaliValue(); + int wIndex = getCaliValue(); + + sp_freeze_sprite(wNum, wIndex); + + DEBUG_COMMAND_YET("SACT.SpriteFreeze %d,%d:\n", wNum, wIndex); +} + +/** + * SACT.SpriteThaw (1.0~) + * Freezeしたスプライト状態を解除 + * @param wNum: スプライト番号 + */ +void SpriteThaw() { + int wNum = getCaliValue(); + + sp_thaw_sprite(wNum); + + DEBUG_COMMAND_YET("SACT.SpriteThaw %d:\n", wNum); +} + +/** + * SACT.SpriteFreezeCount (1.0~) + * 複数のスプライトをFreezeする + * @param wNum: 先頭スプライト番号 + * @param wCount: 範囲 + * @param wIndex: 固定する状態番号 + */ +void SpriteFreezeCount() { + int wNum = getCaliValue(); + int wCount = getCaliValue(); + int wIndex = getCaliValue(); + int i; + + for (i = wNum; i < (wNum + wCount); i++) { + sp_freeze_sprite(i, wIndex); + } + + DEBUG_COMMAND_YET("SACT.SpriteFreezeCount %d,%d,%d:\n", wNum, wCount, wIndex); +} + +/** + * SACT.SpriteThawCount (1.0~) + * 複数のFreezeスプライト状態の解除 + * @param wNum: 先頭スプライト番号 + * @param wCount: 範囲 + */ +void SpriteThawCount() { + int wNum = getCaliValue(); + int wCount = getCaliValue(); + int i; + + for (i = wNum; i < (wNum + wCount); i++) { + sp_thaw_sprite(i); + } + + DEBUG_COMMAND_YET("SACT.SpriteThawCount %d,%d:\n", wNum, wCount); +} + +/** + * SACT.QuakeSpriteAdd (1.0~) + * QuakeSpriteで揺らすスプライトを追加 + * @param wNum: スプライト番号 + */ +void QuakeSpriteAdd() { + int wNum = getCaliValue(); + + sp_add_quakesprite(wNum); + + DEBUG_COMMAND_YET("SACT.QuakeSpriteAdd %d:\n", wNum); +} + +/** + * SACT.QuakeSpriteReset (1.0~) + * QuakeSpriteAddの設定を全て解除 + */ +void QuakeSpriteReset() { + sp_clear_quakesprite_all(); + DEBUG_COMMAND_YET("SACT.QuakeSpriteReset:\n"); +} + +/** + * SACT.QuakeSprite (1.0~) + * QuakeSpriteAddで設定したスプライトを揺らす + * @param wType: 0:縦横(全てのスプライトを同じように揺らす) + * 1:縦横(全てのスプライトをバラバラに揺らす) + * @param wAmplitudeX: X方向の振幅 + * @param wAmplitudeY: Y方向の振幅 + * @param wCount: 時間(1/100秒) + * @param nfKeyEnable: (1.1~): キーキャンセルあり(=1) + */ +void QuakeSprite() { + int wType = getCaliValue(); + int wAmplitudeX = getCaliValue(); + int wAmplitudeY = getCaliValue(); + int wCount = getCaliValue(); + int nfKeyEnable = 0; + + if (sact.version >= 110) { + nfKeyEnable = getCaliValue(); + } + + sp_quake_sprite(wType, wAmplitudeX, wAmplitudeY, wCount, nfKeyEnable); + + DEBUG_COMMAND_YET("SACT.QuakeSprite %d,%d,%d,%d:\n", wType, wAmplitudeX, wAmplitudeY, wCount); +} + +/** + * SACT.QuerySpriteIsExist (1.0~) + * 指定のスプライトが登録されているかどうかを取得 + * @param wNum: スプライト番号 + * @param var: 登録状態を返す変数 0: 未登録, 1:既登録 + */ +void QuerySpriteIsExist() { + int wNum = getCaliValue(); + int *var = getCaliVariable(); + + sp_query_isexist(wNum, var); + + DEBUG_COMMAND_YET("SACT.QuerySpriteIsExist %d,%p:\n", wNum, var); +} + +/** + * SACT.QuerySpriteInfo (1.0~) + * スプライトの情報を取得 + * @param wNum: スプライト番号 + * @param vType: スプライトタイプ。テキストスプライトの場合は100 + * @param vCG1: CG1(ない場合は0) + * @param vCG2: CG2(ない場合は0) + * @param vCG3: CG3(ない場合は0) + */ +void QuerySpriteInfo() { + int wNum = getCaliValue(); + int *vType = getCaliVariable(); + int *vCG1 = getCaliVariable(); + int *vCG2 = getCaliVariable(); + int *vCG3 = getCaliVariable(); + + sp_query_info(wNum, vType, vCG1, vCG2, vCG3); + + DEBUG_COMMAND_YET("SACT.QuerySpriteInfo %d,%p,%p,%p,%p:\n", wNum, vType, vCG1, vCG2, vCG3); +} + +/** + * SACT.QuerySpriteShow (1.0~) + * スプライトの表示状態(SP_SHOWの値)を取得 + * @param wNum: スプライト番号 + * @param vShow: 0:非表示, 1:表示 + */ +void QuerySpriteShow() { + int wNum = getCaliValue(); + int *vShow = getCaliVariable(); + + sp_query_show(wNum, vShow); + + DEBUG_COMMAND_YET("SACT.QuerySpriteShow %d,%p:\n", wNum, vShow); +} + +/** + * SACT.QuerySpritePos (1.0~) + * スプライトの表示位置の取得 + * @param wNum: スプライト番号 + * @param vX: X座標 + * @param vY: Y座標 + */ +void QuerySpritePos() { + int wNum = getCaliValue(); + int *vX = getCaliVariable(); + int *vY = getCaliVariable(); + + sp_query_pos(wNum, vX, vY); + + DEBUG_COMMAND_YET("SACT.QuerySpritePos %d,%p,%p:\n", wNum, vX, vY); +} + +/** + * SACT.QuerySpriteSize (1.0~) + * スプライトの大きさの取得 + * @param wNum: スプライト番号 + * @param vWidth: スプライトの幅 + * @param vHeight: スプライトの高さ + */ +void QuerySpriteSize() { + int wNum = getCaliValue(); + int *vWidth = getCaliVariable(); + int *vHeight = getCaliVariable(); + + sp_query_size(wNum, vWidth, vHeight); + + DEBUG_COMMAND_YET("SACT.QuerySpriteSize %d,%p,%p:\n", wNum, vWidth, vHeight); +} + +/** + * SACT.QueryTextPos (1.2~) + * メッセージスプライトの文字位置 + * @param nMesSpID: + * @param pwX: + * @param pwY: + */ +void QueryTextPos() { + int wNum = getCaliValue(); + int *vX = getCaliVariable(); + int *vY = getCaliVariable(); + + sp_query_textpos(wNum, vX, vY); + + DEBUG_COMMAND_YET("SACT.QueryTextPos %d,%p,%p:\n", wNum, vX, vY); +} + +/** + * SCAT.CG_Clear (1.0~) + * CG_Createで作成したCGを全て削除 + */ +void CG_Clear() { + scg_freeall(); + + DEBUG_COMMAND_YET("SACT.CG_Clear:\n"); +} + +/** + * SACT.CG_Reset (1.0~) + * CG_Createで作成したCGを削除 + * @param wNumCG: 削除するCG番号 + */ +void CG_Reset() { + int wNumCG = getCaliValue(); + + scg_free(wNumCG); + + DEBUG_COMMAND_YET("SACT.CG_Reset %d:\n", wNumCG); +} + +/** + * SACT.CG_QueryType (1.0~) + * CGの状態(CGのタイプ)を取得 + * @param wNumCG: CG番号 + * @param vType: CGの種類, 0: 未使用, 1:リンクされている, 2: CG_SETで作成 + * 3: CG_REVERSEで作成, 4: CG_STRETCHで作成 + */ +void CG_QueryType() { + int wNumCG = getCaliValue(); + int *vType = getCaliVariable(); + + scg_querytype(wNumCG, vType); + + DEBUG_COMMAND_YET("SACT.CG_QueryType %d,%p:\n", wNumCG, vType); +} + +/** + * SACT.CG_QuerySize (1.0~) + * CGの大きさを取得 + * @param wNumCG: CG番号 + * @param vWidth: 幅 + * @param vHeight: 高さ + */ +void CG_QuerySize() { + int wNumCG = getCaliValue(); + int *vWidth = getCaliVariable(); + int *vHeight = getCaliVariable(); + + scg_querysize(wNumCG, vWidth, vHeight); + + DEBUG_COMMAND_YET("SACT.CG_QuerySize %d,%p,%p:\n", wNumCG, vWidth, vHeight); +} + +/** + * SACT.CG_QueryBpp (1.0~) + * CGのbppを取得 + * @param wNumCG: CG番号 + * @param vBpp: CGのbpp + */ +void CG_QueryBpp() { + int wNumCG = getCaliValue(); + int *vBpp = getCaliVariable(); + + scg_querybpp(wNumCG, vBpp); + + DEBUG_COMMAND_YET("SACT.CG_QueryBpp %d,%p:\n", wNumCG, vBpp); +} + +/** + * SACT.CG_ExistAlphaMap (1.0~) + * CGのαマップ(マスク)があれば1、なければ0 + * @param wNumCG: CG番号 + * @param vMask: 0/1 + */ +void CG_ExistAlphaMap() { + int wNumCG = getCaliValue(); + int *vMask = getCaliVariable(); + + scg_existalphamap(wNumCG, vMask); + + DEBUG_COMMAND_YET("SACT.CG_ExistAlphaMap %d,%p:\n", wNumCG, vMask); +} + +/** + * SACT.CG_Create (1.0~) + * 指定サイズ、色、ブレンド率の四角を表示する + * @param wNumCG: CG番号 + * @param wWidth: 幅 + * @param wHeight: 高さ + * @param wR: RGB値の赤(0-255) + * @param wG: RGB値の緑(0-255) + * @param wB: RGB値の青(0-255) + * @param wBlendRate: ブレンド率(0-255) + */ +void CG_Create() { + int wNumCG = getCaliValue(); + int wWidth = getCaliValue(); + int wHeight = getCaliValue(); + int wR = getCaliValue(); + int wG = getCaliValue(); + int wB = getCaliValue(); + int wBlendRate = getCaliValue(); + + scg_create(wNumCG, wWidth, wHeight, wR, wG, wB, wBlendRate); + + DEBUG_COMMAND_YET("SACT.CG_Create %d,%d,%d,%d,%d,%d,%d:\n", wNumCG, wWidth, wHeight, wR, wG, wB, wBlendRate); +} + +/** + * SACT,CG_CreateReverse (1.0~) + * 元になるCGを反転したCGを作成する + * @param wNumCG: CG番号 + * @param wNumSrcCG: コピーの元になるCGの番号 + * @param wReverseX: X方向の反転スイッチ(0:反転しない、1:反転する) + * @param wReverseY: Y方向の反転スイッチ(0:反転しない、1:反転する) + */ +void CG_CreateReverse() { + int wNumCG = getCaliValue(); + int wNumSrcCG = getCaliValue(); + int wReverseX = getCaliValue(); + int wReverseY = getCaliValue(); + + scg_create_reverse(wNumCG, wNumSrcCG, wReverseX, wReverseY); + + DEBUG_COMMAND_YET("SACT.CG_CreateReverse %d,%d,%d,%d:\n", wNumCG, wNumSrcCG, wReverseX, wReverseY); +} + +/** + * SACT.CG_CreateStretch (1.0~) + * 元になるCGを拡大もしくは縮小したCGを作成する + * @param wNumCG: CG番号 + * @param wWidth: 作成するCGの幅 + * @param wHeight: 作成するCGの高さ + * @param wNumSrcCG: 元になるCGの番号 + */ +void CG_CreateStretch() { + int wNumCG = getCaliValue(); + int wWidth = getCaliValue(); + int wHeight = getCaliValue(); + int wNumSrcCG = getCaliValue(); + + scg_create_stretch(wNumCG, wWidth, wHeight, wNumSrcCG); + + DEBUG_COMMAND_YET("SACT.CG_CreateStretch %d,%d,%d,%d:\n", wNumCG, wWidth, wHeight, wNumSrcCG); +} + +/** + * SACT.CG_CreateBlend (1.0~) + * 2枚のCGをかさねあわせたCGを作成 + * @param wNumDstCG: CG番号(作成先) + * @param wNumBaseCG: 重ね合わせのもととなるCG + * @param wX: 重ね合わせる位置のX座標 + * @param wY: 重ね合わせる位置のY座標 + * @param wNumBlendCG: 上に重ね合わせるCG + * @param wAlphaMapMode: αマップの作成モード + */ +void CG_CreateBlend() { + int wNumDstCG = getCaliValue(); + int wNumBaseCG = getCaliValue(); + int wX = getCaliValue(); + int wY = getCaliValue(); + int wNumBlendCG = getCaliValue(); + int wAlphaMapMode = getCaliValue(); + + DEBUG_COMMAND_YET("SACT.CG_CreateBlend %d,%d,%d,%d,%d,%d:\n", wNumDstCG, wNumBaseCG, wX, wY, wNumBlendCG, wAlphaMapMode); + scg_create_blend(wNumDstCG, wNumBaseCG, wX, wY, wNumBlendCG, wAlphaMapMode); + +} + +/** + * SACT.CG_CreateText (1.0~) + * 文字列からCGを作成 + * @param wNumCG: 作成するCG番号 + * @param wSize: 文字の高さ(pixel) + * @param wR: 文字のR値(0-255) + * @param wG: 文字のG値(0-255) + * @param wB: 文字のB値(0-255) + * @param wText: 描画する文字列変数の番号 + */ +void CG_CreateText() { + int wNumCG = getCaliValue(); + int wSize = getCaliValue(); + int wR = getCaliValue(); + int wG = getCaliValue(); + int wB = getCaliValue(); + int wText = getCaliValue(); + + scg_create_text(wNumCG, wSize, wR, wG, wB, wText); + + DEBUG_COMMAND_YET("SACT.CG_CreateText %d,%d,%d,%d,%d,%d:\n", wNumCG, wSize, wR, wG, wB, wText); +} + +/** + * SACT.CG_CreateTextNum (1.0~) + * 数値からシステムテキストのCGを作成 + * @param wNumCG: 作成するCG番号 + * @param wSize: 文字の高さ(pixel) + * @param wR: 文字のR値(0-255) + * @param wG: 文字のG値(0-255) + * @param wB: 文字のB値(0-255) + * @param wFigs: 桁数 + * @param wZeroPadding: 桁数に満たない部分0で埋めるかどうかのフラグ + * 0:ゼロ埋めしない 1:ゼロ埋めする + * @param wValue: 描画する値 + */ +void CG_CreateTextNum() { + int wNumCG = getCaliValue(); + int wSize = getCaliValue(); + int wR = getCaliValue(); + int wG = getCaliValue(); + int wB = getCaliValue(); + int wFigs = getCaliValue(); + int wZeroPadding = getCaliValue(); + int wValue = getCaliValue(); + + scg_create_textnum(wNumCG, wSize, wR, wG, wB, wFigs, wZeroPadding, wValue); + + DEBUG_COMMAND_YET("SACT.CG_CreateTextNum %d,%d,%d,%d,%d,%d,%d,%d:\n", wNumCG, wSize, wR, wG, wB, wFigs, wZeroPadding, wValue); +} + +/** + * SACT.CG_Copy (1.0~) + * CGを複製 + * @param wNumDst: 複写先のCG番号 + * @param wNumSrc: 複写元のCG番号 + */ +void CG_Copy() { + int wNumDst = getCaliValue(); + int wNumSrc = getCaliValue(); + + scg_copy(wNumDst, wNumSrc); + + DEBUG_COMMAND_YET("SACT.CG_Copy %d,%d:\n", wNumDst, wNumSrc); +} + +/** + * SACT.CG_Cut (1.0~) + * 元のCGの一部を切りぬいたCGを作成 + * @param wNumDstCG: CG番号(作成先) + * @param wNumSrcCG: CG番号(カット元) + * @param wX: カット開始X座標 + * @param wY: カット開始Y座標 + * @param wWidth: カット幅 + * @param wHeight: カット高さ + */ +void CG_Cut() { + int wNumDstCG = getCaliValue(); + int wNumSrcCG = getCaliValue(); + int wX = getCaliValue(); + int wY = getCaliValue(); + int wWidth = getCaliValue(); + int wHeight = getCaliValue(); + + scg_cut(wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight); + + DEBUG_COMMAND_YET("SACT.CG_Cut %d,%d,%d,%d,%d,%d:\n", wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight); +} + +/** + * SACT.CG_PartCopy (1.0~) + * 元のCGの一部を切りぬいたCGを作成、CGのサイズ自体はもとのままで、 + * マスクデータのみを処理して見掛け上のサイズを変化させる + * @param wNumDstCG: CG番号(作成先) + * @param wNumSrcCG: CG番号(元) + * @param wX: 開始X座標 + * @param wY: 開始Y座標 + * @param wWidth: カット幅 + * @param wHeight: カット高さ + */ +void CG_PartCopy() { + int wNumDstCG = getCaliValue(); + int wNumSrcCG = getCaliValue(); + int wX = getCaliValue(); + int wY = getCaliValue(); + int wWidth = getCaliValue(); + int wHeight = getCaliValue(); + + scg_partcopy(wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight); + + DEBUG_COMMAND_YET("SACT.PartCopy %d,%d,%d,%d,%d,%d:\n", wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight); +} + +/** + * SACT.WiatKeySimple (1.0~) + * 通常キー入力待ち + * @param vKey: 入力されたキー + */ +void WaitKeySimple() { + int *vKey = getCaliVariable(); + + DEBUG_COMMAND_YET("SACT.WaitKeySimple %d:\n", vKey); + + // とりあえず全更新 + sp_update_all(TRUE); + + sact.waittype = KEYWAIT_SIMPLE; + sact.waitkey = -1; + + while(sact.waitkey == -1) { + sys_keywait(25, TRUE); + } + + sact.waittype = KEYWAIT_NONE; + + *vKey = sact.waitkey; + +} + +/** + * SACT.WaitKeyMessgae (1.0~) + * メッセージキー入力待ち + * @param wMessageMark1: スプライト番号1(アニメーションスプライト) + * @param wMessageMark2: スプライト番号2(アニメーションスプライト) + * @param wMessageLength: (1.2~) + */ +void WaitKeyMessage() { + int wMessageMark1 = getCaliValue(); + int wMessageMark2 = getCaliValue(); + int wMessageLength = 0; + + if (sact.version >= 120) { + wMessageLength = getCaliValue(); + } + + smsg_keywait(wMessageMark1, wMessageMark2, wMessageLength); + + DEBUG_COMMAND_YET("SACT.WaitKeyMessage %d,%d,%d:\n", wMessageMark1, wMessageMark2, wMessageLength); +} + +/** + * SACT.WaitKeySprite (1.0~) + * スプライト処理待ち + * @param vOK: 0ならば右クリック + * @param vRND: キー入力結果 + * @param vRsv1: 予約 + * @param vRsv2: 予約 + */ +void WaitKeySprite() { + int *vOK = getCaliVariable(); + int *vRND = getCaliVariable(); + int *vRsv1 = getCaliVariable(); + int *vRsv2 = getCaliVariable(); + + DEBUG_COMMAND("SACT.WaitKeySprite %p,%p,%p,%p:\n", vOK, vRND, vRsv1, vRsv2); + + sp_keywait(vOK, vRND, vRsv1, vRsv2, NULL, -1); + + DEBUG_COMMAND_YET("SACT.WaitKeySprite %d,%d,%d,%d:\n", *vOK, *vRND, *vRsv1, *vRsv2); +} + +/** + * SACT.PeekKey (1.2~) + * ????? + * @param nKeyCode: + * @param vResult: + */ +void PeekKey() { + int nKeyCode = getCaliValue(); + int *vResult = getCaliVariable(); + + WARNING("NOT IMPLEMENTED\n"); + DEBUG_COMMAND_YET("SACT.PeekKey %d,%p:\n", nKeyCode, vResult); +} + +/** + * SACT.WaitKeySKipKeyUp (1.0~) + * 文字送りキーが押されっぱなしの時、離されるまで待つ + */ +void WaitMsgSkipKeyUp() { + WARNING("NOT IMPLEMENTED\n"); + DEBUG_COMMAND_YET("SACT.WaitMsgSkipKeyUp:\n"); +} + +/** + * SACT.WaiKeySimpleTimeOut (1.0~) + * タイムアウトつきキーウェイト + * @param vRND: 入力されたキーコード + * @param vD03: タイムアウトした場合=1, しない場合=0 + * @param wTime: タイムアウト時間 (1/100sec) + */ +void WaitKeySimpleTimeOut() { + int *vRND = getCaliVariable(); + int *vD03 = getCaliVariable(); + int wTime = getCaliValue(); + + sact.waittype = KEYWAIT_SIMPLE; + sact.waitkey = -1; + + sys_keywait(wTime * 10, TRUE); + if (sact.waitkey == -1) { + *vD03 = 1; + *vRND = 0; + } else { + *vD03 = 0; + *vRND = sact.waitkey; + } + + sact.waittype = KEYWAIT_NONE; + + DEBUG_COMMAND_YET("SACT.WaitKeySimpleTimeOut %p,%p,%d:\n", vRND, vD03, wTime); +} + +/** + * SACT.WaiKeySpriteTimeOut (1.0~) + * タイムアウトつきスプライトキーウェイト + * @param vOK: 0 の時右クリック + * @param vRND: スイッチスプライトの番号 + * @param vD01: ゲットスプライトの番号 + * @param vD02: プットスプライトの番号 + * @param vD03: タイムアウトした場合=1, しない場合=0 + * @param wTime: タイムアウト時間 (1/100sec) + */ +void WaitKeySpriteTimeOut() { + int *vOK = getCaliVariable(); + int *vRND = getCaliVariable(); + int *vD01 = getCaliVariable(); + int *vD02 = getCaliVariable(); + int *vD03 = getCaliVariable(); + int wTime = getCaliValue(); + + sp_keywait(vOK, vRND, vD01, vD02, vD03, wTime); + + DEBUG_COMMAND_YET("SACT.WaitKeySpriteTimeOut %p,%p,%p,%p,%p,%d:\n", vOK, vRND, vD01, vD02, vD03, wTime); +} + +/** + * SACT.QueryMessageSkip (1.0~) + * ?????? + * @param vSkip: + */ +void QueryMessageSkip() { + int *vSkip = getCaliVariable(); + + *vSkip = get_skipMode() ? 1 : 0; + + DEBUG_COMMAND_YET("SACT.QueryMessageSkip %p:\n", vSkip); +} + +/** + * SACT.RegistReplaceString (1.0~) + * メッセージ中の文字列の置き換え + * @param sstr: 変換元文字列番号 + * @param dstr: 変換先文字列番号 + */ +void RegistReplaceString() { + int sstr = getCaliValue(); + int dstr = getCaliValue(); + + sstr_regist_replace(sstr, dstr); + + DEBUG_COMMAND_YET("SACT.RegistReplaceString %d,%d:\n", sstr, dstr); +} + +/** + * SACT.MessageOutput (1.0~) + * @param wMessageSpriteNumber: メッセージを表示するメッセージスプライト番号 + * (~MES) + * @param wMessageSize: フォントの大きさ (~MES_SIZE|~MES_SET) + * @param wMessageColorR: メッセージの色(Red) (~MES_SET|~MES_COLOR) + * @param wMessageColorG: メッセージの色(Green) (~MES_SET|~MES_COLOR) + * @param wMessageColorB: メッセージの色(Blue) (~MES_SET|~MES_COLOR) + * @param wMessageFont: メッセージのフォント(0:ゴシック, 1:明朝) + * (~MES_FONT) + * @param wMessageSpeed: メッセージの表示速度(0:ウェイト無し, 1:速い, + * 2:中くらい, 3: 遅い) (~MES_SPEED) (msec) + * @param wMessageLineSpace: 行間スペース (~MES_SPC_Y) + * @param wMessageAlign: 行そろえ (1.1~) + * @param vMessageLength: ??? (1.2~) + */ +void MessageOutput() { + int wMessageSpriteNumber = getCaliValue(); + int wMessageSize = getCaliValue(); + int wMessageColorR = getCaliValue(); + int wMessageColorG = getCaliValue(); + int wMessageColorB = getCaliValue(); + int wMessageFont = getCaliValue(); + int wMessageSpeed = getCaliValue(); + int wMessageLineSpace = getCaliValue(); + int wMessageAlign = 0; + int *vMessageLength = NULL; + + if (sact.version >= 110) { + wMessageAlign = getCaliValue(); + } + if (sact.version >= 120) { + vMessageLength = getCaliVariable(); + } + + smsg_out(wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace, wMessageAlign, 0, 0, 0, vMessageLength); + + DEBUG_COMMAND_YET("SACT.MessageOutput %d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace, wMessageAlign, vMessageLength); +} + +/** + * SACT.MessageOutputEx (1.1~) + * ルビつきメッセージ出力 + * @param wMessageSpriteNumber: メッセージを表示するメッセージスプライト番号 + * (~MES) + * @param wMessageSize: フォントの大きさ (~MES_SIZE|~MES_SET) + * @param wMessageColorR: メッセージの色(Red) (~MES_SET|~MES_COLOR) + * @param wMessageColorG: メッセージの色(Green) (~MES_SET|~MES_COLOR) + * @param wMessageColorB: メッセージの色(Blue) (~MES_SET|~MES_COLOR) + * @param wMessageFont: メッセージのフォント(0:ゴシック, 1:明朝) + * (~MES_FONT) + * @param wMessageSpeed: メッセージの表示速度(0:ウェイト無し, 1:速い, + * 2:中くらい, 3: 遅い) (~MES_SPEED) + * @param wMessageLineSpace: 行間スペース (~MES_SPC_Y) + * @param wMessageAlign: 行そろえ + * @param wRubySize: ルビ文字の大きさ + * @param wRubyFont: ルビ文字のフォントの種類((0:ゴシック, 1:明朝) + * @param wRubyLineSpace: ルビ文字とメッセージの行間スペース + * @param vLength: ??? (1.2~) + */ +void MessageOutputEx() { + int wMessageSpriteNumber = getCaliValue(); + int wMessageSize = getCaliValue(); + int wMessageColorR = getCaliValue(); + int wMessageColorG = getCaliValue(); + int wMessageColorB = getCaliValue(); + int wMessageFont = getCaliValue(); + int wMessageSpeed = getCaliValue(); + int wMessageLineSpace = getCaliValue(); + int wMessageAlign = getCaliValue(); + int wRubySize = getCaliValue(); + int wRubyFont = getCaliValue(); + int wRubyLineSpace = getCaliValue(); + int *vLength = NULL; + + if (sact.version >= 120) { + vLength = getCaliVariable(); + } + + smsg_out(wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace, wMessageAlign, wRubySize, wRubyFont, wRubyLineSpace, vLength); + + DEBUG_COMMAND_YET("SACT.MessageOutputEx %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace,wMessageAlign, wRubySize, wRubyFont, wRubyLineSpace, vLength); +} + +/** + * SACT.MessageNewLine (1.0~) + * 改行(Rコマンド相当) (~MES_NEW_LINE) + * @param wMessageSpriteNumber: メッセージスプライト番号 + * @param wMessageSize: フォントの大きさ (~MES_SIZE|~MES_SET) + */ +void MessageNewLine() { + int wMessageSpriteNumber = getCaliValue(); + int wMessageSize = getCaliValue(); + + smsg_newline(wMessageSpriteNumber, wMessageSize); + + DEBUG_COMMAND_YET("SACT.MessageNewLine %d,%d:\n", wMessageSpriteNumber, wMessageSize); +} + +/** + * SACT.MessageClear (1.0~) + * メッセージ領域の消去(Aコマンド相当) + * @param wMessageSpriteNumber: メッセージスプライト番号 + */ +void MessageClear() { + int wMessageSpriteNumber = getCaliValue(); + + smsg_clear(wMessageSpriteNumber); + + DEBUG_COMMAND_YET("SACT.MessageClear %d:\n", wMessageSpriteNumber); +} + +/** + * SACT.MessageIsEmpty (1.0~) + * メッセージが残っている場合 wResult に 0 を返す? + * @param wResult: 結果を返す変数 + */ +void MessageIsEmpty() { + int *wResult = getCaliVariable(); + + *wResult = smsg_is_empty(); + + DEBUG_COMMAND_YET("SACT.MessageIsEmpty %p:\n", wResult); +} + +/** + * SACT.MessagePeek (1.2+~) (妻みぐい2にはない) + * メッセージバッファの内容を取得する + * @param vCount: 取得した行数 + * @param nTopStringNum: バッファを取得する文字列変数の最初 + */ +void MessagePeek() { + int *vCount = getCaliVariable(); + int nTopStringNum = getCaliValue(); + + WARNING("NOT IMPLEMENTED\n"); + + DEBUG_COMMAND_YET("SACT.MessagePeek %p,%d:\n", vCount, nTopStringNum); +} + +/** + * SACT.Log_Stop (1.2~) + * ログ採取停止 + */ +void Log_Stop() { + sact.logging = FALSE; + DEBUG_COMMAND_YET("SACT.Log_Stop:\n"); +} + +/** + * SACT.Log_Start (1.2~) + * ログ採取開始 + */ +void Log_Start() { + sact.logging = TRUE; + DEBUG_COMMAND_YET("SACT.Log_Start:\n"); +} + +/** + * SACT.MenuClear (1.0~) + * SACT内部の選択肢情報をクリア + */ +void MenuClear() { + ssel_clear(); + + DEBUG_COMMAND_YET("SACT.MenuClear:\n"); +} + +/** + * SACT.MenuAdd (1.0~) + * 登録文字列をSACT内部選択肢情報に追加 + * @param nString: 登録する文字列変数番号 + * @param wI: 登録する位置 (1-) + */ +void MenuAdd() { + int nString = getCaliValue(); + int wI = getCaliValue(); + + ssel_add(nString, wI); + + DEBUG_COMMAND_YET("SACT.MenuAdd %d,%d:\n", nString, wI); +} + +/** + * SACT.MenuOpen (1.0~) + * SACT内部選択ループ + * @param wMenuResult: 選択結果(番号) キャンセルしたら0 + * @param wNum: 枠,背景とするスプライト番号 (~SP_SEL) + * @param wChoiceSize: 選択肢文字サイズ (~SEL_SIZE) + * @param wMenuOutSpc: 枠スプライトの外側からのピクセル数(~SP_SETSELSPC) + * @param wChoiceLineSpace: 選択肢の行間(1に固定?) + * @param wChoiceAutoMoveCursor: オープン時に自動的に移動する選択肢の番号 + * @param nAlign: 行そろえ (0:左, 1:中央, 2: 右) (1.1~) + */ +void MenuOpen() { + int *wMenuResult = getCaliVariable(); + int wNum = getCaliValue(); + int wChoiceSize = getCaliValue(); + int wMenuOutSpc = getCaliValue(); + int wChoiceLineSpace = getCaliValue(); + int wChoiceAutoMoveCursor = getCaliValue(); + int nAlign = 0; + + if (sact.version >= 110) { + nAlign = getCaliValue(); + } + + *wMenuResult = ssel_select(wNum, wChoiceSize, wMenuOutSpc, wChoiceLineSpace, wChoiceAutoMoveCursor, nAlign); + + DEBUG_COMMAND_YET("SACT.MenuOpen %p,%d,%d,%d,%d,%d,%d:\n", wMenuResult, wNum, wChoiceSize, wMenuOutSpc, wChoiceLineSpace, wChoiceAutoMoveCursor, nAlign); +} + +/** + * SACT.PushString (1.0~) + * SACT内部に文字列変数をプッシュ + * @param nString: 文字列変数番号 + */ +void PushString() { + int nString = getCaliValue(); + + sstr_push(nString); + + DEBUG_COMMAND_YET("SACT.PushString %d:\n", nString); +} + +/** + * SACT.PopString (1.0~) + * SACT内部にプッシュした文字列変数をポップ + * @param nString: 文字列変数番号 + */ +void PopString() { + int nString = getCaliValue(); + + sstr_pop(nString); + + DEBUG_COMMAND_YET("SACT.PopString %d:\n", nString); +} + +/** + * SACT.Numeral_XXXX + * スプライト毎に、指定の数字(0〜9)に対して対応するCG番号や + * 表示位置、間隔などを格納・取り出しを行う + */ + +/** + * SACT.Numeral_SetCG (1.0~) + * 指定の数値に対するCG番号の設定 + * @param nNum: スプライト番号 + * @param nIndex: 数字(0-9) + * @param nCG: 数字に対応するCG番号 + */ +void Numeral_SetCG() { + int nNum = getCaliValue(); + int nIndex = getCaliValue(); + int nCG = getCaliValue(); + + sp_num_setcg(nNum, nIndex, nCG); + + DEBUG_COMMAND_YET("SACT.Numeral_SetCG %d,%d,%d:\n", nNum, nIndex, nCG); +} + +/** + * SACT.Numeral_GetCG (1.0~) + * 指定の数値に対するCG番号の設定 + * @param nNum: スプライト番号 + * @param nIndex: 数字(0-9) + * @param vCG: 設定されているCG番号を返す変数 + */ +void Numeral_GetCG() { + int nNum = getCaliValue(); + int nIndex = getCaliValue(); + int *vCG = getCaliVariable(); + + sp_num_getcg(nNum, nIndex, vCG); + + DEBUG_COMMAND_YET("SACT.Numeral_GetCG %d,%d,%p:\n", nNum, nIndex, vCG); +} + +/** + * SACT.Numeral_SetPos (1.0~) + * Numeralの表示位置の設定 + * @param nNum: スプライト番号 + * @param nX: 表示X座標 + * @param ny: 表示Y座標 + */ +void Numeral_SetPos() { + int nNum = getCaliValue(); + int nX = getCaliValue(); + int nY = getCaliValue(); + + sp_num_setpos(nNum, nX, nY); + + DEBUG_COMMAND_YET("SACT.Numeral_SetPos %d,%d,%d:\n", nNum, nX, nY); +} + +/** + * SACT.Numeral_GetPos (1.0~) + * Numeral_SetPosで設定した座標の取り出し + * @param nNum: スプライト番号 + * @param vX: X座標を格納する変数 + * @param vY: Y座標を格納する変数 + */ +void Numeral_GetPos() { + int nNum = getCaliValue(); + int *vX = getCaliVariable(); + int *vY = getCaliVariable(); + + sp_num_getpos(nNum, vX, vY); + + DEBUG_COMMAND_YET("SACT.Numeral_GetPos %d,%p,%p:\n", nNum, vX, vY); +} + +/** + * SACT.Numeral_SetSpan (1.0~) + * Numeralの間隔(Span)の設定 + * @param nNum: スプライト番号 + * @param nSpan: 間隔 + */ +void Numeral_SetSpan() { + int nNum = getCaliValue(); + int nSpan = getCaliValue(); + + sp_num_setspan(nNum, nSpan); + + DEBUG_COMMAND_YET("SACT.Numeral_SetSpan %d,%d:\n", nNum, nSpan); +} + +/** + * SACT.Numeral_GetSpan (1.0~) + * Numeral_SetSpanで設定した値の取り出し + * @param nNum: スプライト番号 + * @param vSpan: 値を格納する変数 + */ +void Numeral_GetSpan() { + int nNum = getCaliValue(); + int *vSpan = getCaliVariable(); + + sp_num_getspan(nNum, vSpan); + + DEBUG_COMMAND_YET("SACT.Numeral_GetSpan %d,%p:\n", nNum, vSpan); +} + +/** + * SACT.ExpSp_Clear (1.0~) + * 説明スプライト設定クリア + */ +void ExpSp_Clear() { + DEBUG_COMMAND_YET("SACT.ExpSp_Clear:\n"); + + sp_exp_clear(); +} + +/** + * SACT.ExpSp_Add (1.0~) + * 説明スプライト設定追加 + * @param wNumSP1: スイッチスプライト + * @param wNumSP2: 説明スプライト + */ +void ExpSp_Add() { + int wNumSP1 = getCaliValue(); + int wNumSP2 = getCaliValue(); + + sp_exp_add(wNumSP1, wNumSP2); + + DEBUG_COMMAND_YET("SACT.ExpSp_Add %d,%d:\n", wNumSP1, wNumSP2); +} + +/** + * SACT.ExpSp_Del (1.0~) + * 説明スプライト削除 + * @param wNum: スプライト番号 + */ +void ExpSp_Del() { + int wNum = getCaliValue(); + + sp_exp_del(wNum); + + DEBUG_COMMAND_YET("SACT.ExpSp_Del %d:\n", wNum); +} + +/** + * SACT.TimerSet (1.0~) + * 指定のIDのタイマーをwCount値でリセット + * @param wTimerID: タイマーID + * @param wCount: リセットする値 + */ +void TimerSet() { + int wTimerID = getCaliValue(); + int wCount = getCaliValue(); + + stimer_reset(wTimerID, wCount); + + DEBUG_COMMAND("SACT.TimerSet %d,%d:\n", wTimerID, wCount); +} + +/** + * SACT.TimerGet (1.0~) + * 指定のIDのタイマーをRNDに取得 + * @param wTimerID: タイマーID + * @param vRND: 取得する変数 + */ +void TimerGet() { + int wTimerID = getCaliValue(); + int *vRND = getCaliVariable(); + + *vRND = stimer_get(wTimerID); + + DEBUG_COMMAND("SACT.TimerGet %d,%p:\n", wTimerID, vRND); +} + +/** + * SACT.TimerWait (1.0~) + * 指定IDのタイマーが指定カウントになるまで待つ + * @param wTimerID: タイマーID + * @param wCount: 指定カウント + */ +void TimerWait() { + int wTimerID = getCaliValue(); + int wCount = getCaliValue(); + + while(wCount > stimer_get(wTimerID)) { + sys_keywait(10, FALSE); + } + + DEBUG_COMMAND("SACT.TimerWait %d,%d:\n", wTimerID, wCount); +} + +/** + * SACT.Wait (1.1~) + * 指定時間、すべての動作を停止 + * @param nCount: 時間(1/100秒単位) + */ +void Wait() { + int wCount = getCaliValue(); + + sys_keywait(wCount*10, FALSE); + + DEBUG_COMMAND_YET("SACT.Wait %d:\n", wCount); +} + +/** + * SACT.SoundPlay (1.0~) + * サウンド直接再生 (~SOUND_PLAY) + * @param wNum: 再生する番号 + */ +void SoundPlay() { + int wNum = getCaliValue(); + + ssnd_play(wNum); + + DEBUG_COMMAND_YET("SACT.SoundPlay %d:\n", wNum); +} + +/** + * SACT.SoundStop (1.0~) + * サウンド再生停止 (~SOUND_STOP) + * @param wNum: 停止する番号 + * @param wFadeTime: 停止するまでの時間 (1/100sec) + */ +void SoundStop() { + int wNum = getCaliValue(); + int wFadeTime = getCaliValue(); + + ssnd_stop(wNum, wFadeTime); + + DEBUG_COMMAND_YET("SACT.SoundStop %d,%d:\n", wNum, wFadeTime); +} + +/** + * SACT.SoundStopAll (1.1~) + * サウンド再生停止 (~SOUND_STOP) + * @param wNum: 停止する番号 + * @param wFadeTime: 停止するまでの時間 (1/100sec) + */ +void SoundStopAll() { + int wFadeTime = getCaliValue(); + + ssnd_stopall(wFadeTime); + + DEBUG_COMMAND_YET("SACT.SoundStopAll %d:\n", wFadeTime); +} + +/** + * SACT.SoundWait (1.0~) + * ヘッダで指定された時間or再生終了まで待つ (~SOUND_WAIT) + * @param wNum: 指定番号 + */ +void SoundWait() { + int wNum = getCaliValue(); + + ssnd_wait(wNum); + + DEBUG_COMMAND_YET("SACT.SoundWait %d:\n", wNum); +} + +/** + * SACT.SoundWaitKey (1.0~) + * 指定されたサウンドが再生終了するか、キーが押されるまで待つ + * @param wNum: 指定番号 + * @param vKey: キャンセルキー + */ +void SoundWaitKey() { + int wNum = getCaliValue(); + int *vKey = getCaliVariable(); + + ssnd_waitkey(wNum, vKey); + + DEBUG_COMMAND_YET("SACT.SoundWaitKey %d,%p:\n", wNum, vKey); +} + +/** + * SACT.SoundPrepare (1.0~) + * 再生の準備をする(~SOUND_PREPARE) + * @param wNum: 再生する番号 + */ +void SoundPrepare() { + int wNum = getCaliValue(); + + ssnd_prepare(wNum); + + DEBUG_COMMAND_YET("SACT.SoundPrepare %d:\n", wNum); +} + +/** + * SACT.SoundPrepareLR (1.0~) + * 再生の準備をする(左右反転) (~SOUND_PREPARE_LR) + * @param wNum: 再生する番号 + */ +void SoundPrepareLR() { + int wNum = getCaliValue(); + + ssnd_prepareLRrev(wNum); + + DEBUG_COMMAND_YET("SACT.SoundPrepareLR %d:\n", wNum); +} + +/** + * SACT.SoundPlayLR (1.0~) + * 左右反転して再生 (~SOUND_PLAY_LR) + * @param wNum: 再生する番号 + */ +void SoundPlayLR() { + int wNum = getCaliValue(); + + ssnd_playLRrev(wNum); + + DEBUG_COMMAND_YET("SACT.SoundPlayLR %d:\n", wNum); +} + +/** + * SACT.SpriteSound (1.0~) + * サウンド(スプライト指定) (~SP_SOUND) + * @param wNumSP: 設定するスプライト番号 + * @param nCount: 設定する個数 + * @param wNumWave1: Sound1 + * @param wNumWave2: Sound2 + * @param wNumWave3: Sound3 + */ +void SpriteSound() { + int wNumSP = getCaliValue(); + int nCount = getCaliValue(); + int wNumWave1 = getCaliValue(); + int wNumWave2 = getCaliValue(); + int wNumWave3 = getCaliValue(); + int i; + + for (i = wNumSP; i < (wNumSP + nCount); i++) { + sp_sound_set(i, wNumWave1, wNumWave2, wNumWave3); + } + + DEBUG_COMMAND_YET("SACT.SpriteSound %d,%d,%d,%d,%d:\n", wNumSP, nCount, wNumWave1, wNumWave2, wNumWave3); +} + +/** + * SACT.SpriteSoundWait (1.0~) + * SpriteSoundで設定したすべての音の再生終了まで待つ (~SP_SOUND_WAIT) + */ +void SpriteSoundWait() { + DEBUG_COMMAND_YET("SACT.SpriteSoundWait:\n"); + + sp_sound_wait(); +} + +/** + * SACT.SpriteSoundOB (1.0~) + * 範囲外をクリックしたときの音 (~SPRITE_SOUND_OB) + * @param wNumWave: 再生する番号、0でクリア + */ +void SpriteSoundOB() { + int wNumWave = getCaliValue(); + + sp_sound_ob(wNumWave); + + DEBUG_COMMAND_YET("SACT.SpriteSoundOB %d:\n", wNumWave); +} + +/** + * SACT.MusicCheck (1.0~) + * 音楽データがあるかどうか (~MUSIC_CHECK) + * @param wNum: 番号 + * @param vRND: 0:ない、1:ある + */ +void MusicCheck() { + int wNum = getCaliValue(); + int *vRND = getCaliVariable(); + + *vRND = smus_check(wNum); + + DEBUG_COMMAND_YET("SACT.MusicCheck %d,%p:\n", wNum, vRND); +} + +/** + * SACT.MusicGetLength (1.0~) + * 音楽データの長さを1/100秒単位で取得 (~MUSIC_GET_LENGTH) + * @param wNum: 音楽番号 + * @param vRND: 取得した長さを格納する変数 + */ +void MusicGetLength() { + int wNum = getCaliValue(); + int *vRND = getCaliVariable(); + + *vRND = smus_getlength(wNum); + + DEBUG_COMMAND_YET("SACT.MusicGetLength %d,%d:\n", wNum, *vRND); +} + +/** + * SACT.MusicGetPos (1.0~) + * 音楽データの再生位置を1/100秒単位で取得 (~MUSIC_GET_POS) + * @param wNum: 音楽番号 + * @param vRND: 取得した位置を格納する変数 + */ +void MusicGetPos() { + int wNum = getCaliValue(); + int *vRND = getCaliVariable(); + + *vRND = smus_getpos(wNum); + + DEBUG_COMMAND_YET("SACT.MusicGetPos %d,%d:\n", wNum, *vRND); +} + +/** + * SACT.MusicPlay (1.0~) + * 再生 (~MUSIC_PLAY) + * @param wNum: 音楽番号 + * @param wFadeTime: フェードイン時間(1/100秒) + * @param wVolume: 音量(0-100) + */ +void MusicPlay() { + int wNum = getCaliValue(); + int wFadeTime = getCaliValue(); + int wVolume = getCaliValue(); + + smus_play(wNum, wFadeTime, wVolume); + + DEBUG_COMMAND_YET("SACT.MusicPlay %d,%d,%d:\n", wNum, wFadeTime, wVolume); +} + +/** + * SACT.MusicStop (1.0~) + * 音楽停止 (~MUSIC_STOP) + * @param wNum: 音楽番号 + * @param wFadeTime: 終了するまでの時間(1/100秒) + */ +void MusicStop() { + int wNum = getCaliValue(); + int wFadeTime = getCaliValue(); + + smus_stop(wNum, wFadeTime); + + DEBUG_COMMAND_YET("SACT.MusicStop %d,%d:\n", wNum, wFadeTime); +} + +/** + * SACT.MusicStopAll (1.2~) + * すべての音楽を停止 + * @param wFadeTime: 終了するまでの時間(1/100秒) + */ +void MusicStopAll() { + int wFadeTime = getCaliValue(); + + smus_stopall(wFadeTime); + + DEBUG_COMMAND_YET("SACT.MusicStopAll %d:\n", wFadeTime); +} + +/** + * SACT.MusicFade (1.0~) + * 指定のボリュームまでフェード (~MUSIC_FADE) + * @param wNum: 音楽番号 + * @param wFadeTime: フェード時間(1/100秒) + * @param wVolume: 音量 (1-100) + */ +void MusicFade() { + int wNum = getCaliValue(); + int wFadeTime = getCaliValue(); + int wVolume = getCaliValue(); + + smus_fade(wNum, wFadeTime, wVolume); + + DEBUG_COMMAND_YET("SACT.MusicFade %d,%d,%d:\n", wNum, wFadeTime, wVolume); +} + +/** + * SACT.MusicWait (1.0~) + * 再生が終了するまで待つ (~MUSIC_WAIT) + * @param wNum: 音楽番号 + * @param nTimeOut: (1.1~) + */ +void MusicWait() { + int wNum = getCaliValue(); + int nTimeOut = 0; + + if (sact.version >= 110) { + nTimeOut = getCaliValue(); + } + + smus_wait(wNum, nTimeOut); + + DEBUG_COMMAND_YET("SACT.MusicWait %d,%d:\n", wNum, nTimeOut); +} + +/** + * SACT.MusicWatiPos (1.0~) + * 指定の音楽がwIndex番のマークで指定された再生位置に来るまで待つ + * (~MUSIC_WAIT_POS) + * @param wNum: 音楽番号 + * @param wIndex: 位置マーク番号 + */ +void MusicWaitPos() { + int wNum = getCaliValue(); + int wIndex = getCaliValue(); + + smus_waitpos(wNum, wIndex); + + DEBUG_COMMAND_YET("SACT.MusicWaitPos %d,%d:\n", wNum, wIndex); +} + +/** + * SACT.SoundGetLinkNum (1.0~) + * 指定チャンネルのリンク番号を取得 (~SOUND_GET_LINK_NUM) + * @param wNum: チャンネル番号 + * @param vRND: リンク番号(未使用=0) + */ +void SoundGetLinkNum() { + int wNum = getCaliValue(); + int *vRND = getCaliVariable(); + + *vRND = ssnd_getlinknum(wNum); + + DEBUG_COMMAND_YET("SACT.SoundGetLinkNum %d,%p:\n", wNum, vRND); +} + +/** + * SACT.ChartPos (1.0~) + * グラフ用チャート作成 + * @param pos : 結果出力変数 + * @param pos1: 最小値 + * @param pos2: 最大値 + * @param val1: 分率最小値 + * @param val2: 分率最大値 + * @param val : 分率 + * + * pos = ((pos2-pos1) / (val2-val1)) * (val-val1) + pos1 + */ +void ChartPos() { + int *pos = getCaliVariable(); + int pos1 = getCaliValue(); + int pos2 = getCaliValue(); + int val1 = getCaliValue(); + int val2 = getCaliValue(); + int val = getCaliValue(); + + schart_pos(pos, pos1, pos2, val1, val2, val); + + DEBUG_COMMAND_YET("SACT.ChartPos %p,%d,%d,%d,%d,%d:\n", pos, pos1, pos2, val1, val2, val); +} + +/** + * SACT.NumToStr (1.0~) + * 数値 -> 文字列変換 + * @param strno: 変換済み文字列変数番号 + * @param fig: けた数 + * @param zeropad: 0: ゼロ埋めしない, 1: ゼロ埋めする + * @param num: 変換する数値 + */ +void NumToStr() { + int strno = getCaliValue(); + int fig = getCaliValue(); + int zeropad = getCaliValue(); + int num = getCaliValue(); + + sstr_num2str(strno, fig, zeropad, num); + + DEBUG_COMMAND_YET("SACT.NumToStr %d,%d,%d,%d:\n", strno, fig, zeropad, num); +} + +/** + * SACT.Maze_Create (1.0~) + */ +void Maze_Create() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + WARNING("NOT IMPLEMENTED\n"); + + DEBUG_COMMAND_YET("SACT.Maze_Create %d,%d:\n", p1,p2); +} + +/** + * SACT.Maze_Get (1.0~) + */ +void Maze_Get() { + int *p1 = getCaliVariable(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + + WARNING("NOT IMPLEMENTED\n"); + + DEBUG_COMMAND_YET("SACT.Maze_Get %p,%d,%d:\n", p1,p2,p3); +} + +/** + * SACT.EncryptWORD (1.0~) + */ +void EncryptWORD() { + int *array = getCaliVariable(); + int num = getCaliValue(); + int key = getCaliValue(); + + scryp_encrypt_word(array, num, key); + + DEBUG_COMMAND_YET("SACT.EncryptWORD %p,%d,%d:\n", array, num, key); +} + +/** + * SACT.DecryptWORD (1.0~) + */ +void DecryptWORD() { + int *array = getCaliVariable(); + int num = getCaliValue(); + int key = getCaliValue(); + + scryp_encrypt_word(array, num, key); + + DEBUG_COMMAND_YET("SACT.DecryptWORD %p,%d,%d:\n", array, num, key); +} + +/** + * SACT.EncryptString (1.0~) + */ +void EncryptString() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + scryp_encrypt_str(p1, p2); + + DEBUG_COMMAND_YET("SACT.EncryptString %d,%d:\n", p1,p2); +} + +/** + * SACT.DecryptString (1.0~) + */ +void DecryptString() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + scryp_decrypt_str(p1, p2); + + DEBUG_COMMAND_YET("SACT.DecryptString %d,%d:\n", p1,p2); +} + +/** + * SACT.XMenuClear (1.0~) + * 拡張メニュー初期化 + */ +void XMenuClear() { + spxm_clear(); + + DEBUG_COMMAND_YET("SACT.XMenuClear:\n"); +} + +/** + * SACT.XMenuRegister (1.0~) + * 現在バッファにある文字列を拡張メニューのアイテムとして登録 + * @param nRegiNum: 拡張メニューの内部インデックス番号 + * @param nMenuID: 選択されたときに返す番号(ID) + */ +void XMenuRegister() { + int nRegiNum = getCaliValue(); + int nMenuID = getCaliValue(); + + spxm_register(nRegiNum, nMenuID); + + DEBUG_COMMAND_YET("SACT.XMenuRegister %d,%d:\n", nRegiNum, nMenuID); +} + +/** + * SACT.XMenuGetNum (1.0~) + * XMenuRegisterで登録されたIDを返す + * @param nRegiNum: 内部インデックス番号 + * @param vMenuID: 登録されているIDを格納する変数 + */ +void XMenuGetNum() { + int nRegiNum = getCaliValue(); + int *vMenuID = getCaliVariable(); + + *vMenuID = spxm_getnum(nRegiNum); + + DEBUG_COMMAND_YET("SACT.XMenuGetNum %d,%p:\n", nRegiNum, vMenuID); +} + +/** + * SACT.XMenuGetText (1.0~) + * XMenuRegisterで登録したアイテムを指定の文字列変数にコピーする + * @param nRegiNum: 内部インデックス番号 + * @param strno: コピー先文字列変数番号 + */ +void XMenuGetText() { + int nRegiNum = getCaliValue(); + int strno = getCaliValue(); + + spxm_gettext(nRegiNum, strno); + + DEBUG_COMMAND_YET("SACT.XMenuGetText %d,%d:\n", nRegiNum, strno); +} + +/** + * SACT.XMenuTitleRegister (1.0~) + * 現在バッファにある文字列を拡張メニューのタイトルとして登録 + */ +void XMenuTitleRegister() { + spxm_titlereg(); + + DEBUG_COMMAND_YET("SACT.XMenuTitleRegister:\n"); +} + +/** + * SACT.XMenuTitleGet (1.0~) + * 拡張メニューのタイトルを指定の文字列変数にコピー + * @param strno: コピー先文字列変数番号 + */ +void XMenuTitleGet() { + int strno = getCaliValue(); + + spxm_titleget(strno); + + DEBUG_COMMAND_YET("SACT.XMenuTitleGet %d:\n", strno); +} diff --git a/modules/SACT/sact.h b/modules/SACT/sact.h new file mode 100644 index 0000000..1b69f47 --- /dev/null +++ b/modules/SACT/sact.h @@ -0,0 +1,310 @@ +/* + * sact.h: SACT + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sact.h,v 1.3 2003/07/14 16:22:51 chikama Exp $ */ + +#ifndef __SACT_H__ +#define __SACT_H__ + +#include "config.h" + +#include +#include "portab.h" +#include "graphics.h" +#include "surface.h" +#include "sacttimer.h" +#include "variable.h" + + +// スプライトの最大数 +#define SPRITEMAX 21845 + +// CGの最大数 +#define CGMAX 63336 + +// メッセージの最大長さ +#define MSGBUFMAX 257*10 + +// 選択肢の最大要素数 +#define SEL_ELEMENT_MAX 20 + + +// キーウェイトの種類 +#define KEYWAIT_NONE 0 +#define KEYWAIT_SIMPLE 1 +#define KEYWAIT_SPRITE 2 +#define KEYWAIT_MESSAGE 3 +#define KEYWAIT_SELECT 4 +#define KEYWAIT_BACKLOG 5 + +// 文字列置換用 +typedef struct { + char *src; // 置き換え元文字列 + char *dst; // 置き換え文字列 +} strexchange_t; + +// SACTEFAM を使ったマスク +typedef struct { + int fd; // SACTEFAM.KLD のファイルディスクプリタ + char *mapadr; // mmap された最初のアドレス + off_t size; // mmap した大きさ + int datanum; // SACTEFAM.KLD 中のマスクファイルの数 + int *no; // シナリオ側での番号 + int *offset; // データへのオフセット +} SACTEFAM_t; + + +// CG_XX で作るCGの種類 +enum cgtype { + CG_NOTUSED = 0, + CG_LINKED = 1, + CG_SET = 2, + CG_REVERSE = 3, + CG_STRETCH = 4 +}; + +// cgに関する情報 +struct _cginfo { + enum cgtype type; // CGの種類, 0: 未使用, 1:リンクされている, ... + int no; // CGの番号 + surface_t *sf; // CG本体 + int refcnt; // 参照カウンタ。0になったら開放してもよい。 +}; +typedef struct _cginfo cginfo_t; + +// スプライトのタイプ +enum spritetype { + SPRITE_NORMAL = 0, + SPRITE_SWITCH = 1, + SPRITE_GETA = 2, + SPRITE_GETB = 3, + SPRITE_PUT = 4, + SPRITE_ANIME = 5, + SPRITE_SWPUT = 6, + SPRITE_MSG =100, + SPRITE_WP, + SPRITE_NONE =-1 +}; + +// (前方参照用) +struct _sprite; + +// スプライトに関する各種情報 +struct _sprite { + // スプライトのタイプ + enum spritetype type; + + // スプライト番号 + int no; + + // それぞれの状態の時に鳴らすサウンド番号 + int numsound1, numsound2, numsound3; + + // 初期 sprite の大きさ(cg1の大きさ) + MyDimension cursize; + + // それぞれの状態で表示する CG + cginfo_t *cg1, *cg2, *cg3; + + // update するときに表示するcg + cginfo_t *curcg; + + // スプライトを表示するか + boolean show; + boolean show_save; // Zkey hide save用 + + // 表示する際のブレンド率 0:全く見えない, 255: 通常表示 + int blendrate; + + // スプライトが Freeze されているか(0:No 1-3: その番号) + int freezed_state; + + // 表示位置 (SetPos) + MyPoint loc; + + // 現在のスプライトの表示位置 + MyPoint cur; + + // event callback + int (* eventcb)(struct _sprite *sp, agsevent_t *e); // for key/mouse + int (* teventcb)(struct _sprite *sp, agsevent_t *e); // for timer + // sprite削除時の callback + void (* remove)(struct _sprite *sp); + // spriteを再描画するときの callback + int (* update)(struct _sprite *sp); + + boolean focused; // forcusを得ているか + boolean pressed; // このsprite上でマウスが押されているか + + GSList *expsp; // 説明スプライトのリスト + + // move command 用パラメータ + struct { + MyPoint to; // 移動先 + int time; // 移動完了時間 + int speed; // 移動速度 + int starttime; // 移動開始時刻 + int endtime; // 移動終了予定時刻 + boolean moving; // 移動中かどうか + } move; + + // SACT.Numeral用パラメータ + struct { + int cg[10]; + MyPoint pos; + int span; + } numeral; + + // スプライトの種類毎の情報 + union { + // スイッチスプライト + struct { + + } sw; + + // ゲットスプライト + struct { + boolean dragging; // ドラッグ中 + MyPoint dragstart; // ドラッグ開始位置 + } get; + + // プットスプライト + struct { + + } put; + + // アニメーションスプライト + struct { + int interval; // 1コマの間隔(10msec) + int starttime; // 開始時刻 + int npat; // アニメコマ数(1/2/3) + unsigned int tick; // カウンタ + } anime; + + // メッセージスプライト + struct { + GSList *buf; // 表示する文字のリスト + surface_t *canvas; // 文字を描画するsurface + MyPoint dspcur; // 現在の表示位置 + } msg; + } u; +}; +typedef struct _sprite sprite_t; + +// SACT全体の情報 +struct _sact { + // SACTのバージョン + int version; + + // スプライト全体 + sprite_t *sp[SPRITEMAX]; + + GSList *sp_zhide; // Zキーで消すスプライトのリスト + GSList *sp_quake; // Quakeで揺らすスプライトのリスト + + GSList *updatelist; // 再描画するスプライトのリスト + + cginfo_t *cg[CGMAX]; // cgまたはCG_xxで作った CG + + // 座標系の原点 + MyPoint origin; + + // 文字列 push/pop/replce 用 + GSList *strstack; + GSList *strreplace; + char *strreplacesrc; + char *strreplacedst; + + // メッセージスプライト用メッセージバッファ + char msgbuf[MSGBUFMAX]; + char msgbuf2[MSGBUFMAX]; + + // 選択ウィンド + struct { + char *elem[SEL_ELEMENT_MAX]; // 選択肢文字列 + int spno; // 背景スプライト番号 + int font_size; // 選択肢文字サイズ + int font_type; // 選択肢フォント + int frame_dot; // 枠スプライトの外側からのピクセル数 + int linespace; // 選択肢の行間 + int movecursor; // 初期選択 + int align; // 行そろえ + void (* cbmove)(agsevent_t *); + void (* cbrelease)(agsevent_t *); + surface_t *charcanvas; + } sel; + + // event listener + GSList *eventlisteners; + GSList *teventlisteners; + GSList *teventremovelist; + + // MOVEするスプライトのリスト + GSList *movelist; + int movestarttime; // 一斉に移動を開始するための開始時間 + int movecurtime; + + MyRectangle updaterect; // 更新が必要なspriteの領域の和 + + // sact timer + stimer_t timer[65536]; + + // DnDに関するもの + sprite_t *draggedsp; // drag中のスプライト + boolean dropped; // スプライトがドロップされたかどうか + + // keywaitの種類 + int waittype; + int waitkey; + int sp_result_sw; + int sp_result_get; + int sp_result_put; + + // wait skip level + // 0 通常キー待ち + // 1 既読のみスキップ + // 2 未読もスキップ + int waitskiplv; + + // 範囲外をクリックしたときの音 + int numsoundob; + + // depth map + surface_t *dmap; + + // SACTEFAM.KLD + SACTEFAM_t am; + + boolean zhiding; // Zkeyによる隠し中 + int zofftime; + boolean zdooff; + + // バックログ + boolean logging; + GList *log; +}; +typedef struct _sact sact_t; + +// shortcut +#define sact sactprv +extern sact_t sact; + +#endif /* __SACT_H__ */ diff --git a/modules/SACT/sactamask.c b/modules/SACT/sactamask.c new file mode 100644 index 0000000..821dc2e --- /dev/null +++ b/modules/SACT/sactamask.c @@ -0,0 +1,180 @@ +/* + * sactamask.c: SACTEFAM.KLD 展開 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactamask.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "LittleEndian.h" +#include "imput.h" +#include "sact.h" +#include "surface.h" +#include "ngraph.h" +#include "sprite.h" +#include "counter.h" + +static surface_t *smask_get(int no); +static surface_t *smask_mul(surface_t *sf, int val); + + + +struct ecopyparam { + int sttime; + int curtime; + int edtime; + int curstep; + int oldstep; +}; +typedef struct ecopyparam ecopyparam_t; +static ecopyparam_t ecp; + +// SACTEFAM.KLD の読み込み +int smask_init(char *path) { + struct stat sbuf; + int i, fd; + char *adr; + SACTEFAM_t *am; + + if (0 > (fd = open(path, O_RDONLY))) { + WARNING("open: %s\n", strerror(errno)); + return NG; + } + + if (0 > fstat(fd, &sbuf)) { + WARNING("fstat: %s\n", strerror(errno)); + close(fd); + return NG; + } + + if (MAP_FAILED == (adr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, fd, 0))) { + WARNING("mmap: %s\n", strerror(errno)); + close(fd); + return NG; + } + + am = &sact.am; + am->mapadr = adr; + am->size = sbuf.st_size; + am->fd = fd; + + am->datanum = LittleEndian_getDW(adr, 0); + am->no = g_new(int, am->datanum); + am->offset = g_new(int, am->datanum); + + for (i = 0; i < am->datanum; i++) { + am->no[i] = LittleEndian_getDW(adr, 16 + i * 16); + am->offset[i] = LittleEndian_getDW(adr, 16 + i * 16 + 8); + } + + return OK; +} + +// 指定番号の alphamask ファイルをよみだす +static surface_t *smask_get(int no) { + int i; + SACTEFAM_t *am = &sact.am; + + for (i = 0; i < am->datanum; i++) { + if (am->no[i] == no) break; + } + + if (i == am->datanum) return NULL; + + return sf_getcg(am->mapadr + am->offset[i]); +} + +// ベースになるマスクの alpha 値を拡大して取り出す +static surface_t *smask_mul(surface_t *sf, int val) { + surface_t *out = sf_create_alpha(sf->width, sf->height); + BYTE *src = sf->alpha; + BYTE *dst = out->alpha; + int pix = sf->width * sf->height; + + while(pix--) { + int i = (*src - val) * 16; + if (i < 0) *dst = 255; // 指定値よりも大きいのはコピー + else if (i > 255) *dst = 0; // 指定値よりも小さいのは無視 + else *dst = 255-i; // それ以外は値を16倍 + src++; dst++; + } + + return out; +} + +/** + * マスクつき画面更新 + */ +int sp_eupdate_amap(int index, int time, int cancel) { + surface_t *mask, *mask2; + surface_t *sfsrc, *sfdst; + int key; + + mask = smask_get(index); + if (mask == NULL) { + sp_update_all(TRUE); + return OK; + } + + // 現在の sf0 をセーブ + sfsrc = sf_dup(sf0); + sp_update_all(FALSE); + sfdst = sf_dup(sf0); + sf_copyall(sf0, sfsrc); + + ecp.sttime = ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC); + ecp.edtime = ecp.curtime + time*10; + ecp.oldstep = 0; + + while ((ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < ecp.edtime) { + int curstep = 255 * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + // 元になるマスクのalpha値を16倍して欲しいところだけ取り出す + mask2 = smask_mul(mask, curstep); + + gre_BlendUseAMap(sf0, 0, 0, sfsrc, 0, 0, sfdst, 0, 0, sfsrc->width, sfsrc->height, mask2, 0, 0, 255); + ags_updateFull(); + + key = sys_keywait(10, cancel); + if (cancel && key) break; + + // 一時マスクを削除 + sf_free(mask2); + } + + sf_copyall(sf0, sfdst); + ags_updateFull(); + sf_free(sfsrc); + sf_free(sfdst); + + sf_free(mask); + return OK; +} diff --git a/modules/SACT/sactamask.h b/modules/SACT/sactamask.h new file mode 100644 index 0000000..6993886 --- /dev/null +++ b/modules/SACT/sactamask.h @@ -0,0 +1,29 @@ +/* + * sactamask.h: SACTEFAM.KLD 展開 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactamask.h,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#ifndef __SACTAMASK_H__ +#define __SACTAMASK_H__ + +extern int smask_init(char *path); + +#endif diff --git a/modules/SACT/sactbgm.c b/modules/SACT/sactbgm.c new file mode 100644 index 0000000..c54e909 --- /dev/null +++ b/modules/SACT/sactbgm.c @@ -0,0 +1,94 @@ +/* + * sactbgm.c: SACT Music 関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactbgm.c,v 1.4 2003/08/30 21:29:16 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "ald_manager.h" +#include "music_client.h" + +// 指定の番号の音楽が存在するかチェック +int smus_check(int no) { + dridata *dfile = ald_getdata(DRIFILE_BGM, no -1); + int st = 0; + + if (dfile == NULL) { + st = 0; + } else { + st = 1; + ald_freedata(dfile); + } + + return st; +} + +// 指定の番号の音楽の長さを取得 +int smus_getlength(int no) { + return mus_bgm_getlength(no); +} + +// 指定の番号の音楽の再生位置を取得 +int smus_getpos(int no) { + return mus_bgm_getpos(no); +} + +// 指定の番号の音楽の再生開始 +int smus_play(int no, int time, int vol) { + mus_bgm_play(no, time, vol); + return OK; +} + +// 指定の番号の音楽の再生停止 +int smus_stop(int no, int fadetime) { + mus_bgm_stop(no, fadetime); + return OK; +} + +// 指定の番号の音楽のボリュームフェード +int smus_fade(int no, int time, int vol) { + mus_bgm_fade(no, time, vol); + return OK; +} + +// 指定の番号の音楽が終了するのを待つ +int smus_wait(int no, int timeout) { + mus_bgm_wait(no, timeout); + return OK; +} + +// 指定の番号の音楽が指定の位置まで再生されるのを待つ +int smus_waitpos(int no, int index) { + mus_bgm_waitpos(no, index); + return OK; +} + +// 全ての音楽の再生を停止 +int smus_stopall(int time) { + mus_bgm_stopall(time); + return OK; +} + diff --git a/modules/SACT/sactbgm.h b/modules/SACT/sactbgm.h new file mode 100644 index 0000000..57e4727 --- /dev/null +++ b/modules/SACT/sactbgm.h @@ -0,0 +1,37 @@ +/* + * sactbgm.h: SACT Music 関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactbgm.h,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#ifndef __SACTBGM_H__ +#define __SACTBGM_H__ + +extern int smus_check(int no); +extern int smus_getlength(int no); +extern int smus_getpos(int no); +extern int smus_play(int no, int time, int vol); +extern int smus_stop(int no, int time); +extern int smus_fade(int no, int time, int vol); +extern int smus_wait(int no, int timeout); +extern int smus_waitpos(int no, int index); +extern int smus_stopall(int time); + +#endif /* __SACTBGM_H__ */ diff --git a/modules/SACT/sactcg.c b/modules/SACT/sactcg.c new file mode 100644 index 0000000..d6ab827 --- /dev/null +++ b/modules/SACT/sactcg.c @@ -0,0 +1,505 @@ +/* + * sactcg.c: CG作成 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactcg.c,v 1.7 2004/10/31 04:18:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "nact.h" +#include "system.h" +#include "ags.h" +#include "sact.h" +#include "sactcg.h" +#include "surface.h" +#include "ngraph.h" +#include "eucsjis.h" + +#include "sactcg_stretch.c" +#include "sactcg_blend.c" + +#define spcg_assert_no(no) \ + if ((no) > (CGMAX -1)) { \ + WARNING("no is too large (should be %d < %d)\n", (no), CGMAX); \ + return NG; \ + } \ + + +/* + cgの読み込み + + 指定の番号のCGをリンクファイルから読み込んだり、 + CG_xxxで作成したCGを参照する + + @param no: 読み込むCG番号 + @param refinc: 参照カウンタを増やすかどうか。 + spriteから参照されるときは増やし、CG_xxxを作る時に + 参照されるときは増やさない。 +*/ +cginfo_t *scg_loadcg_no(int no, boolean refinc) { + cginfo_t *i; + + if (no >= (CGMAX -1)) { + WARNING("no is too large (should be %d < %d)\n", (no), CGMAX); + return NULL; + } + + // すでに ロードされているか、CG_xxx で作成ずみの場合は + // 参照カウンタを増やす + if (sact.cg[no] != NULL) { + if (refinc) { + sact.cg[no]->refcnt++; + } + return sact.cg[no]; + } + + i = g_new(cginfo_t, 1); + i->type = CG_LINKED; + i->no = no; + i->refcnt = (refinc ? 1 : 0); + i->sf = sf_loadcg_no(no -1); + if (i->sf == NULL) { + WARNING("load fail (%d)\n", no -1); + g_free(i); + return NULL; + } + + sact.cg[no] = i; + + return i; +} + + +// 指定の大きさ、色の矩形の CG を作成 +int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate) { + cginfo_t *i; + + spcg_assert_no(wNumCG); + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumCG; + i->refcnt = 0; + i->sf = sf_create_surface(wWidth, wHeight, sf0->depth); + gr_fill(i->sf, 0, 0, wWidth, wHeight, wR, wG, wB); + gr_fill_alpha_map(i->sf, 0, 0, wWidth, wHeight, wBlendRate); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + sact.cg[wNumCG] = i; + + return OK; +} + +// 指定のCGを反転させたCGを作成 +int scg_create_reverse(int wNumCG, int wNumSrcCG, int wReverseX, int wReverseY) { + cginfo_t *i, *srccg; + surface_t *src; + + spcg_assert_no(wNumCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_REVERSE; + i->no = wNumCG; + i->refcnt = 0; + + src = srccg->sf; + i->sf = stretch(src, src->width, src->height, (wReverseX << 1) | wReverseY); + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + sact.cg[wNumCG] = i; + + return OK; +} + +// 指定のCGを拡大/縮小したCGを作成 +int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG) { + cginfo_t *i, *srccg; + surface_t *src; + + spcg_assert_no(wNumCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_STRETCH; + i->no = wNumCG; + i->refcnt = 0; + + src = srccg->sf; + i->sf = stretch(src, wWidth, wHeight, 0); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + sact.cg[wNumCG] = i; + + return OK; +} + +// ベースCGの上にブレンドCGを重ねた CG を作成 +int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode) { + cginfo_t *i, *basecg, *blendcg; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumBaseCG); + spcg_assert_no(wNumBlendCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + basecg = scg_loadcg_no(wNumBaseCG, FALSE); + blendcg = scg_loadcg_no(wNumBlendCG, FALSE); + if (basecg == NULL || blendcg == NULL) return NG; + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + + i->sf = blend(basecg->sf, wX , wY, blendcg->sf, wAlphaMapMode); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + sact.cg[wNumDstCG] = i; + + return OK; +} + +// 指定の文字列のCGを作成 +int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText) { + cginfo_t *i; + agsurface_t *glyph; + FONT *font; + + if (0) { + char *b = sjis2lang(v_str(wText-1)); + WARNING("str = '%s'\n", b); + free(b); + } + + spcg_assert_no(wNumCG); + + // 勝手に出ていいのかな? + if (v_strlen(wText -1) == 0) return OK; + + font = nact->ags.font; + font->sel_font(FONT_GOTHIC, wSize); + + glyph = font->get_glyph(v_str(wText -1)); + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumCG; + i->refcnt = 0; + + i->sf = sf_create_surface(glyph->width, wSize, nact->ags.dib->depth); + gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB); + gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + sact.cg[wNumCG] = i; + + return OK; +} + +// 数字文字列のCGを作成 +int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue) { + cginfo_t *i; + agsurface_t *glyph; + FONT *font; + char s[256], ss[256]; + + spcg_assert_no(wNumCG); + + if (wZeroPadding) { + char *sss = "%%0%dd"; + sprintf(ss, sss, wFigs); + } else { + char *sss = "%%%dd"; + sprintf(ss, sss, wFigs); + } + sprintf(s, ss, wValue); + + font = nact->ags.font; + font->sel_font(FONT_GOTHIC, wSize); + glyph = font->get_glyph(s); + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumCG; + i->refcnt = 0; + i->sf = sf_create_surface(glyph->width, wSize, nact->ags.dib->depth); + gr_fill(i->sf, 0, 0, glyph->width, wSize, wR, wG, wB); + gr_draw_amap(i->sf, 0, 0, glyph->pixel, glyph->width, wSize, glyph->bytes_per_line); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumCG); + + sact.cg[wNumCG] = i; + + return OK; +} + +// CGを複製 +int scg_copy(int wNumDstCG, int wNumSrcCG) { + cginfo_t *i, *srccg; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + i->sf = sf_dup(srccg->sf); + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + sact.cg[wNumDstCG] = i; + + return OK; +} + +// CGの一部を切りぬいたCGを作成 +int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) { + cginfo_t *i, *srccg; + surface_t *dst, *src; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + + src = srccg->sf; + if (src->has_alpha) { + dst = sf_create_surface(wWidth, wHeight, src->depth); + } else { + dst = sf_create_pixel(wWidth, wHeight, src->depth); + } + if (src->has_pixel) { + gr_copy(dst, 0, 0, src, wX, wY, wWidth, wHeight); + } + if (src->has_alpha) { + gr_copy_alpha_map(dst, 0, 0, src, wX, wY, wWidth, wHeight); + } + + i->sf = dst; + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + sact.cg[wNumDstCG] = i; + + return OK; +} + +// 元のCGの一部を切りぬいたCGを作成 +int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight) { + cginfo_t *i, *srccg; + surface_t *dst, *src; + + spcg_assert_no(wNumDstCG); + spcg_assert_no(wNumSrcCG); + + // 元にするCGを参照 (LINKCGなら読み込み) + if (NULL == (srccg = scg_loadcg_no(wNumSrcCG, FALSE))) { + return NG; + } + + i = g_new(cginfo_t, 1); + i->type = CG_SET; + i->no = wNumDstCG; + i->refcnt = 0; + + src = srccg->sf; + if (src->has_alpha) { + dst = sf_create_surface(src->width, src->height, src->depth); + gr_fill_alpha_map(dst, 0, 0, src->width, src->height, 255); + } else { + dst = sf_create_pixel(src->width, src->height, src->depth); + } + + if (src->has_pixel) { + gr_copy(dst, wX, wY, src, wX, wY, wWidth, wHeight); + } + if (src->has_alpha) { + gr_copy_alpha_map(dst, wX, wY, src, wX, wY, wWidth, wHeight); + } + + i->sf = dst; + + // もし前に作成したものがあり、未開放の場合は開放 + scg_free(wNumDstCG); + + sact.cg[wNumDstCG] = i; + + return OK; +} + +// 全てのCGの開放 +int scg_freeall() { + int i; + + for (i = 1; i < CGMAX; i++) { + scg_free(i); + } + return OK; +} + +/** + * 指定の番号の CG をオブジェクトリストから消し、オブジェクトがどこからも参照 + * されていない(参照数が0の)場合のみ、オブジェクトを削除 + */ +int scg_free(int no) { + cginfo_t *cg; + + spcg_assert_no(no); + + if (NULL == (cg = sact.cg[no])) return NG; + + // 参照数が0の時のみオブジェクトを開放 + if (cg->refcnt == 0) { + scg_free_cgobj(cg); + } + + // 番号で消したときはオブジェクトが開放されなくても + // オブジェクトリストから削除 + sact.cg[no] = NULL; + + return OK; +} + +/** + * CG オブジェクトの開放 + */ +int scg_free_cgobj(cginfo_t *cg) { + if (cg == NULL) return NG; + + (cg->refcnt)--; + // 他でまだ参照していれば開放しない + if (cg->refcnt > 0) { + return NG; + } + + // CG本体の開放 + if (cg->sf) { + sf_free(cg->sf); + } + + // 削除するオブジェクトを参照しているオブジェクトリストも削除 + if (cg == sact.cg[cg->no]) { + sact.cg[cg->no] = NULL; + } + + g_free(cg); + + return OK; +} + +// CGの種類を取得 +int scg_querytype(int wNumCG, int *ret) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (sact.cg[wNumCG] == NULL) goto errexit; + + *ret = sact.cg[wNumCG]->type; + + return OK; + + errexit: + *ret = CG_NOTUSED; + return NG; +} + +// CGの大きさを取得 +int scg_querysize(int wNumCG, int *w, int *h) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (sact.cg[wNumCG] == NULL) goto errexit; + if (sact.cg[wNumCG]->sf == NULL) goto errexit; + + *w = sact.cg[wNumCG]->sf->width; + *h = sact.cg[wNumCG]->sf->height; + + return OK; + + errexit: + *w = *h = 0; + return NG; +} + +// CGのBPPを取得 +int scg_querybpp(int wNumCG, int *ret) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (sact.cg[wNumCG] == NULL) goto errexit; + if (sact.cg[wNumCG]->sf == NULL) goto errexit; + + *ret = sact.cg[wNumCG]->sf->depth; + + return OK; + + errexit: + *ret = 0; + return NG; +} + +// CGの alphamap が存在するかを取得 +int scg_existalphamap(int wNumCG, int *ret) { + if (wNumCG >= (CGMAX -1)) goto errexit; + if (sact.cg[wNumCG] == NULL) goto errexit; + if (sact.cg[wNumCG]->sf == NULL) goto errexit; + + *ret = sact.cg[wNumCG]->sf->has_alpha ? 1 : 0; + + errexit: + *ret = 0; + return NG; +} diff --git a/modules/SACT/sactcg.h b/modules/SACT/sactcg.h new file mode 100644 index 0000000..a23932b --- /dev/null +++ b/modules/SACT/sactcg.h @@ -0,0 +1,49 @@ +/* + * sactcg.h: CG作成 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactcg.h,v 1.2 2003/11/16 15:29:52 chikama Exp $ */ + +#ifndef __SACTCG_H__ +#define __SACTCG_H__ + +#include "portab.h" +#include "sact.h" + +extern cginfo_t *scg_loadcg_no(int no, boolean refinc); +extern int scg_create(int wNumCG, int wWidth, int wHeight, int wR, int wG, int wB, int wBlendRate); +extern int scg_create_reverse(int NumCG, int wNumSrcCG, int wReverseX, int wReverseY); +extern int scg_create_stretch(int wNumCG, int wWidth, int wHeight, int wNumSrcCG); +extern int scg_create_blend(int wNumDstCG, int wNumBaseCG, int wX, int wY, int wNumBlendCG, int wAlphaMapMode); +extern int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText); +extern int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, int wZeroPadding, int wValue); +extern int scg_copy(int wNumDstCG, int wNumSrcCG); +extern int scg_cut(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight); +extern int scg_partcopy(int wNumDstCG, int wNumSrcCG, int wX, int wY, int wWidth, int wHeight); +extern int scg_freeall(); +extern int scg_free(int cg); +extern int scg_free_cgobj(cginfo_t *cg); +extern int scg_querytype(int wNumCG, int *ret); +extern int scg_querysize(int wNumCG, int *w, int *h); +extern int scg_querybpp(int wNumCG, int *ret); +extern int scg_existalphamap(int wNumCG, int *ret); +extern int scg_linkcgfree(int no); + +#endif diff --git a/modules/SACT/sactcg_blend.c b/modules/SACT/sactcg_blend.c new file mode 100644 index 0000000..0360404 --- /dev/null +++ b/modules/SACT/sactcg_blend.c @@ -0,0 +1,31 @@ +// +static surface_t *blend(surface_t *base, int x, int y, surface_t *blend, int mode) { + surface_t *dst = sf_create_surface(base->width, base->height, base->depth); + + gr_copy(dst, 0, 0, base, 0, 0, base->width, base->height); + + if (base->has_alpha) { + // ベースに alpha map がある場合はそれをコピー + gr_copy_alpha_map(dst, 0, 0, base, 0, 0, base->width, base->height); + } else { + // 無い場合は全て 255 の map を作成 + gr_fill_alpha_map(dst, 0, 0, base->width, base->height, 255); + } + + if (blend->has_alpha) { + // 重ね合わせ先の alpha map があるときはそれを使う + gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, blend, 0, 0, 255); + } else { + // 無いときは dst の alpha map を使う + gre_BlendUseAMap(dst, x, y, base, x, y, blend, 0, 0, blend->width, blend->height, dst, x, y, 255); + } + + // alpha 作成モードが dst + blend の時は飽和加算 + if (mode == 1) { + gr_saturadd_alpha_map(dst, x, y, blend, 0, 0, blend->width, blend->height); + } + + return dst; +} + + diff --git a/modules/SACT/sactcg_stretch.c b/modules/SACT/sactcg_stretch.c new file mode 100644 index 0000000..5b29489 --- /dev/null +++ b/modules/SACT/sactcg_stretch.c @@ -0,0 +1,117 @@ +// 拡大縮小 +static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) { + surface_t *dst = g_new0(surface_t, 1); + float a1, a2, xd, yd; + int sw, sh; + int *row, *col; + int x, y; + BYTE *sdata, *ddata; + + dst->width = dw; + dst->height = dh; + dst->depth = src->depth; + dst->bytes_per_line = dw * src->bytes_per_pixel; + dst->bytes_per_pixel = src->bytes_per_pixel; + dst->has_pixel = src->has_pixel; + dst->has_alpha = src->has_alpha; + + if (src->has_pixel) { + dst->pixel = g_malloc(dh * dst->bytes_per_line); + } + if (src->has_alpha) { + dst->alpha = g_malloc(dw * dh); + } + + + sdata = GETOFFSET_PIXEL(src, 0, 0); + ddata = GETOFFSET_PIXEL(dst, 0, 0); + sw = src->width; + sh = src->height; + + a1 = (float)sw / (float)dw; + a2 = (float)sh / (float)dh; + row = g_new(int, dw); + // 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる + // 可能性がある。 + col = g_new0(int, dh +1); + + if (mirror & 1) { + /* 上下反転 added by tajiri@wizard */ + for (yd = sh - a2, y = 0; y < dh; y++) { + col[y] = yd; yd -= a2; + } + } else { + for (yd = 0.0, y = 0; y < dh; y++) { + col[y] = yd; yd += a2; + } + } + if (mirror & 2) { + /* 左右反転 added by tajiri@wizard */ + for (xd = sw - a1, x = 0; x < dw; x++) { + row[x] = xd; xd -= a1; + } + } else { + for (xd = 0.0, x = 0; x < dw; x++) { + row[x] = xd; xd += a1; + } + } + +#define SCALEDCOPYAREA(type) { \ + int x, y; \ + type *sl, *dl; \ + BYTE *_sl, *_dl; \ + for (y = 0; y < dh; y++) { \ + sl = (type *)(sdata + *(y + col) * src->bytes_per_line);\ + dl = (type *)(ddata + y * dst->bytes_per_line);\ + for (x = 0; x < dw; x++) { \ + *(dl + x) = *(sl + *(row + x)); \ + } \ + _dl = (BYTE *)dl; \ + while(*(col + y) == *(col + y + 1)) { \ + _sl = _dl; \ + _dl += dst->bytes_per_line; \ + memcpy(_dl, _sl, dw * sizeof(type)); \ + y++; \ + } \ + }} + + switch(dst->depth) { + case 8: + SCALEDCOPYAREA(BYTE); break; + case 15: + case 16: + SCALEDCOPYAREA(WORD); break; + case 24: + case 32: + SCALEDCOPYAREA(DWORD); break; + default: + break; + } + + if (src->has_alpha) { + int x, y; + BYTE *sl, *dl; + BYTE *_sl, *_dl; + sdata = GETOFFSET_ALPHA(src, 0, 0); + ddata = GETOFFSET_ALPHA(dst, 0, 0); + for (y = 0; y < dh; y++) { + sl = (BYTE *)(sdata + *(y + col) * src->width); + dl = (BYTE *)(ddata + y * dst->width); + for (x = 0; x < dw; x++) { + *(dl + x) = *(sl + *(row + x)); + } + _dl = (BYTE *)dl; + while(*(col + y) == *(col + y + 1)) { + _sl = _dl; + _dl += dst->width; + memcpy(_dl, _sl, dw); + y++; + } + } + } + + g_free(row); + g_free(col); + + return dst; +} diff --git a/modules/SACT/sactchart.c b/modules/SACT/sactchart.c new file mode 100644 index 0000000..10294c7 --- /dev/null +++ b/modules/SACT/sactchart.c @@ -0,0 +1,52 @@ +/* + * sactchart.c: SACT.ChartPos 処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactchart.c,v 1.2 2003/04/27 11:00:36 chikama Exp $ */ + +#include +#include "portab.h" + +// グラフ用チャート作成 +int schart_pos(int *pos, int pos1, int pos2, int val1, int val2, int val) { + if (val1 == val2) { + *pos = 0; + } else { + *pos = (((pos2 - pos1) * (val - val1)) / (val2 - val1)) + pos1; + } + return OK; +} + +/* +37,103f: SACT.ChartPos 0x8b627648,0,135,0,99,66: ->90 +37,103f: SACT.ChartPos 0x8b627648,0,135,0,99,99: ->135 +37,103f: SACT.ChartPos 0x8b627648,0,135,0,300,26: ->11 +37,103f: SACT.ChartPos 0x8b627648,0,135,0,300,300: ->135 +37,103f: SACT.ChartPos 0x8b627648,0,135,0,40,40: ->135 +37,103f: SACT.ChartPos 0x8b627648,0,135,0,40,40: +37,103f: SACT.ChartPos 0x8b627648,0,70,0,25,1: ->2 +37,103f: SACT.ChartPos 0x8b627648,0,70,0,25,25: ->70 +37,103f: SACT.ChartPos 0x8b627648,0,70,0,25,25: +37,65d: SACT.ChartPos 0x8b627510,0,100,0,99,66: ->66 +37,65d: SACT.ChartPos 0x8b627510,0,100,0,300,26: ->8 +37,65d: SACT.ChartPos 0x8b627510,0,70,0,300,20: ->4 +78,97a0: SACT.ChartPos 0x5812e638,10000,9520,0,240,1: ->9998 +78,97a0: SACT.ChartPos 0x5812e638,10000,9520,0,240,240: ->9520 +*/ diff --git a/modules/SACT/sactchart.h b/modules/SACT/sactchart.h new file mode 100644 index 0000000..e6a7c48 --- /dev/null +++ b/modules/SACT/sactchart.h @@ -0,0 +1,29 @@ +/* + * sactchart.h: SACT.ChartPos 処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactchart.h,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#ifndef __SACTCHART_H__ +#define __SACTCHART_H__ + +extern int schart_pos(int *pos, int pos1, int pos2, int val1, int val2, int val); + +#endif diff --git a/modules/SACT/sactcrypto.c b/modules/SACT/sactcrypto.c new file mode 100644 index 0000000..de09ef8 --- /dev/null +++ b/modules/SACT/sactcrypto.c @@ -0,0 +1,54 @@ +/* + * sactcrypt.c: SACTの暗号化関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactcrypto.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "system.h" +#include "variable.h" + +/* + 多分、セーブ時に暗号化して、ロード時に復号化するので + 適当でいいとおもう +*/ + +int scryp_encrypt_word(int *array, int num, int key) { + WARNING("NOT IMPLEMENTED\n"); + return OK; +} + +int scryp_decrypt_word(int *array, int num, int key) { + WARNING("NOT IMPLEMENTED\n"); + return OK; +} + +int scryp_encrypt_str(int strno, int key) { + WARNING("NOT IMPLEMENTED\n"); + return OK; +} + +int scryp_decrypt_str(int strno, int key) { + WARNING("str = '%s'\n", v_str(strno -1)); + WARNING("NOT IMPLEMENTED\n"); + return OK; +} diff --git a/modules/SACT/sactcrypto.h b/modules/SACT/sactcrypto.h new file mode 100644 index 0000000..7a2b151 --- /dev/null +++ b/modules/SACT/sactcrypto.h @@ -0,0 +1,32 @@ +/* + * sactcrypt.h: SACTの暗号化関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactcrypto.h,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#ifndef __SACTCRYPT_H__ +#define __SACTCRYPT_H__ + +extern int scryp_encrypt_word(int *array, int num, int key); +extern int scryp_decrypt_word(int *array, int num, int key); +extern int scryp_encrypt_str(int strno, int key); +extern int scryp_decrypt_str(int strno, int key); + +#endif diff --git a/modules/SACT/sactlog.c b/modules/SACT/sactlog.c new file mode 100644 index 0000000..95c9cfb --- /dev/null +++ b/modules/SACT/sactlog.c @@ -0,0 +1,162 @@ +/* + * sactlog.c: バックログ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactlog.c,v 1.3 2004/10/31 04:18:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "menu.h" +#include "imput.h" +#include "nact.h" +#include "key.h" +#include "sact.h" +#include "sprite.h" +#include "ngraph.h" +#include "drawtext.h" +#include "eucsjis.h" +#include "sactlog_sjismsg.c" + +/* + ホイールで上下スクロール + ESCキーで終了 + PageUP/Downで1ページ送り +*/ + +#define FONTSIZEINDEX 10 +#define FONTSIZE 20 +#define LOGLINENUM (sf0->height / FONTSIZE) +static int curline; +static surface_t *back; +static surface_t *chr; + +static void draw_log() { + int i, y = 0, len; + int cur = curline; + char pinfo[256]; + GList *node; + + // canvas clear + memset(chr->pixel, 0, chr->bytes_per_line * chr->height); + + // ページ位置情報 + len = g_snprintf(pinfo, sizeof(pinfo) -1, "%d/%d", curline, g_list_length(sact.log)); + + dt_setfont(FONT_GOTHIC, FONTSIZEINDEX); + dt_drawtext(chr, sf0->width - FONTSIZEINDEX *len /2, 0, pinfo); + + // 表示始め位置 + node = g_list_nth(sact.log, g_list_length(sact.log) - curline); + for (i = 0; i < LOGLINENUM; i++) { + char *str, *streuc; + if (cur <= 0) continue; + + str = (char *)(node->data); + if (0 == strcmp(str, "\n")) { + gr_fill(chr, 0, y + FONTSIZE/2, sf0->width, 3, 128, 0, 0); + } else { + streuc = sjis2lang(str); + if (cur < 6) { + dt_setfont(FONT_MINCHO, FONTSIZE); + } else { + dt_setfont(FONT_GOTHIC, FONTSIZE); + } + dt_drawtext(chr, 0, y, str); + free(streuc); + } + y += FONTSIZE; + cur--; + node = g_list_next(node); + } + + gr_copy_bright(sf0, 0, 0, back, 0, 0, sf0->width, sf0->height, 128); + gr_expandcolor_blend(sf0, 0, 0, chr, 0, 0, sf0->width, sf0->height, + 255, 255, 255); + ags_updateFull(); +} + + + +int sblog_start(void) { + // 説明文章を追加 + sact.log = g_list_append(sact.log, "\n"); + sact.log = g_list_append(sact.log, LOGMSG1); + sact.log = g_list_append(sact.log, LOGMSG2); + sact.log = g_list_append(sact.log, LOGMSG3); + sact.log = g_list_append(sact.log, LOGMSG4); + sact.log = g_list_append(sact.log, "\n"); + + back = sf_dup(sf0); + chr = sf_create_surface(sf0->width, sf0->height, 8); + curline = 6; + draw_log(); + return OK; +} + +int sblog_end(void) { + GList *node; + int i; + + sf_copyall(sf0, back); + ags_updateFull(); + + sf_free(back); + sf_free(chr); + + // 説明文章を削除 + for (i = 0; i < 6; i++) { + node = g_list_last(sact.log); + sact.log = g_list_remove(sact.log, node->data); + } + + return OK; +} + +int sblog_pageup(void) { + curline = MIN(g_list_length(sact.log), curline + (LOGLINENUM -1)); + draw_log(); + return OK; +} + +int sblog_pagedown(void) { + curline = MAX(1, curline - (LOGLINENUM -1)); + draw_log(); + return OK; +} + +int sblog_pagepre(void) { + curline = MAX(1, curline - 1); + draw_log(); + return OK; +} + +int sblog_pagenext(void) { + curline = MIN(g_list_length(sact.log), curline + 1); + draw_log(); + return OK; +} diff --git a/modules/SACT/sactlog.h b/modules/SACT/sactlog.h new file mode 100644 index 0000000..7eba13d --- /dev/null +++ b/modules/SACT/sactlog.h @@ -0,0 +1,34 @@ +/* + * sactlog.h: バックログ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactlog.h,v 1.1 2003/04/25 17:23:55 chikama Exp $ */ + +#ifndef __SACTLOG_H__ +#define __SACTLOG_H__ + +extern int sblog_start(void); +extern int sblog_end(void); +extern int sblog_pageup(void); +extern int sblog_pagedown(void); +extern int sblog_pagepre(void); +extern int sblog_pagenext(void); + +#endif diff --git a/modules/SACT/sactlog_sjismsg.c b/modules/SACT/sactlog_sjismsg.c new file mode 100644 index 0000000..63bd4bb --- /dev/null +++ b/modules/SACT/sactlog_sjismsg.c @@ -0,0 +1,5 @@ +#define LOGMSG1 "���o�b�N���O�������@��" +#define LOGMSG2 "[ESC]�������}�E�X�E�N���b�N���Q�[��������" +#define LOGMSG3 "[PageUp][PageDown]���y�[�W�X�N���[��" +#define LOGMSG4 "[��][��]�������}�E�X�z�C�[�����s�X�N���[��" + diff --git a/modules/SACT/sactsound.c b/modules/SACT/sactsound.c new file mode 100644 index 0000000..b562f09 --- /dev/null +++ b/modules/SACT/sactsound.c @@ -0,0 +1,186 @@ +/* + * sactsound.c: SACTの効果音関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactsound.c,v 1.4 2003/08/02 13:10:32 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "nact.h" +#include "imput.h" +#include "sactsound.h" +#include "music_client.h" +#include "sact.h" + +// slot番号の 1から 20を SACT用に使用 +#define CACHEMAX 20 +#define SLOTOFFSET 1 +static int cache[CACHEMAX]; +static int cachei; + +// 再生する効果音用の空いているスロットを探す +static int slt_getnext(int no) { + int indx; + + indx = cachei % CACHEMAX; + cache[indx] = no; + cachei++; + if (cachei == CACHEMAX) cachei = 0; + return indx + SLOTOFFSET; +} + +// 指定の番号の効果音が入っているスロットを探す +static int slt_find(int no) { + int i; + + for (i = 0; i < CACHEMAX; i++) { + if (cache[i] == no) return i + SLOTOFFSET; + } + return -1; +} + +/* + SACT 効果音 subsystem 初期化 +*/ +int ssnd_init() { + // ch 1-8 をキャッシュとして使おう + cachei = 0; + return OK; +} + +// 指定の番号の効果音をメモリに読み込み +int ssnd_prepare(int no) { + int slot = slt_find(no); + + if (slot == -1) { + slot = slt_getnext(no); + mus_wav_load(slot, no); + } + + return OK; +} + +// 指定の番号の効果音を再生 +int ssnd_play(int no) { + int slot = slt_find(no); + + if (slot == -1) { + slot = slt_getnext(no); + mus_wav_load(slot, no); + } + mus_wav_play(slot, 1); + + return OK; +} + +// 指定の番号の効果音を再生停止 +int ssnd_stop(int no, int fadetime) { + int slot = slt_find(no); + + if (slot != -1) { + mus_wav_fadeout_start(slot, fadetime, 0, TRUE); + cache[slot - SLOTOFFSET] = 0; + } + + return OK; +} + +// 指定の番号の効果音が再生終了するのを待つ +int ssnd_wait(int no) { + int slot = slt_find(no); + + if (slot != -1) { + mus_wav_waitend(slot); + cache[slot - SLOTOFFSET] = 0; + } + return OK; +} + +// 指定の効果音が終了するか、キーが押されるまで待つ +int ssnd_waitkey(int no, int *res) { + int slot = slt_find(no); + + if (slot == -1) { + *res = 0; + return OK; + } + + if (sact.waitskiplv > 1) { + *res = SYS35KEY_RET; + return OK; + } + + sact.waittype = KEYWAIT_SIMPLE; + sact.waitkey = -1; + + while(sact.waitkey == -1 && mus_wav_get_playposition(slot)) { + sys_keywait(25, TRUE); + } + + if (sact.waitkey == -1) { + *res = 0; + } else { + *res = sact.waitkey; + } + sact.waittype = KEYWAIT_NONE; + + cache[slot - SLOTOFFSET] = 0; + + return OK; +} + +// 左右チャンネルの反転した効果音をメモリに読み込む +int ssnd_prepareLRrev(int no) { + mus_wav_load_lrsw(30, no); // slot は 30固定でいい? + return OK; +} + +// 左右チャンネルの反転した効果音を再生 +int ssnd_playLRrev(int no) { + mus_wav_load_lrsw(30, no); + mus_wav_play(30, 1); + + return OK; +} + +// 指定の番号の効果音が存在するかどうかをチェック +int ssnd_getlinknum(int no) { + WARNING("NOT IMPLEMENTED\n"); + return OK; +} + +// すべての再生中の効果音が再生を終了するのを待つ +int ssnd_stopall(int time) { + int i; + + for (i = 0; i < CACHEMAX; i++) { + if (cache[i] > 0) { + mus_wav_fadeout_start(i + SLOTOFFSET, time, 0, TRUE); + cache[i] = 0; + } + } + return OK; +} diff --git a/modules/SACT/sactsound.h b/modules/SACT/sactsound.h new file mode 100644 index 0000000..fe83776 --- /dev/null +++ b/modules/SACT/sactsound.h @@ -0,0 +1,38 @@ +/* + * sactsound.h: SACTの効果音関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactsound.h,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#ifndef __SACTSOUND_H__ +#define __SACTSOUND_H__ + +extern int ssnd_init(); +extern int ssnd_play(int no); +extern int ssnd_stop(int no, int fadetime); +extern int ssnd_wait(int no); +extern int ssnd_waitkey(int no, int *res); +extern int ssnd_prepare(int no); +extern int ssnd_prepareLRrev(int no); +extern int ssnd_playLRrev(int no); +extern int ssnd_getlinknum(int no); +extern int ssnd_stopall(int time); + +#endif /* __SACTSOUND_H__ */ diff --git a/modules/SACT/sactstring.c b/modules/SACT/sactstring.c new file mode 100644 index 0000000..3c6c5f7 --- /dev/null +++ b/modules/SACT/sactstring.c @@ -0,0 +1,111 @@ +/* + * sactstring.c: SACTの文字列操作関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactstring.c,v 1.3 2003/08/02 13:10:32 chikama Exp $ */ + +#include "config.h" +#include +#include +#include +#include "portab.h" +#include "system.h" +#include "variable.h" +#include "sact.h" + +#define DEFSTACKSIZE 100 +static char **stack; // stack本体 +static int idx; // stack pointer +static int idxmax; // stack pointerの最大 + +/** + * 文字列変数スタックの初期化 + */ +int sstr_init() { + stack = g_new(char *, DEFSTACKSIZE); + idx = 0; + idxmax = DEFSTACKSIZE; + return OK; +} + +/** + * 文字列変数スタックに文字列を積む + * @param strno: シナリオ上での文字列変数番号 + */ +int sstr_push(int strno) { + if (idx >= idxmax) { + stack = g_renew(char *, stack, idx*2); + idxmax = idx*2; + } + + stack[idx++] = g_strdup(v_str(strno -1)); + + return OK; +} + +/** + * 文字列変数スタックから文字列を取り出す + * @param strno: スタックから戻した文字列を格納する文字列変数番号 + */ +int sstr_pop(int strno) { + if (idx == 0) return NG; + + v_strcpy(strno -1, stack[--idx]); + g_free(stack[idx]); + + return OK; +} + +/** + * 文字列の置き換え + * @param sstrno: 変換元文字列変数番号 + * @param dstrno: 変換先文字列変数番号 + */ +int sstr_regist_replace(int sstrno, int dstrno) { + strexchange_t *ex; + + if (sstrno == dstrno) return NG; + + ex = g_new(strexchange_t, 1); + ex->src = strdup(v_str(sstrno -1)); + ex->dst = strdup(v_str(dstrno -1)); + sact.strreplace = g_slist_append(sact.strreplace, ex); + return OK; +} + +/** + * 数値 -> 文字列化 + */ +int sstr_num2str(int strno, int fig, int nzeropad, int num) { + char s[256], ss[256]; + + if (nzeropad) { + char *sss = "%%0%dd"; + sprintf(ss, sss, fig); + } else { + char *sss = "%%%dd"; + sprintf(ss, sss, fig); + } + + sprintf(s, ss, num); + v_strcpy(strno -1, s); + + return OK; +} diff --git a/modules/SACT/sactstring.h b/modules/SACT/sactstring.h new file mode 100644 index 0000000..a8ee3ff --- /dev/null +++ b/modules/SACT/sactstring.h @@ -0,0 +1,34 @@ +/* + * sactstring.h: SACTの文字列操作関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sactstring.h,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#ifndef __SACTSTRING_H__ +#define __SACTSTRING_H__ + +extern int sstr_init(); +extern int sstr_push(int strno); +extern int sstr_pop(int strno); +extern int sstr_regist_replace(int sstrtno, int dstrno); +extern int sstr_num2str(int strno, int fig, int nzeropad, int num); + + +#endif /* __SACTSTRING_H__ */ diff --git a/modules/SACT/sacttimer.c b/modules/SACT/sacttimer.c new file mode 100644 index 0000000..8633141 --- /dev/null +++ b/modules/SACT/sacttimer.c @@ -0,0 +1,59 @@ +/* + * sacttimer.c: SACTのタイマ関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sacttimer.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "sact.h" +#include "sacttimer.h" + +/* + sact timer subsystem 初期化 +*/ +int stimer_init() { + stimer_reset(0, 0); + return OK; +} + +// 指定IDのタイマーのリセット +int stimer_reset(int id, int val) { + gettimeofday(&(sact.timer[id].tv_base), NULL); + sact.timer[id].val = val; + return OK; +} + +// 指定IDのタイマーの取得 +int stimer_get(int id) { + long sec, usec, usec2; + struct timeval tv; + struct timeval tv_base = sact.timer[id].tv_base; + int division = 10; + + gettimeofday(&tv, NULL); + sec = tv.tv_sec - tv_base.tv_sec; + usec = tv.tv_usec - tv_base.tv_usec; + usec2 = sec * (1000l/division)+ usec / 1000l /division; + return sact.timer[id].val + usec2; +} diff --git a/modules/SACT/sacttimer.h b/modules/SACT/sacttimer.h new file mode 100644 index 0000000..0aebed8 --- /dev/null +++ b/modules/SACT/sacttimer.h @@ -0,0 +1,41 @@ +/* + * sacttimer.h: SACTのタイマ関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sacttimer.h,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#ifndef __SACTTIMER_H__ +#define __SACTTIMER_H__ + +#include +#include + +struct _stimer { + int val; + struct timeval tv_base; +}; +typedef struct _stimer stimer_t; + + +extern int stimer_init(); +extern int stimer_reset(int id, int val); +extern int stimer_get(int id); + +#endif diff --git a/modules/SACT/screen_quake.c b/modules/SACT/screen_quake.c new file mode 100644 index 0000000..b3f109f --- /dev/null +++ b/modules/SACT/screen_quake.c @@ -0,0 +1,100 @@ +/* + * screen_quake.c: スクリーン全体を揺らす + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: screen_quake.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +// #include "LittleEndian.h" +#include "ags.h" +#include "imput.h" +#include "sact.h" +#include "surface.h" +#include "ngraph.h" +#include "sprite.h" +#include "counter.h" +#include "randMT.h" + +typedef void entrypoint (double step, int p1, int p2, int *retx, int *rety); + +// 上下左右方向の揺らし +static void quake0(double step, int ampx, int ampy, int *adjx, int *adjy) { + static int i = 0; + + *adjx = (int)(genrand() * ampx/2); + *adjy = (int)(genrand() * ampy/2); + *adjx *= ((-1)*(i%2) + ((i+1)%2)); + *adjy *= ((-1)*((i+1)%2) + (i%2)); + i++; +} + +// 回転の揺らし +static void quake1(double curstep, int diam, int round, int *adjx, int *adjy) { + double R = (1 - curstep) * diam / 2; + double th = curstep * 2 * M_PI * round; + + *adjx = (int)(R * cos(th)); + *adjy = (int)(R * sin(th)); +} + +/* + 画面揺らし + @param wType: 0=縦横, 1:回転 + @param wParam1: wType=0のときx方向の振幅 + wType=1のとき振幅 + @param wParam2: wType=0のときy方向の振幅 + wType=1のとき回転数 + @param wCount: 時間(1/100秒) + @param nfKeyEnable: キー抜け (1で有効) +*/ +int sp_quake_screen(int type, int p1, int p2, int time, int cancel) { + int sttime, edtime, curtime; + int key; + entrypoint *cb[2] = {quake0, quake1}; + + if (type > 1) return OK; + + sttime = get_high_counter(SYSTEMCOUNTER_MSEC); + edtime = time * 10 + sttime; + while ((curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < edtime) { + int adjx, adjy; + + cb[type]((double)(curtime - sttime)/(edtime - sttime), p1, p2, &adjx, &adjy); + ags_setViewArea(adjx, adjy, sf0->width, sf0->height); + ags_updateFull(); + + key = sys_keywait(10, cancel); + if (cancel && key) break; + } + + ags_setViewArea(0, 0, sf0->width, sf0->height); + ags_updateFull(); + + return OK; +} + diff --git a/modules/SACT/sprite.c b/modules/SACT/sprite.c new file mode 100644 index 0000000..5e8f63c --- /dev/null +++ b/modules/SACT/sprite.c @@ -0,0 +1,730 @@ +/* + * sprite.c: スプライト基本各種処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite.c,v 1.5 2003/11/16 15:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "ngraph.h" +#include "ags.h" +#include "nact.h" +#include "sact.h" +#include "sprite.h" +#include "surface.h" +#include "sactcg.h" +#include "sactsound.h" + +static gint compare_spriteno_smallfirst(gconstpointer a, gconstpointer b); + + +#define sp_assert_no(no) G_STMT_START{ \ + if ((no) >= SPRITEMAX) { \ + WARNING("no is too large (should be %d < %d)\n", no, SPRITEMAX); \ + return NG; \ + } \ +}G_STMT_END + +#define sp_assert_null(no) G_STMT_START{ \ + if (sact.sp[no] == NULL) { \ + WARNING("sprite %d is NULL\n", no); \ + return NG; \ + } \ +}G_STMT_END + + +// スプライトの番号順に更新するためにリストに順番に要れるためのcallbck +static gint compare_spriteno_smallfirst(gconstpointer a, gconstpointer b) { + sprite_t *sp1 = (sprite_t *)a; + sprite_t *sp2 = (sprite_t *)b; + + if (sp1->no < sp2->no) { + return -1; + } + if (sp1->no > sp2->no) { + return 1; + } + return 0; +} + +// デフォルトの壁紙update +static int sp_draw_wall(sprite_t *sp) { + int sx, sy, w, h; + + sx = sact.updaterect.x; + sy = sact.updaterect.y; + w = sact.updaterect.width; + h = sact.updaterect.height; + gr_fill(sf0, sx, sy, w, h, 0, 0, 0); + + WARNING("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, \n", + sp->no, sx, sy, w, h); + + return OK; +} + +/** + * sprite 関連の初期化 + * @param none + * @return OK:成功, NG:失敗 + */ +int sp_init() { + int i; + + // DLL用メッセージ表示 + nact->msgout = smsg_add; + + // mouse/key event handler + nact->ags.eventcb = spev_callback; + + // main callback + nact->callback = spev_main; + + // いろいろな理由から全てのスプライトをあらかじめ作成しておく + for (i = 0; i < SPRITEMAX; i++) { + sact.sp[i] = g_new0(sprite_t, 1); + sact.sp[i]->no = i; + sact.sp[i]->type = SPRITE_NONE; + sact.sp[i]->show = FALSE; + } + + // 壁紙(スプライト番号0)はデフォルトへ + sp_set_wall_paper(0); + + // 壁紙を updateリストに追加 + sact.updatelist = g_slist_append(sact.updatelist, sact.sp[0]); + + return OK; +} + +/** + * 新規スプライトの作成 + * @param no: スプライト番号 + * @param cg1: 1枚目のCG + * @param cg2: 2枚目のCG (ない場合は0) + * @param cg3: 3枚目のCG (ない場合は0) + * @param type: スプライトの種類 + */ +int sp_new(int no, int cg1, int cg2, int cg3, int type) { + sprite_t *sp; + + sp_assert_no(no); + + sp = sact.sp[no]; + + if (sp->type != SPRITE_NONE) { + sp_free(no); + } + + // 更新リストに登録 + sact.updatelist = g_slist_insert_sorted(sact.updatelist, sp, compare_spriteno_smallfirst); + + sp->type = type; + sp->no = no; + + // set時点でのcgが使用される(draw時ではない) + if (cg1) sp->cg1 = scg_loadcg_no(cg1, TRUE); else sp->cg1 = NULL; + if (cg2) sp->cg2 = scg_loadcg_no(cg2, TRUE); else sp->cg2 = NULL; + if (cg3) sp->cg3 = scg_loadcg_no(cg3, TRUE); else sp->cg3 = NULL; + + //初期のcurcgはcg1 + sp->curcg = sp->cg1; + + sp->show = TRUE; // 初期状態は表示 + sp->blendrate = 255; // ブレンド無し + sp->loc.x = 0; // 初期表示位置は(0,0) + sp->loc.y = 0; + sp->cur = sp->loc; + + // cg1の大きさをスプライトの大きさとする + if (sp->curcg == NULL) { + sp->cursize.width = 0; + sp->cursize.height = 0; + } else { + sp->cursize.width = sp->curcg->sf->width; + sp->cursize.height = sp->curcg->sf->height; + } + + sp->freezed_state = 0; // 状態固定は無し + sp->update = DEFAULT_UPDATE; // default の updateルーチン + + // 各スプライトタイプ毎の初期化 + switch(type) { + case SPRITE_SWITCH: + sp_sw_setup(sp); + break; + + case SPRITE_GETA: + case SPRITE_GETB: + sp_get_setup(sp); + break; + + case SPRITE_PUT: + case SPRITE_SWPUT: + sp_put_setup(sp); + break; + + case SPRITE_ANIME: + sp_anime_setup(sp); + break; + } + + return OK; +} + +// メッセージスプライトの作成 +int sp_new_msg(int no, int x, int y, int width, int height) { + sprite_t *sp; + + sp_assert_no(no); + + sp = sact.sp[no]; + + if (sp->type != SPRITE_NONE) { + sp_free(no); + } + // 更新リストに登録 + sact.updatelist = g_slist_insert_sorted(sact.updatelist, sp, compare_spriteno_smallfirst); + + + sp->type = SPRITE_MSG; + sp->no = no; + sp->show = TRUE; // 初期状態は表示 + sp->blendrate = 255; // ブレンド無し + sp->freezed_state = 0; // 状態固定無し + sp->loc.x = x - sact.origin.x; // 初期表示位置 + sp->loc.y = y - sact.origin.y; + sp->u.msg.dspcur.x = 0; // 文字描画開始位置 + sp->u.msg.dspcur.y = 0; + sp->cursize.width = width; // スプライトの大きさ + sp->cursize.height = height; + sp->cur = sp->loc; + sp->u.msg.buf = NULL; + + // 文字描画用キャンバス + sp->u.msg.canvas = sf_create_surface(width, height, sf0->depth); + + // スプライト再描画用コールバック + sp->update = smsg_update; + + return OK; +} + +// 壁紙の設定 +int sp_set_wall_paper(int no) { + sprite_t *sp = sact.sp[0]; + + if (sp->curcg) { + scg_free_cgobj(sp->curcg); + } + + if (no) { // 指定のCGを表示 + sp->curcg = scg_loadcg_no(no, TRUE); + sp->update = DEFAULT_UPDATE; + sp->cursize.width = sp->curcg->sf->width; + sp->cursize.height = sp->curcg->sf->height; + } else { // 真黒 + sp->cursize.width = sf0->width; + sp->cursize.height = sf0->height; + sp->curcg = NULL; + sp->update = sp_draw_wall; + } + + sp->type = SPRITE_WP; + sp->show = TRUE; + sp->blendrate = 255; + sp->cur.x = 0; + sp->cur.y = 0; + + return OK; +} + +// 全ての sprite を消去 +int sp_free_all() { + int i; + + for (i = 1; i < SPRITEMAX; i++) { + sp_free(i); + } + return OK; +} + +// 指定のsprite を消去 +int sp_free(int no) { + sprite_t *sp; + + sp_assert_no(no); + + sp = sact.sp[no]; + + // 移動開始していない場合はリストから削除 + if (!sp->move.moving) { + sact.movelist = g_slist_remove(sact.movelist, sp); + } + + // CGオブジェクトの削除 + if (sp->cg1) scg_free_cgobj(sp->cg1); + if (sp->cg2) scg_free_cgobj(sp->cg2); + if (sp->cg3) scg_free_cgobj(sp->cg3); + + // remove時の処理があれば実行 + if (sp->remove) { + sp->remove(sp); + } + + // 説明スプライトの削除 + // ここで消しちゃまずいかも + g_slist_free(sp->expsp); + sp->expsp = NULL; + + if (sp->type == SPRITE_MSG) { + g_slist_free(sp->u.msg.buf); + sf_free(sp->u.msg.canvas); + } + sact.updatelist = g_slist_remove(sact.updatelist, sp); + + // SACT.Numeral_XXX は残しておく + { + sprite_t back; + memcpy(&(back.numeral), &(sp->numeral), sizeof(sp->numeral)); + memset(sp, 0, sizeof(sprite_t)); + sp->type = SPRITE_NONE; + sp->no = no; + sp->show = FALSE; + memcpy(&(sp->numeral), &(back.numeral), sizeof(sp->numeral)); + } + return OK; +} + +// 表示状態の変更 +int sp_set_show(int wNum, int wCount, int sShow) { + int i; + boolean oldstate; + sprite_t *sp; + + sp_assert_no(wNum); + + for (i = wNum; i < (wNum + wCount); i++) { + if (i >= (SPRITEMAX -1)) break; + sp = sact.sp[i]; + oldstate = sp->show; + + sp->show = (sShow == 1 ? TRUE : FALSE); + } + return OK; +} + +// 表示位置の設定 +int sp_set_pos(int wNum, int wX, int wY) { + sprite_t *sp; + + sp_assert_no(wNum); + + sp = sact.sp[wNum]; + sp->loc.x = wX - sact.origin.x; + sp->loc.y = wY - sact.origin.y; + sp->cur.x = sp->loc.x; + sp->cur.y = sp->loc.y; + return OK; + +} + +// スプライトの移動 +int sp_set_move(int wNum, int wX, int wY) { + sprite_t *sp; + + sp_assert_no(wNum); + + sp = sact.sp[wNum]; + sp->move.to.x = wX - sact.origin.x; + sp->move.to.y = wY - sact.origin.y; + + if (sp->move.time == 0) { + sp->move.time = -1; + sp->move.speed = 100; + } + + sp->cur = sp->loc; + + // moveするスプライトリストに登録 + // 実際に move を開始するのは ~SP_DRAW(sp_update_all)が呼ばれたとき + sact.movelist = g_slist_append(sact.movelist, sp); + + return OK; +} + +// スプライト移動時間の設定 +int sp_set_movetime(int wNum, int wTime) { + sp_assert_no(wNum); + + sact.sp[wNum]->move.time = wTime * 10; + return OK; +} + +// スプライト移動速度の設定 +int sp_set_movespeed(int wNum, int wTime) { + sp_assert_no(wNum); + + if (wTime == 0) wTime = 1; + + sact.sp[wNum]->move.speed = wTime ; + sact.sp[wNum]->move.time = -1; + + return OK; +} + +// Zキーを押したときに隠すスプライトの登録 +int sp_add_zkey_hidesprite(int wNum) { + sprite_t *sp; + + sp_assert_no(wNum); + sp = sact.sp[wNum]; + + // 登録時点でまだ生成していないスプライトは隠さない + // シェルクレイルでまずいのがあったので中止 + // if (sp->type == SPRITE_NONE) return NG; + + sact.sp_zhide = g_slist_append(sact.sp_zhide, sp); + return OK; +} + +// 上で登録したスプライトの削除 +int sp_clear_zkey_hidesprite_all() { + g_slist_free(sact.sp_zhide); + sact.sp_zhide = NULL; + return OK; +} + +// スプライト状態の固化 +int sp_freeze_sprite(int wNum, int wIndex) { + sprite_t *sp; + void *oldstate; + + sp_assert_no(wNum); + + sp = sact.sp[wNum]; + sp->freezed_state = wIndex; + + oldstate = (void *)sp->curcg; + switch(wIndex) { + case 1: + sp->curcg = sp->cg1; break; + case 2: + sp->curcg = sp->cg2; break; + case 3: + sp->curcg = sp->cg3; break; + } + return OK; +} + +// 上で固化した状態の解除 +int sp_thaw_sprite(int wNum) { + sp_assert_no(wNum); + + sact.sp[wNum]->freezed_state = 0; + return OK; +} + +// SP_QUAKEで揺らすスプライトの登録 +int sp_add_quakesprite(int wNum) { + sp_assert_no(wNum); + + sact.sp_quake = g_slist_append(sact.sp_quake, sact.sp[wNum]); + return OK; +} + +// 上で登録したスプライトの削除 +int sp_clear_quakesprite_all() { + g_slist_free(sact.sp_quake); + sact.sp_quake = NULL; + return OK; +} + +// アニメーションスプライトの間隔の設定 +int sp_set_animeinterval(int wNum, int wTime) { + sp_assert_no(wNum); + + if (sact.sp[wNum]->type != SPRITE_ANIME) return NG; + + sact.sp[wNum]->u.anime.interval = wTime * 10; + + return OK; +} + +// スプライトのブレンド率の設定 +int sp_set_blendrate(int wNum, int wCount, int rate) { + int i; + sprite_t *sp; + + sp_assert_no(wNum); + + for (i = wNum; i < (wNum + wCount); i++) { + if (i >= (SPRITEMAX -1)) break; + sp = sact.sp[i]; + sp->blendrate = rate; + } + + return OK; +} + +// スプライトが create されているかどうかの取得 +int sp_query_isexist(int wNum, int *ret) { + if (wNum >= SPRITEMAX) goto errexit; + if (sact.sp[wNum]->type == SPRITE_NONE) goto errexit; + + *ret = 1; + return OK; + + errexit: + *ret = 0; + return NG; +} + +// スプライトのタイプと何番のCGがセットされているかの取得 +int sp_query_info(int wNum, int *vtype, int *vcg1, int *vcg2, int *vcg3) { + sprite_t *sp; + + if (wNum >= SPRITEMAX) goto errexit; + + sp = sact.sp[wNum]; + if (sp->type == SPRITE_NONE) goto errexit; + + *vtype = sp->type; + *vcg1 = sp->cg1 ? sp->cg1->no : 0; + *vcg2 = sp->cg2 ? sp->cg2->no : 0; + *vcg3 = sp->cg3 ? sp->cg3->no : 0; + + return OK; + + errexit: + *vtype = 0; + *vcg1 = 0; + *vcg2 = 0; + *vcg3 = 0; + return NG; +} + +// スプライトの表示状態の取得 +int sp_query_show(int wNum, int *vShow) { + if (wNum >= SPRITEMAX) goto errexit; + if (sact.sp[wNum]->type == SPRITE_NONE) goto errexit; + + *vShow = sact.sp[wNum]->show ? 1: 0; + return OK; + + errexit: + *vShow = 0; + return NG; +} + +// スプライトの表示位置の取得 +int sp_query_pos(int wNum, int *vx, int *vy) { + if (wNum >= SPRITEMAX) goto errexit; + if (sact.sp[wNum]->type == SPRITE_NONE) goto errexit; + + *vx = sact.sp[wNum]->loc.x; + *vy = sact.sp[wNum]->loc.y; + return OK; + + errexit: + *vx = 0; + *vy = 0; + return NG; +} + +// スプライトの大きさの取得 +int sp_query_size(int wNum, int *vw, int *vh) { + sprite_t *sp; + + if (wNum >= SPRITEMAX) goto errexit; + + sp = sact.sp[wNum]; + + if (sp->type == SPRITE_NONE) goto errexit; + + *vw = sp->cursize.width; + *vh = sp->cursize.height; + + return OK; + + errexit: + *vw = 0; + *vh = 0; + return NG; +} + +// テキストスプライトの現在の文字表示位置の取得 +int sp_query_textpos(int wNum, int *vx, int *vy) { + if (wNum >= SPRITEMAX) goto errexit; + if (sact.sp[wNum]->type != SPRITE_MSG) goto errexit; + + *vx = sact.sp[wNum]->u.msg.dspcur.x; + *vy = sact.sp[wNum]->u.msg.dspcur.y; + return OK; + + errexit: + *vx = 0; + *vy = 0; + return NG; +} + +// NumeralXXXのCGのセット +int sp_num_setcg(int nNum, int nIndex, int nCG) { + sp_assert_no(nNum); + + sact.sp[nNum]->numeral.cg[nIndex] = nCG; + + return OK; +} + +// NumeralXXXのCGの取得 +int sp_num_getcg(int nNum, int nIndex, int *vCG) { + sp_assert_no(nNum); + + *vCG = sact.sp[nNum]->numeral.cg[nIndex]; + + return OK; +} + +// NumeralXXXの位置のセット +int sp_num_setpos(int nNum, int nX, int nY) { + sp_assert_no(nNum); + + sact.sp[nNum]->numeral.pos.x = nX; + sact.sp[nNum]->numeral.pos.y = nY; + + return OK; +} + +// NumeralXXXの位置の取得 +int sp_num_getpos(int nNum, int *vX, int *vY) { + sp_assert_no(nNum); + + *vX = sact.sp[nNum]->numeral.pos.x; + *vY = sact.sp[nNum]->numeral.pos.y; + + return OK; +} + +// NumeralXXXのスパンのセット +int sp_num_setspan(int nNum, int nSpan) { + sp_assert_no(nNum); + + sact.sp[nNum]->numeral.span = nSpan; + + return OK; +} + +// NumeralXXXのスパンの取得 +int sp_num_getspan(int nNum, int *vSpan) { + sp_assert_no(nNum); + + *vSpan = sact.sp[nNum]->numeral.span; + + return OK; +} + +// すべての説明スプライトの削除 +int sp_exp_clear() { + GSList *node; + + for (node = sact.updatelist; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + if (sp == NULL) continue; + sp_exp_del(sp->no); + } + + return OK; +} + +// 説明スプライトの登録 +int sp_exp_add(int nNumSP1, int nNumSP2) { + sprite_t *swsp, *expsp; + sp_assert_no(nNumSP1); + sp_assert_no(nNumSP2); + + swsp = sact.sp[nNumSP1]; + expsp = sact.sp[nNumSP2]; + + swsp->expsp = g_slist_append(swsp->expsp, expsp); + + return OK; +} + +// 説明スプライトの削除 +int sp_exp_del(int nNum) { + sprite_t *sp; + + sp_assert_no(nNum); + + sp = sact.sp[nNum]; + + g_slist_free(sp->expsp); + sp->expsp = NULL; + + return OK; +} + +// スプライトサウンドのセット +int sp_sound_set(int wNumSP, int wNumWave1, int wNumWave2, int wNumWave3) { + sprite_t *sp; + + sp_assert_no(wNumSP); + + sp = sact.sp[wNumSP]; + sp->numsound1 = wNumWave1; + sp->numsound2 = wNumWave2; + sp->numsound3 = wNumWave3; + + return OK; +} + +// すべてのスプライトサウンドの終了を待つ +int sp_sound_wait() { + WARNING("NOT IMPLEMENTED\n"); + return OK; +} + +// 範囲外をクリックしたときのサウンドの設定 +int sp_sound_ob(int wNumWave) { + sact.numsoundob = wNumWave; + return OK; +} + +/** + * 指定の座標が現在のスプライトの位置の範囲に入っているか? + * @param sp: 調べる対象のスプライト + * @param x,y: 座標 + * @return: TRUE:入っている, FALSE: 入っていない + */ +boolean sp_is_insprite(sprite_t *sp, int x, int y) { + BYTE *dp; + + if (x < 0 || y < 0 || x >= sf0->width || y >= sf0->height) return FALSE; + + dp = GETOFFSET_PIXEL(sact.dmap, x, y); + return (*(WORD *)dp == sp->no); +} diff --git a/modules/SACT/sprite.h b/modules/SACT/sprite.h new file mode 100644 index 0000000..9379384 --- /dev/null +++ b/modules/SACT/sprite.h @@ -0,0 +1,151 @@ +/* + * sprite.h: スプライト基本各種処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite.h,v 1.3 2003/07/14 16:22:51 chikama Exp $ */ + +#ifndef __SPRITE_H__ +#define __SPRITE_H__ + +#include +#include "sact.h" + +#define DEFAULT_UPDATE sp_draw + +// in sprite.c +extern int sp_init(); +extern int sp_new(int no, int cg1, int cg2, int cg3, int type); +extern int sp_new_msg(int no, int x, int y, int width, int height); +extern int sp_set_wall_paper(int no); +extern int sp_free_all(); +extern int sp_free(int no); +extern int sp_set_show(int no, int cnt, int flag); +extern int sp_set_pos(int wNum, int wX, int wY); +extern int sp_set_move(int wNum, int wX, int wY); +extern int sp_set_movetime(int wNum, int wTime); +extern int sp_set_movespeed(int wNum, int wTime); +extern int sp_add_zkey_hidesprite(int wNum); +extern int sp_clear_zkey_hidesprite_all(); +extern int sp_freeze_sprite(int wNum, int wIndex); +extern int sp_thaw_sprite(int wNum); +extern int sp_add_quakesprite(int wNum); +extern int sp_clear_quakesprite_all(); +extern int sp_set_animeinterval(int wNum, int wTime); +extern boolean sp_is_insprite(sprite_t *sp, int x, int y); +extern int sp_set_blendrate(int wNum, int wCount, int rate); +extern int sp_query_isexist(int wNum, int *ret); +extern int sp_query_info(int wNum, int *vtype, int *vcg1, int *vcg2, int *vcg3); +extern int sp_query_show(int wNum, int *vShow); +extern int sp_query_pos(int wNum, int *vx, int *vy); +extern int sp_query_size(int wNum, int *vw, int *vh); +extern int sp_query_textpos(int wNum, int *vx, int *vy); +extern int sp_num_setcg(int nNum, int nIndex, int nCG); +extern int sp_num_getcg(int nNum, int nIndex, int *vCG); +extern int sp_num_setpos(int nNum, int nX, int nY); +extern int sp_num_getpos(int nNum, int *vX, int *vY); +extern int sp_num_setspan(int nNum, int nSpan); +extern int sp_num_getspan(int nNUm, int *vSpan); +extern int sp_exp_clear(); +extern int sp_exp_add(int nNumSP1, int nNumSP2); +extern int sp_exp_del(int wNum); +extern int sp_sound_set(int wNumSP, int wNumWave1, int wNumWave2, int wNumWave3); +extern int sp_sound_wait(); +extern int sp_sound_ob(int wNumWave); + + +// in sprite_update.c +extern int sp_update_all(boolean syncscreen); +extern int sp_update_clipped(); +extern int sp_updateme(sprite_t *sp); +extern int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h); + + +// in sprite_draw.c +extern int sp_draw(sprite_t *sf); +extern int sp_draw2(sprite_t *sf, cginfo_t *cg); +extern void sp_draw_dmap(gpointer data, gpointer userdata); + + +// in sprite_msg.c +extern void smsg_add(char *msg); +extern void smsg_newline(int wNum, int size); +extern void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace, int wAlign, int wRSize, int wRFont, int wRLineSpace, int *wLength); +extern void smsg_clear(int wNum); +extern int smsg_is_empty(); +extern int smsg_keywait(int sp1, int sp2, int timeout); +extern int smsg_update(sprite_t *sp); + +// in sprite_sel.c +extern void ssel_init(); +extern void ssel_clear(); +extern void ssel_add(int nString, int wI); +extern int ssel_select(int wNum, int wChoiceSize, int wMenuOutSpc, int wChoiceLineSpace, int wChoiceAutoMoveCursor, int nAlign); + +// in sprite_event.c +extern void spev_callback(agsevent_t *e); +extern void spev_add_eventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)); +extern void spev_remove_eventlistener(sprite_t *sp); + +// in sprite_tevent.c +extern void spev_add_teventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)); +extern void spev_remove_teventlistener(sprite_t *sp); +extern void spev_main(); + +// in sprite_move.c +extern void spev_move_setup(gpointer data, gpointer userdata); +extern void spev_move_waitend(sprite_t *sp, int dx, int dy, int time); +extern void spev_wait4moving_sp(); + +// in sprite_switch.c +extern int sp_sw_setup(sprite_t *sp); + +// in sprite_get.c +extern int sp_get_setup(sprite_t *sp); + +// in sprite_put.c +extern int sp_put_setup(sprite_t *sp); + +// in sprite_anime.c +extern int sp_anime_setup(sprite_t *sp); + +// in sprite_eupdate.c +extern int sp_eupdate(int type, int time, int key); + +// in sprite_quake.c +extern int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitude, int wCount, int cancel); + +// in sprite_keywait.c +extern int sp_keywait(int *vOK, int *vRND, int *vRsv1, int *vRsv2, int *vRsv3, int timeout); + +// in screen_quake.c +extern int sp_quake_screen(int type, int p1, int p2, int time, int cancel); + +// in sactamask.c +extern int sp_eupdate_amap(int type, int time, int key); + +// in sprite_xmenu.c +extern int spxm_clear(void); +extern int spxm_register(int reginum, int menuid); +extern int spxm_getnum(int reginum); +extern int spxm_gettext(int regnum, int strno); +extern int spxm_titlereg(void); +extern int spxm_titleget(int strno); + +#endif /* __SPRITE_H__ */ diff --git a/modules/SACT/sprite_anime.c b/modules/SACT/sprite_anime.c new file mode 100644 index 0000000..6fca931 --- /dev/null +++ b/modules/SACT/sprite_anime.c @@ -0,0 +1,102 @@ +/* + * sprite_anime.c: アニメーションスプライト特有の処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_anime.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "ags.h" +#include "counter.h" +#include "sact.h" +#include "sprite.h" + +static int eventCB_ANIM(sprite_t *sp, agsevent_t *e); +static void cb_remove(sprite_t *sp); + + +// アニメーションスプライト +static int eventCB_ANIM(sprite_t *sp, agsevent_t *e) { + int now; + + // コールバックがタイマイベントかどうか + if (e->type != AGSEVENT_TIMER) return 0; + + // 現在時刻の取得 + now = get_high_counter(SYSTEMCOUNTER_MSEC); + + // 指定時間までスキップ + if ((now - sp->u.anime.starttime) < sp->u.anime.interval) return 0; + + // 新しい時間を保存 + sp->u.anime.starttime = now; + + // 次に表示するCGをセット + switch(sp->u.anime.tick % sp->u.anime.npat) { + case 0: + sp->curcg = sp->cg1; break; + case 1: + sp->curcg = sp->cg2; break; + case 2: + sp->curcg = sp->cg3; break; + } + + // WARNING("anime update\n"); + + // カウントアップ + sp->u.anime.tick++; + + sp_updateme(sp); + + return 1; +} + +// スプライト削除時の処理 +static void cb_remove(sprite_t *sp) { + spev_remove_teventlistener(sp); +} + +/* + sp_new の時にスプライトの種類毎の初期化 + @param sp: 初期化するスプライト +*/ +int sp_anime_setup(sprite_t *sp) { + int n = 0; + + sp->u.anime.interval = 500; // デフォルトの間隔 0.5秒 + sp->u.anime.starttime = get_high_counter(SYSTEMCOUNTER_MSEC); // 開始時刻 + sp->u.anime.tick = 0; // カウンタ初期化 + + // アニメパターンはいくつあるか + if (sp->cg1) n++; + if (sp->cg2) n++; + if (sp->cg3) n++; + sp->u.anime.npat = n; + + spev_add_teventlistener(sp, eventCB_ANIM); + sp->remove = cb_remove; + + return OK; +} diff --git a/modules/SACT/sprite_draw.c b/modules/SACT/sprite_draw.c new file mode 100644 index 0000000..fea574d --- /dev/null +++ b/modules/SACT/sprite_draw.c @@ -0,0 +1,186 @@ +/* + * sprite_draw.c: スプライト再描画各種 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_draw.c,v 1.4 2004/10/31 04:18:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "ags.h" +#include "graphics.h" +#include "sact.h" +#include "surface.h" +#include "ngraph.h" +#include "sprite.h" + +static void fill_dmap(int dx ,int dy, int w, int h, WORD val); +static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w, int h, WORD val); + + + +// 矩形の depthmap を描画 +static void fill_dmap(int dx ,int dy, int w, int h, WORD val) { + BYTE *dp, *dp_; + int x, y; + + dp = dp_ = (GETOFFSET_PIXEL(sact.dmap, dx, dy)); + + for (x = 0; x < w; x++) { + *((WORD *)dp + x) = val; + } + dp += sact.dmap->bytes_per_line; + + for (y = 1; y < h; y++) { + memcpy(dp, dp_, w * 2); + dp += sact.dmap->bytes_per_line; + } +} + +// alphamapにしたがって、alpha値が0より大きいところを指定のdepthとする +static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w, int h, WORD val) { + BYTE *sp, *dp; + int x, y; + + dp = GETOFFSET_PIXEL(sact.dmap, dx, dy); + sp = GETOFFSET_ALPHA(src, sx, sy); + + for (y = 0; y < h; y++) { + BYTE *yls = (BYTE *)(sp + y * src->width); + WORD *yld = (WORD *)(dp + y * sact.dmap->bytes_per_line); + for (x = 0; x < w; x++) { + if (*yls > 0) *yld = val; + yls++; yld++; + } + } +} + +/* + 指定の sprite (の現在のCG)を surface0 に書く + @param sp: 描画するスプライト +*/ +int sp_draw(sprite_t *sp) { + if (sp == NULL) return NG; + + return sp_draw2(sp, sp->curcg); +} + +/* + 指定の spriteの指定のCGを surface0 に書く + (このインターフェイスはもう不要?) + + @param sp: 描画するスプライト + @param cg: 描画するCG +*/ +int sp_draw2(sprite_t *sp, cginfo_t *cg) { + surface_t update; + int sx, sy, w, h, dx, dy; + + if (cg == NULL) return NG; + if (cg->sf == NULL) return NG; + + // 更新領域の確定 + update.width = sact.updaterect.width; + update.height = sact.updaterect.height; + sx = 0; + sy = 0; + dx = sp->cur.x - sact.updaterect.x; + dy = sp->cur.y - sact.updaterect.y; + w = cg->sf->width; + h = cg->sf->height; + + if (!gr_clip(cg->sf, &sx, &sy, &w, &h, &update, &dx, &dy)) { + return NG; + } + + dx += sact.updaterect.x; + dy += sact.updaterect.y; + + if (cg->sf->has_alpha) { + // alpha map がある場合 + gre_BlendUseAMap(sf0, dx, dy, + sf0, dx, dy, + cg->sf, sx, sy, w, h, + cg->sf, sx, sy, + sp->blendrate); + } else { + if (sp->blendrate == 255) { + // alpha値指定が無い場合 + gr_copy(sf0, dx, dy, cg->sf, sx, sy, w, h); + } else if (sp->blendrate > 0) { + // alpha値指定がある場合 + gre_Blend(sf0, dx, dy, + sf0, dx, dy, + cg->sf, sx, sy, w, h, + sp->blendrate); + } + } + + WARNING("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n", sp->no, sx, sy, w, h, dx, dy); + + return OK; +} + +/* + スプライトキー待ち用のdepthmap を更新 +*/ +void sp_draw_dmap(gpointer data, gpointer userdata) { + sprite_t *sp = (sprite_t *)data; + cginfo_t *cg; + surface_t update; + int sx, sy, w, h, dx, dy; + + // 非表示状態の時は無視 + if (!sp->show) return; + + // ドラッグ中のスプライトは無視 + if (sp == sact.draggedsp) return; + + cg = sp->curcg; + if (cg == NULL) return; + if (cg->sf == NULL) return; + + // depth map を書く領域を確定 + update.width = sf0->width; + update.height = sf0->height; + sx = 0; + sy = 0; + dx = sp->cur.x; + dy = sp->cur.y; + w = cg->sf->width; + h = cg->sf->height; + + if (!gr_clip(cg->sf, &sx, &sy, &w, &h, &update, &dx, &dy)) { + return; + } + + if (cg->sf->has_alpha) { + fill_dmap_mask(cg->sf, sx, sy, dx, dy, w, h, sp->no); + } else { + fill_dmap(dx, dy, w, h, sp->no); + } + + return; +} diff --git a/modules/SACT/sprite_eupdate.c b/modules/SACT/sprite_eupdate.c new file mode 100644 index 0000000..f8f7892 --- /dev/null +++ b/modules/SACT/sprite_eupdate.c @@ -0,0 +1,455 @@ +/* + * sprite_eupdate.c: 効果つき更新 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_eupdate.c,v 1.5 2003/07/20 19:30:16 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "ngraph.h" +#include "ags.h" +#include "nact.h" +#include "imput.h" +#include "sact.h" +#include "sprite.h" +#include "surface.h" +#include "sactcg.h" +#include "counter.h" + + + +static void ec1_cb(surface_t *, surface_t *); +static void ec6_cb(surface_t *, surface_t *); +static void ec7_cb(surface_t *, surface_t *); +static void ec8_cb(surface_t *, surface_t *); +static void ec9_cb(surface_t *, surface_t *); +static void ec11_cb(surface_t *, surface_t *); +static void ec12_cb(surface_t *, surface_t *); +static void ec13_cb(surface_t *, surface_t *); +static void ec14_cb(surface_t *, surface_t *); +static void ec15_cb(surface_t *, surface_t *); +static void ec16_cb(surface_t *, surface_t *); +static void ec17_cb(surface_t *, surface_t *); +static void ec_dummy_cb(surface_t *, surface_t *); + +struct ecopyparam { + int sttime; + int curtime; + int edtime; + int curstep; + int oldstep; +}; +typedef struct ecopyparam ecopyparam_t; +static ecopyparam_t ecp; + +#include "sprite_eupdate_perspect.c" +#include "sprite_eupdate_mosaic.c" +#include "sprite_eupdate_aff.c" +#include "sprite_eupdate_uneune.c" +#include "sprite_eupdate_buller.c" +#include "sprite_eupdate_zmbbul.c" + +typedef void entrypoint (surface_t *, surface_t *); + +static entrypoint *cb[39] = { + ec1_cb, + ec_dummy_cb, // 欠番 + ec_dummy_cb, // 欠番 + ec_dummy_cb, // 欠番 + ec_dummy_cb, // 欠番 + ec6_cb, + ec7_cb, + ec8_cb, + ec9_cb, + ec10_cb, + ec11_cb, + ec12_cb, + ec13_cb, + ec14_cb, + ec15_cb, + ec16_cb, + ec17_cb, + ec_dummy_cb, // 欠番 + ec19_cb, + ec20_cb, + ec21_cb, + ec22_cb, + ec23_cb, + ec_dummy_cb, + ec25_cb, + ec26_cb, + ec_dummy_cb, + ec28_cb, + ec29_cb, + ec_dummy_cb, + ec31_cb, + ec_dummy_cb, + ec_dummy_cb, + ec_dummy_cb, + ec_dummy_cb, // 35 + ec_dummy_cb, + ec_dummy_cb, + ec_dummy_cb, + ec_dummy_cb +}; + +static void ec_dummy_cb(surface_t *sfsrc, surface_t *sfdst) { + WARNING("NOT IMPLEMENTED\n"); +} + +// クロスフェード +static void ec1_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep; + + curstep = 255 * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + gre_Blend(sf0, 0, 0, sfsrc, 0, 0, sfdst, 0, 0, sfsrc->width, sfsrc->height, curstep); + + WARNING("step = %d\n", curstep); + ags_updateFull(); + + ecp.oldstep = curstep; +} + +// すだれ落ち +static void ec7_cb(surface_t *sfsrc, surface_t *sfdst) { +#define EC7DELTA 16 + int curstep, maxstep = sfsrc->height / EC7DELTA + EC7DELTA; + int i, t, y; + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + t = ecp.oldstep; + while(t < curstep) { + for (i = 0; i < MIN(t + 1, EC7DELTA); i++) { + y = i + EC7DELTA * (t - i); + if (y < 0 || y >= sfsrc->height) continue; + gr_copy(sf0, 0, y, + sfdst, 0, y, sfsrc->width, 1); + } + t++; + } + + ecp.oldstep = curstep; + ags_updateFull(); +} + +// すだれ左->右 +static void ec8_cb(surface_t *sfsrc, surface_t *sfdst) { +#define EC8DELTA 16 + int curstep, maxstep = sfsrc->width / EC8DELTA + EC8DELTA; + int i, t, x; + + curstep = maxstep * (ecp.curtime - ecp.sttime) / (ecp.edtime - ecp.sttime); + WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + t = ecp.oldstep; + while(t < curstep) { + for (i = 0; i < MIN(t + 1, EC8DELTA); i++) { + x = i + EC8DELTA * (t - i); + if (x < 0 || x >= sfsrc->width) continue; + gr_copy(sf0, x, 0, + sfdst, x, 0, 1, sfsrc->height); + } + t++; + } + + ecp.oldstep = curstep; + ags_updateFull(); +} + +// すだれ落ち&左->右 +static void ec9_cb(surface_t *sfsrc, surface_t *sfdst) { +#define EC9DELTA 16 + int curstep, maxstep; + int i, t, x, y; + + maxstep = MAX(sfsrc->height / EC9DELTA + EC9DELTA, + sfsrc->width / EC9DELTA + EC9DELTA); + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + t = ecp.oldstep; + while(t < curstep) { + for (i = 0; i < MIN(t + 1, EC9DELTA); i++) { + y = i + EC9DELTA * (t - i); + if (y < 0 || y >= sfsrc->height) continue; + gr_copy(sf0, 0, y, + sfdst, 0, y, sfsrc->width, 1); + } + for (i = 0; i < MIN(t + 1, EC9DELTA); i++) { + x = i + EC9DELTA * (t - i); + if (x < 0 || x >= sfsrc->width) continue; + gr_copy(sf0, x, 0, + sfdst, x, 0, 1, sfsrc->height); + } + t++; + } + + ecp.oldstep = curstep; + ags_updateFull(); +} + +// 上->下クロスフェード +static void ec12_cb(surface_t *src, surface_t *dst) { +#define EC12DELTA 256 + int curstep, maxstep = src->height + EC12DELTA; + int j, st_i, ed_i, l; + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); return; + } + + st_i = MAX(0, curstep - EC12DELTA + 1); + ed_i = MIN(src->height -1, curstep); + l = ed_i - st_i + 1; + for (j = st_i; j < ed_i; j++) { + gre_Blend(sf0, 0, j, src, 0, j, dst, 0, j, src->width, 1, curstep - j); + } + if ((st_i - ecp.oldstep) > 1) { + gr_copy(sf0, 0, ecp.oldstep, dst, 0, ecp.oldstep, src->width, st_i - ecp.oldstep); + ags_updateArea(0, ecp.oldstep, src->width, st_i - ecp.oldstep); + } + + ags_updateArea(0, st_i, src->width, l); + ecp.oldstep = st_i; +} + +// 下->上クロスフェード +static void ec13_cb(surface_t *src, surface_t *dst) { +#define EC13DELTA 256 + int curstep, maxstep = src->height + EC12DELTA; + int j, st_i, ed_i, l; + int syy1 = 0 + dst->height -1; + int syy2 = 0 + src->height -1; + int dyy = 0 + sf0->height -1; + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + WARNING("step = %d\n", curstep); + + if (ecp.oldstep == curstep) { + usleep(0); return; + } + + st_i = MAX(0, curstep - EC13DELTA + 1); + ed_i = MIN(src->height -1, curstep); + l = ed_i - st_i + 1; + for (j = st_i; j < ed_i; j++) { + gre_Blend(sf0, 0, dyy - j, src, 0, syy1-j, dst, 0, syy2-j, src->width, 1, curstep - j); + } + if ((st_i - ecp.oldstep) > 1) { + gr_copy(sf0, 0, dyy-ecp.oldstep, dst, 0, syy2-ecp.oldstep, src->width, st_i - ecp.oldstep); + ags_updateArea(0, dyy-ecp.oldstep, src->width, st_i - ecp.oldstep); + } + + ags_updateArea(0, dyy-ed_i, src->width, l); + ecp.oldstep = st_i; +} + +// 五芒星 (内->外) +static void ec14_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 44, curstep); + ecp.oldstep = curstep; +} + +// 五芒星 (外->内) +static void ec15_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 45, curstep); + ecp.oldstep = curstep; +} + +// 六芒星 (内->外) +static void ec16_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 46, curstep); + ecp.oldstep = curstep; +} + +// 六芒星 (外->内) +static void ec17_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + maxstep = 256; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + + if (ecp.oldstep == 0) { + sf_copyall(sf0, sfdst); + } + Maskupdate(0, 0, sfsrc->width, sfsrc->height, 0, 0, 47, curstep); + ecp.oldstep = curstep; +} + + + +//ブロックディゾルブ +static void ec24_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// 振動 +static void ec27_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// 回転ズームブレンドブラー(SRCのみ参照 +static void ec30_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// TVスイッチオフ(Destのみ参照) +static void ec32_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// TVスイッチオン(Srcのみ参照) +static void ec33_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// ポリゴン爆発 +static void ec34_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// ノイズクロスフェード +static void ec35_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// ページめくり +static void ec36_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// セピアノイズクロスフェード +static void ec37_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// ぐしゃぐしゃ紙右下ひっぱり +static void ec38_cb(surface_t *sfsrc, surface_t *sfdst) { +} + +// 横うねうね +static void ec39_cb(surface_t *sfsrc, surface_t *sfdst) { +} + + +/* + 効果つき画面更新 + @param type: 効果の種類 + @param time: 実行時間 + @param cancel: キー抜け(0:なし, 1:あり) +*/ +int sp_eupdate(int type, int time, int cancel) { + surface_t *sfsrc, *sfdst; + int key; + + if (sact.waitskiplv > 1) { + sp_update_all(TRUE); + return OK; + } + + // 現在の sf0 をセーブ + sfsrc = sf_dup(sf0); + + sp_update_all(FALSE); + + sfdst = sf_dup(sf0); + + sf_copyall(sf0, sfsrc); // 全部の効果タイプにこの処理は要らないんだけど + // 5つを越えたら別の方法を考えよう + if (type == 10) { + ec10_prepare(sfsrc, sfdst); + } + if (type == 11) { + ec11_prepare(sfsrc, sfdst); + } + if (type == 19) { + ec19_prepare(sfsrc, sfdst); + } + + ecp.sttime = ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC); + ecp.edtime = ecp.curtime + time*10; + ecp.oldstep = 0; + + while ((ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < ecp.edtime) { + int rest; + + (*cb[type-1])(sfsrc, sfdst); + rest = 15 - (get_high_counter(SYSTEMCOUNTER_MSEC) - ecp.curtime); + key = sys_keywait(rest, cancel); + + if (cancel && key) break; + } + + sf_copyall(sf0, sfdst); + ags_updateFull(); + sf_free(sfsrc); + sf_free(sfdst); + + if (type == 10) { + ec10_drain(sfsrc, sfdst); + } + if (type == 11) { + ec11_drain(sfsrc, sfdst); + } + if (type == 19) { + ec19_drain(sfsrc, sfdst); + } + + return OK; +} diff --git a/modules/SACT/sprite_eupdate_aff.c b/modules/SACT/sprite_eupdate_aff.c new file mode 100644 index 0000000..b6dde6e --- /dev/null +++ b/modules/SACT/sprite_eupdate_aff.c @@ -0,0 +1,103 @@ +// アフィン変換 (回転) + +static void do_aff(surface_t *in, surface_t *out, int deg, double zx, double zy) { + int xs = in->width / 2; + int ys = in->height / 2; + double r = deg * M_PI / 180; + double c = cos(r); + double s = sin(r); + double x, y; + int i, j, m, n; + + switch(in->depth) { + case 15: + case 16: { + WORD *src, *dst; + + for (i = -ys; i < ys; i++) { + for (j = -xs; j < xs; j++) { + y = (j * s + i * c) / zy; + x = (j * c - i * s) / zx; + if (y > 0) m = (int)y; + else m = (int)(y -1); + if (x > 0) n = (int)x; + else n = (int)(x -1); + src = (WORD *)GETOFFSET_PIXEL(in, n+xs, m+ys); + dst = (WORD *)GETOFFSET_PIXEL(out, j+xs, i+ys); + if ((m >= -ys) && (m < ys) && (n >= -xs) && (n < xs)) { + *dst = *src; + } + } + } + break; + } + case 24: + case 32: { + DWORD *src, *dst; + + for (i = -ys; i < ys; i++) { + for (j = -xs; j < xs; j++) { + y = (j * s + i * c) / zy; + x = (j * c - i * s) / zx; + if (y > 0) m = (int)y; + else m = (int)(y -1); + if (x > 0) n = (int)x; + else n = (int)(x -1); + src = (DWORD *)GETOFFSET_PIXEL(in, n+xs, m+ys); + dst = (DWORD *)GETOFFSET_PIXEL(out, j+xs, i+ys); + if ((m >= -ys) && (m < ys) && (n >= -xs) && (n < xs)) { + *dst = *src; + } + } + } + break; + }} +} + + + +//回転アウト +static void ec20_cb(surface_t *sfsrc, surface_t *sfdst) { + //1回転だけ + int maxstep, curstep; + maxstep = 360; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + sf_copyall(sf0, sfdst); + do_aff(sfsrc, sf0, curstep, 1- (double)curstep / maxstep, 1- (double)curstep / maxstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + +//回転イン +static void ec21_cb(surface_t *sfsrc, surface_t *sfdst) { + int maxstep, curstep; + maxstep = 360; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + sf_copyall(sf0, sfsrc); + do_aff(sfdst, sf0, curstep, (double)curstep / maxstep, (double)curstep / maxstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + +//回転アウト(時計回り) +static void ec22_cb(surface_t *sfsrc, surface_t *sfdst) { + int maxstep, curstep; + maxstep = 360; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + sf_copyall(sf0, sfdst); + do_aff(sfsrc, sf0, -curstep, 1- (double)curstep / maxstep, 1- (double)curstep / maxstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + +//回転イン(時計回り) +static void ec23_cb(surface_t *sfsrc, surface_t *sfdst) { + int maxstep, curstep; + maxstep = 360; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + sf_copyall(sf0, sfsrc); + do_aff(sfdst, sf0, -curstep, (double)curstep / maxstep, (double)curstep / maxstep); + ags_updateFull(); + ecp.oldstep = curstep; +} + diff --git a/modules/SACT/sprite_eupdate_buller.c b/modules/SACT/sprite_eupdate_buller.c new file mode 100644 index 0000000..1643b0a --- /dev/null +++ b/modules/SACT/sprite_eupdate_buller.c @@ -0,0 +1,66 @@ +// 11 と 19 で共有 +static surface_t *ec11_ss[6]; +static surface_t *ec11_sd[6]; + +// 線形ブラー +static void ec11_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep = 6; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + if (curstep < 6) { + gre_Blend(sf0, 0, 0, ec11_ss[curstep], 0, 0, ec11_sd[5-curstep], 0, 0, sfsrc->width, sfsrc->height, (curstep+1)*256/7); + ags_updateFull(); + } +} + +static void ec11_prepare(surface_t *src, surface_t *dst) { + int i; + + ec11_ss[0] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[0] = sf_create_surface(src->width, src->height, src->depth); + gr_buller(ec11_ss[0], 0, 0, src, 0, 0, src->width, src->height, 1 << 2); + gr_buller(ec11_sd[0], 0, 0, dst, 0, 0, dst->width, dst->height, 1 << 2); + for (i = 1; i < 6; i++) { + ec11_ss[i] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[i] = sf_create_surface(dst->width, dst->height, dst->depth); + gr_buller(ec11_ss[i], 0, 0, ec11_ss[i-1], 0, 0, src->width, src->height, 1 << (i+2)); + gr_buller(ec11_sd[i], 0, 0, ec11_sd[i-1], 0, 0, dst->width, dst->height, 1 << (i+2)); + } +} + +static void ec11_drain(surface_t *src, surface_t *dst) { + int i; + + for (i = 0; i < 6; i++) { + sf_free(ec11_ss[i]); + sf_free(ec11_sd[i]); + } +} + +// 縦線形ブラー +static void ec19_cb(surface_t *sfsrc, surface_t *sfdst) { + ec11_cb(sfsrc, sfdst); +} + +static void ec19_prepare(surface_t *src, surface_t *dst) { + int i; + + ec11_ss[0] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[0] = sf_create_surface(src->width, src->height, src->depth); + gr_buller_v(ec11_ss[0], 0, 0, src, 0, 0, src->width, src->height, 1 << 2); + gr_buller_v(ec11_sd[0], 0, 0, dst, 0, 0, dst->width, dst->height, 1 << 2); + for (i = 1; i < 6; i++) { + ec11_ss[i] = sf_create_surface(src->width, src->height, src->depth); + ec11_sd[i] = sf_create_surface(dst->width, dst->height, dst->depth); + gr_buller_v(ec11_ss[i], 0, 0, ec11_ss[i-1], 0, 0, src->width, src->height, 1 << (i+2)); + gr_buller_v(ec11_sd[i], 0, 0, ec11_sd[i-1], 0, 0, dst->width, dst->height, 1 << (i+2)); + } +} + +static void ec19_drain(surface_t *src, surface_t *dst) { + int i; + + for (i = 0; i < 6; i++) { + sf_free(ec11_ss[i]); + sf_free(ec11_sd[i]); + } +} diff --git a/modules/SACT/sprite_eupdate_mosaic.c b/modules/SACT/sprite_eupdate_mosaic.c new file mode 100644 index 0000000..5b4e901 --- /dev/null +++ b/modules/SACT/sprite_eupdate_mosaic.c @@ -0,0 +1,31 @@ + + + +// クロスフェードモザイク +static void ec6_cb(surface_t *src, surface_t *dst) { + int curstep, maxstep = 32; + surface_t *st, *dt; + static int slices[32]={4,8,12,16,20,28,36,40,44,48,56,64,72,80,88,96, + 88,80,72,64,56,48,44,40,36,28,24,20,16,12,8,4}; + + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + if (ecp.oldstep == curstep) { + usleep(0); + return; + } + st = sf_dup(src); + dt = sf_dup(dst); + + image_Mosaic(st, 0, 0, st->width, st->height, 0, 0, slices[curstep]); + image_Mosaic(dt, 0, 0, dt->width, dt->height, 0, 0, slices[curstep]); + + gre_Blend(sf0, 0, 0, st, 0, 0, dt, 0, 0, st->width, st->height, curstep*8); + ags_updateFull(); + + sf_free(st); + sf_free(dt); + + ecp.oldstep = curstep; +} + diff --git a/modules/SACT/sprite_eupdate_perspect.c b/modules/SACT/sprite_eupdate_perspect.c new file mode 100644 index 0000000..4526d3c --- /dev/null +++ b/modules/SACT/sprite_eupdate_perspect.c @@ -0,0 +1,177 @@ +// 透視投影変換のうち、X軸とY軸周りの回転のみを考慮 +/* + X軸回転行列 1 0 0 0 + 0 cos sin 0 + 0 -sin cos 0 + 0 0 0 1 + + Y軸回転行列 cos 0 sin 0 + 0 1 0 0 + -sin 0 cos 0 + 0 0 0 1 + + 視点座標変換行列 (G) + 1 0 0 0 + 0 1 0 0 + 0 0 -1 0 + 0 0 t 1 , t = 1 + + 透視変換行列 (H) + 1 0 0 0 + 0 1 0 0 + 0 0 1/s 1/s + 0 0 -1 0 , s = 1 + + X軸回転 (ys = height/2) + k[1] = -sin(rx* M_PI / 180) / (float)ys; + k[2] = cos(rx* M_PI / 180); + k[3] = cos(rx* M_PI / 180); + k[7] = 1; + Y軸回転 (xs = width/2) + k[0] = sin(ry * M_PI / 180) / (float)xs; + k[2] = cos(ry * M_PI / 180); + k[3] = 1; + k[7] = cos(ry * M_PI / 180); + + +*/ +#include + +static void do_per(surface_t *in, surface_t *out, float *k) { + int i, j, m, n; + float x, y, w; + int xs = in->width /2; + int ys = in->height /2; + + switch(in->depth) { + case 15: + case 16: { + WORD *src, *dst; + + for (i = -ys; i < ys; i++) { + for (j = -xs; j < xs; j++) { + w = k[0] * j + k[1]*i + k[2]; + x = k[3] * j + k[4]*i + k[5]; + y = k[6] * j + k[7]*i + k[8]; + x = x / w; + y = y / w; + if (y > 0) m = (int)y; + else m = (int)(y -1); + if (x > 0) n = (int)x; + else n = (int)(x - 1); + + src = (WORD *)GETOFFSET_PIXEL( in, n+xs, m+ys); + dst = (WORD *)GETOFFSET_PIXEL(out, j+xs, i+ys); + if (( m >= -ys) && (m < ys) && (n >= -xs) && (n < xs)) { + *dst = *src; + } else { + *dst = 0; + } + } + } + break; + } + case 24: + case 32: { + DWORD *src, *dst; + + for (i = -ys; i < ys; i++) { + for (j = -xs; j < xs; j++) { + w = k[0] * j + k[1]*i + k[2]; + x = k[3] * j + k[4]*i + k[5]; + y = k[6] * j + k[7]*i + k[8]; + x = x / w; + y = y / w; + if (y > 0) m = (int)y; + else m = (int)(y -1); + if (x > 0) n = (int)x; + else n = (int)(x - 1); + + src = (DWORD *)GETOFFSET_PIXEL( in, n+xs, m+ys); + dst = (DWORD *)GETOFFSET_PIXEL(out, j+xs, i+ys); + if (( m >= -ys) && (m < ys) && (n >= -xs) && (n < xs)) { + *dst = *src; + } else { + *dst = 0; + } + } + } + break; + }} + +} + + +static void perspect_rotatex(surface_t *in, surface_t *out, double rx) { + float k[9] = {0.0}; + + k[1] = -sin(rx) / (in->height / 2.0); + k[2] = cos(rx); + k[3] = cos(rx); + k[7] = 1.0; + + do_per(in, out, k); +} + +static void perspect_rotatey(surface_t *in, surface_t *out, double ry) { + float k[9] = {0.0}; + + k[0] = sin(ry) / (in->width / 2.0); + k[2] = cos(ry); + k[3] = 1.0; + k[7] = cos(ry); + + do_per(in, out, k); +} + +// ポリゴン回転(Y軸・半計回り) +static void ec25_cb(surface_t *src, surface_t *dst) { + int curstep, maxstep; + maxstep = 180; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + if (curstep < 90) { + perspect_rotatey(src, sf0, -curstep * M_PI / 180); + } else { + perspect_rotatey(dst, sf0, (180 - curstep) * M_PI / 180); + } + ags_updateFull(); +} + +// ポリゴン回転(Y軸・計回り) +static void ec26_cb(surface_t *src, surface_t *dst) { + int curstep, maxstep; + maxstep = 180; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + if (curstep < 90) { + perspect_rotatey(src, sf0, curstep * M_PI / 180); + } else { + perspect_rotatey(dst, sf0, (curstep - 180) * M_PI / 180); + } + ags_updateFull(); +} + +// ポリゴン回転(X軸・時計回り) +static void ec28_cb(surface_t *src, surface_t *dst) { + int curstep, maxstep; + maxstep = 180; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + if (curstep < 90) { + perspect_rotatex(src, sf0, -curstep * M_PI / 180); + } else { + perspect_rotatex(dst, sf0, (180 - curstep) * M_PI / 180); + } + ags_updateFull(); +} + +// ポリゴン回転(X軸) +static void ec29_cb(surface_t *src, surface_t *dst) { + int curstep, maxstep; + maxstep = 180; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + if (curstep < 90) { + perspect_rotatex(src, sf0, curstep * M_PI / 180); + } else { + perspect_rotatex(dst, sf0, (curstep - 180) * M_PI / 180); + } + ags_updateFull(); +} diff --git a/modules/SACT/sprite_eupdate_uneune.c b/modules/SACT/sprite_eupdate_uneune.c new file mode 100644 index 0000000..2c3b7f9 --- /dev/null +++ b/modules/SACT/sprite_eupdate_uneune.c @@ -0,0 +1,68 @@ +static void uneune(surface_t *in, surface_t *out, int st) { + int r = 4 * st; + double th = 4 * st * M_PI; + int x, y, m, n; + + switch(in->depth) { + case 15: + case 16: { + WORD *src, *dst; + for (y = 0; y < in->height; y++) { + for (x = 0; x < in->width; x++) { + m = x + r * sin(y * th / in->height); + n = y + r * cos(x * th / in->width); + src = (WORD *)GETOFFSET_PIXEL(in, m, n); + dst = (WORD *)GETOFFSET_PIXEL(out, x, y); + if ((m > 0) && (m < in->width) && (n > 0) && (n < in->height)) { + *dst = *src; + } else { + *dst = 0; + } + } + } + } + case 24: + case 32: { + DWORD *src, *dst; + for (y = 0; y < in->height; y++) { + for (x = 0; x < in->width; x++) { + m = x + r * sin(y * th / in->height); + n = y + r * cos(x * th / in->width); + src = (DWORD *)GETOFFSET_PIXEL(in, m, n); + dst = (DWORD *)GETOFFSET_PIXEL(out, x, y); + if ((m > 0) && (m < in->width) && (n > 0) && (n < in->height)) { + *dst = *src; + } else { + *dst = 0; + } + } + } + }} +} + + + +// うねうねクロスフェード +static void ec31_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep; + surface_t *st, *dt; + + maxstep = 32; + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + st = sf_dup2(sfsrc, FALSE, FALSE); + dt = sf_dup2(sfdst, FALSE, FALSE); + + if (curstep < 16) { + uneune(sfsrc, st, curstep); + uneune(sfdst, dt, curstep); + gre_Blend(sf0, 0, 0, st, 0, 0, dt, 0, 0, st->width, st->height, curstep * 8); + } else { + uneune(sfsrc, st, 32-curstep); + uneune(sfdst, dt, 32-curstep); + gre_Blend(sf0, 0, 0, st, 0, 0, dt, 0, 0, st->width, st->height, curstep * 8); + } + sf_free(st); + sf_free(dt); + ags_updateFull(); +} + diff --git a/modules/SACT/sprite_eupdate_zmbbul.c b/modules/SACT/sprite_eupdate_zmbbul.c new file mode 100644 index 0000000..f682667 --- /dev/null +++ b/modules/SACT/sprite_eupdate_zmbbul.c @@ -0,0 +1,84 @@ +#include "ngraph.h" +#include "graph.h" + +static surface_t *ec10_sf[6]; + + +// ズームブレンドブラー +static void ec10_cb(surface_t *sfsrc, surface_t *sfdst) { + int curstep, maxstep, turstep; + surface_t *sf; + int i, sx, sy, sw, sh; + + maxstep = sqrt((sfsrc->width - (sfsrc->width/10))*(sfsrc->width - (sfsrc->width/10))+ + (sfsrc->height - (sfsrc->height/10))*(sfsrc->height - (sfsrc->height/10))); + + curstep = maxstep * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime); + turstep = maxstep / 2; + WARNING("step = %d/%d\n", curstep, maxstep); + + if (curstep > turstep) { + // 帰り + sx = (maxstep - curstep) * (sfsrc->width - sfsrc->width/10) / maxstep; + sy = (maxstep - curstep) * (sfsrc->height - sfsrc->height/10) / maxstep; + sw = sfsrc->width - sx*2; + sh = sfsrc->height - sy*2; + } else { + // 行き + sx = curstep * (sfsrc->width - sfsrc->width/10) / maxstep; + sy = curstep * (sfsrc->height - sfsrc->height/10) / maxstep; + sw = sfsrc->width - sx*2; + sh = sfsrc->height - sy*2; + } + + sf = ec10_sf[0]; + ec10_sf[0] = ec10_sf[1]; + ec10_sf[1] = ec10_sf[2]; + ec10_sf[2] = ec10_sf[3]; + ec10_sf[3] = ec10_sf[4]; + ec10_sf[4] = ec10_sf[5]; + ec10_sf[5] = sf; + + if (ec10_sf[0] == NULL) { + ec10_sf[0] = sf_dup2(sfsrc, FALSE, FALSE); + sf = ec10_sf[0]; + sf->has_alpha = FALSE; + gr_copy_stretch(sf, 0, 0, sf->width, sf->height, sfsrc, sx, sy, sw, sh); + gr_bright_dst_only(sf, 0, 0, sf->width, sf->height, 255/6); + return; + } + + if (curstep > turstep) { + gr_copy_stretch(sf, 0, 0, sf->width, sf->height, sfdst, sx, sy, sw, sh); + } else { + gr_copy_stretch(sf, 0, 0, sf->width, sf->height, sfsrc, sx, sy, sw, sh); + } + + gr_bright_dst_only(sf, 0, 0, sf->width, sf->height, 255/6); + + sf_copyall(sf0, sf); + + for (i = 0; i < 5; i++) { + gre_BlendScreen(sf0, 0, 0, sf0, 0, 0, ec10_sf[i], 0, 0, + sf0->width, sf0->height); + } + + ags_updateFull(); +} + + +static void ec10_prepare(surface_t *src, surface_t *dst) { + int i; + + for (i = 0; i < 6; i++) { + ec10_sf[i] = NULL; + } +} + +static void ec10_drain(surface_t *src, surface_t *dst) { + int i; + + for (i = 0; i < 6; i++) { + sf_free(ec10_sf[i]); + } +} diff --git a/modules/SACT/sprite_event.c b/modules/SACT/sprite_event.c new file mode 100644 index 0000000..aad6c7c --- /dev/null +++ b/modules/SACT/sprite_event.c @@ -0,0 +1,487 @@ +/* + * sprite_event.c: SACT内の mouse/key イベントのハンドラ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_event.c,v 1.5 2003/11/09 15:06:13 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "menu.h" +#include "imput.h" +#include "nact.h" +#include "key.h" +#include "sact.h" +#include "sprite.h" +#include "sactsound.h" +#include "sactlog.h" + +/* + SACT内のSpriteKey待ちやメッセージKey待ちなどを実現するため、X|SDL から + Key/Mouse イベントがあったときに、nact->ags.eventcb()によって他のモジュール + にイベントを送出できるようにした。 + + SACTでは最初に spev_callback でイベントを受け取るようにし、現在のキー待ちの + 状態(sact.waittype)によってそれぞれのイベントハンドラを呼び出している。 + + 現在のところ、1) メッセージキー待ち、2) 単純キー待ち、3) メニューキー待ち、 + 4) スプライトキー 5) バックログキー待ちの5つがある。 + + 1)メッセージキー待ち + 何かキーが押されるまで待つ。Zキースプライトの消去ができる。 + + 2)単純キー待ち + 1)と同じ + + 3)メニューキー待ち + メニューオープン時の処理。マウスが動いた時と、キー(orボタン)が離れたときに + いくつかの処理を行う。 + + 4)スプライト待ち + SW/GETA/GETB/PUT/SWPUTスプライトの各処理を行う。 + スプライトは番号の小さいものから順に上に重ねて表示し、下になっている + スプライトにイベントが伝わらないようにする + -> SpriteKey待ちの直前にスプライトの番号による depth map を作成し、 + マウスの位置にあるスプライトの番号をで取り出す。 + AlphaマスクつきのSpriteの場合、それを反映し、表示している場所のみに + depthmapを反映。 + + drag中のスプライトは常に最上位にくるように表示し、マウス移動等のイベント + は最初に処理する。 + + 5)バックログ表示中のキー待ち + オリジナルと同じキー操作のはず +*/ + + +static void cb_focused_swsp(gpointer s, gpointer data); +static void cb_defocused_swsp(gpointer s, gpointer data); +static int cb_focused(sprite_t *sp); +static int cb_defocused(sprite_t *sp); +static void cb_waitkey_simple(agsevent_t *e); +static void cb_waitkey_sprite(agsevent_t *e); +static void cb_waitkey_selection(agsevent_t *e); + +/* + フォーカスを得たスプライトに説明スプライトが登録されていた場合の + 説明スプライトの表示ON +*/ +static void cb_focused_swsp(gpointer s, gpointer data) { + sprite_t *sp = (sprite_t *)s; + int *update = (int *)data; + boolean oldstate = sp->show; + + WARNING("show up spex %d\n", sp->no); + + sp->show = TRUE; + if (oldstate != sp->show) { + (*update)++; + sp_updateme(sp); + } +} + +/* + フォーカスを得たスプライトに説明スプライトが登録されていた場合の + 説明スプライトの表示OFF +*/ +static void cb_defocused_swsp(gpointer s, gpointer data) { + sprite_t *sp = (sprite_t *)s; + int *update = (int *)data; + boolean oldstate = sp->show; + + WARNING("hide spex %d\n", sp->no); + + sp->show = FALSE; + if (oldstate != sp->show) { + (*update)++; + sp_updateme(sp); + } +} + +// zkey hide off +static void cb_focused_zkey(gpointer s, gpointer data) { + sprite_t *sp = (sprite_t *)s; + int *update = (int *)data; + boolean oldstate = sp->show; + + sp->show = sp->show_save; + if (oldstate != sp->show) { + (*update)++; + sp_updateme(sp); + } +} + +// zkey hide on +static void cb_defocused_zkey(gpointer s, gpointer data) { + sprite_t *sp = (sprite_t *)s; + int *update = (int *)data; + boolean oldstate = sp->show; + + sp->show = FALSE; + if (oldstate != sp->show) { + (*update)++; + sp_updateme(sp); + sp->show_save = oldstate; + } +} + +/* + フォーカスを得たスプライトの処理 + cg2があればcurcgをcg2に設定 + + drag中のスプライトがある場合 + -> PUT/SWPUTスプライトのみ反応 + drag中のスプライトがない場合 + -> GETA/GETB/SWPUTスプライトのみ反応 +*/ +static int cb_focused(sprite_t *sp) { + int update = 0; + + if (sact.draggedsp) { + if (sp->type != SPRITE_PUT && + sp->type != SPRITE_SWPUT) return 0; + } else { + if (sp->type == SPRITE_PUT) return 0; + } + + if (!sp->focused) { + if (sp->cg2) { + if (sp->curcg != sp->cg2) { + sp_updateme(sp); + } + sp->curcg = sp->cg2; + update++; + } + sp->focused = TRUE; + WARNING("get forcused %d, type %d\n", sp->no, sp->type); + if (sp->numsound1) { + ssnd_play(sp->numsound1); + } + } + + return update; +} + +/* + フォーカスを失ったスプライトの処理 + curcg を cg1 にセット +*/ +static int cb_defocused(sprite_t *sp) { + int update = 0; + + if (sp->focused) { + if (sp->curcg != sp->cg1) { + sp_updateme(sp); + } + sp->curcg = sp->cg1; + update++; + sp->focused = FALSE; + WARNING("lost forcused %d\n", sp->no); + } + + return update; +} + +/* + WaitKeySimpleのcallback +*/ +static void cb_waitkey_simple(agsevent_t *e) { + int cur, update = 0; + + switch (e->type) { + case AGSEVENT_KEY_PRESS: + if (e->d3 == KEY_Z) { + cur = get_high_counter(SYSTEMCOUNTER_MSEC); + if (!sact.zhiding) { + g_slist_foreach(sact.sp_zhide, cb_defocused_zkey, &update); + sact.zhiding = TRUE; + sact.zdooff = TRUE; + sact.zofftime = cur; + } else { + sact.zdooff = FALSE; + } + } + break; + + case AGSEVENT_BUTTON_RELEASE: + // back log view mode に移行 + if (e->d3 == AGSEVENT_WHEEL_UP || + e->d3 == AGSEVENT_WHEEL_DN) { + // MessageKey 待ちのときのみ + if (sact.waittype != KEYWAIT_MESSAGE) break; + sblog_start(); + sact.waittype = KEYWAIT_BACKLOG; + break; + } + if (sact.zhiding) { + g_slist_foreach(sact.sp_zhide, cb_focused_zkey, &update); + sact.zhiding = FALSE; + } + // fall through + + case AGSEVENT_KEY_RELEASE: + switch(e->d3) { + case KEY_Z: + cur = get_high_counter(SYSTEMCOUNTER_MSEC); + if (500 < (cur - sact.zofftime) || !sact.zdooff) { + g_slist_foreach(sact.sp_zhide, cb_focused_zkey, &update); + sact.zhiding = FALSE; + } + break; + case KEY_PAGEUP: + case KEY_PAGEDOWN: + // MessageKey 待ちのときのみ + if (sact.waittype != KEYWAIT_MESSAGE) break; + sblog_start(); + sact.waittype = KEYWAIT_BACKLOG; + break; + default: + sact.waitkey = e->d3; + break; + } + } + + if (update) { + sp_update_clipped(); + } +} + +/* + WaitKeySpriteのcallback +*/ +static void cb_waitkey_sprite(agsevent_t *e) { + GSList *node; + sprite_t *focused_sp = NULL; // focus を得ている sprite + sprite_t *defocused_sp = NULL; // focus を失った sprite + int update = 0; + + // キーイベントは無視 + switch(e->type) { + case AGSEVENT_KEY_RELEASE: + case AGSEVENT_KEY_PRESS: + return; + } + + if (sact.draggedsp) { + // 先に drag中のspriteにイベントを送る + update = sact.draggedsp->eventcb(sact.draggedsp, e); + } else { + // 右クリックキャンセル + // drag中でない時のみ、キャンセルを受け付ける + if (e->type == AGSEVENT_BUTTON_RELEASE && + e->d3 == AGSEVENT_BUTTON_RIGHT) { + sact.waitkey = 0; + return; + } + } + + // forcusを得ている sprite と focusを失った sprite を探す + for (node = sact.eventlisteners; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + + if (sp == NULL) continue; + if (!sp->show) continue; + + // freeze状態ではCGは変化しない + if (sp->freezed_state != 0) continue; + + // dragg中の sprite は無視する + if (sp == sact.draggedsp) continue; + + if (focused_sp == NULL && sp_is_insprite(sp, e->d1, e->d2)) { + /* + focusを得ている sprite + */ + update += cb_focused(sp); + focused_sp = sp; + } else { + /* + 現在のカーソル位置にはいま処理している番号のsprite + は存在しないので、defocus の処理を行う。 + 今回のマウス移動イベントによりfocusを失ったので + あれば、cb_decocused(sp)は 1 を返す + */ + int ret = cb_defocused(sp); + if (ret > 0) defocused_sp = sp; + update += ret; + } + } + + // focusを得た sprite に BUTTONイベントのみを送る + if (focused_sp && e->type != AGSEVENT_MOUSE_MOTION) { + update += focused_sp->eventcb(focused_sp, e); + } + + // 範囲外(focusを得ているspriteがない場合)をクリックしたときの音 + if (!focused_sp && + e->type != AGSEVENT_MOUSE_MOTION && + sact.numsoundob) { + ssnd_play(sact.numsoundob); + } + + // drag中でない場合は、説明スプライトの表示、消去を行う + if (sact.draggedsp == NULL && e->type == AGSEVENT_MOUSE_MOTION) { + // focus を失った sprite の 説明 sprite の消去 + if (defocused_sp) { + sprite_t *sp = defocused_sp; + if (sp->expsp) { + g_slist_foreach(sp->expsp, cb_defocused_swsp, &update); + } + } + + // focus を得た sprite の 説明 sprite の表示 + if (focused_sp) { + sprite_t *sp = focused_sp; + if (sp->expsp) { + g_slist_foreach(sp->expsp, cb_focused_swsp, &update); + } + } + } + + // 表示状態に変更があればその領域を更新 + if (update) { + sp_update_clipped(); + } +} + +/* + 選択肢 Window Open 時の callback +*/ +static void cb_waitkey_selection(agsevent_t *e) { + switch (e->type) { + case AGSEVENT_BUTTON_RELEASE: + sact.sel.cbrelease(e); + break; + + case AGSEVENT_MOUSE_MOTION: + sact.sel.cbmove(e); + break; + } +} + +/* + バックログ参照時 +*/ +static void cb_waitkey_backlog(agsevent_t *e) { + switch (e->type) { + case AGSEVENT_KEY_RELEASE: + switch (e->d3) { + case KEY_ESC: + sblog_end(); + sact.waittype = KEYWAIT_MESSAGE; + break; + case KEY_PAGEUP: + sblog_pageup(); + break; + case KEY_PAGEDOWN: + sblog_pagedown(); + break; + case KEY_UP: + sblog_pagenext(); + break; + case KEY_DOWN: + sblog_pagepre(); + break; + } + break; + + case AGSEVENT_BUTTON_RELEASE: + switch(e->d3) { + case AGSEVENT_WHEEL_UP: + sblog_pagenext(); + break; + case AGSEVENT_WHEEL_DN: + sblog_pagepre(); + break; + case AGSEVENT_BUTTON_RIGHT: + sblog_end(); + sact.waittype = KEYWAIT_MESSAGE; + break; + } + break; + } +} + +/* + X|SDL のイベントディスパッチャからくる最初の場所 +*/ +void spev_callback(agsevent_t *e) { + // menu open中は無視 + if (nact->popupmenu_opened) { + return; + } + + if (sact.waittype != KEYWAIT_BACKLOG) { + if (e->type == AGSEVENT_KEY_PRESS && e->d3 == KEY_CTRL) { + sact.waitskiplv = 2; + sact.waitkey = e->d3; + return; + } + + if (e->type == AGSEVENT_KEY_RELEASE && e->d3 == KEY_CTRL) { + sact.waitskiplv = 0; + sact.waitkey = e->d3; + return; + } + } + + switch (sact.waittype) { + case KEYWAIT_MESSAGE: + case KEYWAIT_SIMPLE: + cb_waitkey_simple(e); + break; + + case KEYWAIT_SPRITE: + cb_waitkey_sprite(e); + break; + + case KEYWAIT_SELECT: + cb_waitkey_selection(e); + break; + + case KEYWAIT_BACKLOG: + cb_waitkey_backlog(e); + break; + + default: + return; + } +} + +/* + 各スプライト毎のイベント callback の登録 +*/ +void spev_add_eventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)) { + sp->eventcb = cb; + sact.eventlisteners = g_slist_append(sact.eventlisteners, sp); +} + +/* + 上で登録した callback の削除 +*/ +void spev_remove_eventlistener(sprite_t *sp) { + sact.eventlisteners = g_slist_remove(sact.eventlisteners, sp); +} + diff --git a/modules/SACT/sprite_get.c b/modules/SACT/sprite_get.c new file mode 100644 index 0000000..5c996fb --- /dev/null +++ b/modules/SACT/sprite_get.c @@ -0,0 +1,138 @@ +/* + * sprite_get.c: ゲットA/Bスプライト特有の処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_get.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "ags.h" +#include "sact.h" +#include "sprite.h" +#include "sactsound.h" + +static void cb_defocused_swsp(gpointer s, gpointer data); +static int eventCB_GET(sprite_t *sp, agsevent_t *e); +static void cb_remove(sprite_t *sp); + +/* + 説明スプライトの消去 + dragが始まったら説明スプライトは消去する +*/ +static void cb_defocused_swsp(gpointer s, gpointer data) { + sprite_t *sp = (sprite_t *)s; + int *update = (int *)data; + boolean oldstate = sp->show; + + sp->show = FALSE; + if (oldstate != sp->show) { + (*update)++; + sp_updateme(sp); + } +} + + +//ゲットスプライトのイベント処理 +static int eventCB_GET(sprite_t *sp, agsevent_t *e) { + int update = 0; + + switch(e->type) { + case AGSEVENT_BUTTON_PRESS: + if (e->d3 != AGSEVENT_BUTTON_LEFT) break; + + // drag開始時のマウスの位置記録 + sp->u.get.dragging = TRUE; + sp->u.get.dragstart.x = e->d1; + sp->u.get.dragstart.y = e->d2; + + if (sp->cg3) { + sp->curcg = sp->cg3; + update++; + sp_updateme(sp); + } + + // スプライトの表示を一番前に持って来る + sact.draggedsp = sp; + sact.dropped = FALSE; + + // 説明スプライトがある場合は、それを非表示にする + if (sp->expsp) { + g_slist_foreach(sp->expsp, cb_defocused_swsp, &update); + } + + // SpriteSoundがあれば、それを鳴らす + if (sp->numsound2) { + ssnd_play(sp->numsound2); + } + + break; + + case AGSEVENT_BUTTON_RELEASE: + // どのボタンでもドラッグ中止|終了 + + if (!sp->u.get.dragging) break; + + sact.dropped = TRUE; + break; + + case AGSEVENT_MOUSE_MOTION: + { + int newx, newy; + + // MOUSE MOTION は dragg中にしか呼ばれないから + // これは不要 + // if (!sp->u.get.dragging) break; + + // マウスの現在位置により新しい場所を計算 + newx = sp->loc.x + (e->d1 - sp->u.get.dragstart.x); + newy = sp->loc.y + (e->d2 - sp->u.get.dragstart.y); + if (newx != sp->cur.x || newy != sp->cur.y) { + sp_updateme(sp); + sp->cur.x = newx; + sp->cur.y = newy; + update++; + sp_updateme(sp); + } + break; + }} + + return update; +} + +// スプライト削除時の処理 +static void cb_remove(sprite_t *sp) { + spev_remove_eventlistener(sp); +} + +/* + sp_new の時にスプライトの種類毎の初期化 + @param sp: 初期化するスプライト +*/ +int sp_get_setup(sprite_t *sp) { + spev_add_eventlistener(sp, eventCB_GET); + sp->remove = cb_remove; + + return OK; +} + diff --git a/modules/SACT/sprite_keywait.c b/modules/SACT/sprite_keywait.c new file mode 100644 index 0000000..389620e --- /dev/null +++ b/modules/SACT/sprite_keywait.c @@ -0,0 +1,178 @@ +/* + * sprite_keywait.c: スプライトキー待ち + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_keywait.c,v 1.2 2003/05/09 05:14:34 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "ags.h" +#include "nact.h" +#include "imput.h" +#include "ngraph.h" +#include "surface.h" +#include "sact.h" +#include "sprite.h" +#include "sactsound.h" + + +static void hidesprite(sprite_t *sp); +static boolean waitcond(int endtime); + + + +// じわじわ消す +static void hidesprite(sprite_t *sp) { + int i; + + for (i = 255; i >= 0; i-=32) { + sp->blendrate = i; + sp_updateme(sp); + sp_update_clipped(); + sys_keywait(10, FALSE); + } + + sp_updateme(sp); + sp->show = FALSE; + sp_update_clipped(); +} + +/* + キー待ち終了の条件チェック + @param endtime: 終了時間 + @return: 終了なら TRUE、継続なら FALSE + + スプライトがドロップされた時の各種処理を含む +*/ +static boolean waitcond(int endtime) { + int curtime = get_high_counter(SYSTEMCOUNTER_MSEC); + if (curtime >= endtime) return TRUE; + + if (sact.dropped) { + sact.draggedsp->u.get.dragging = FALSE; + if (sact.waitkey != -1) { + // dropしたスプライトをじわじわ消す + hidesprite(sact.draggedsp); + sact.sp_result_get = sact.draggedsp->no; + sact.sp_result_put = sact.waitkey; + sp_free(sact.draggedsp->no); + sact.draggedsp = NULL; + sact.dropped = FALSE; + return TRUE; + } else { + // PUT/SWPUTスプライト以外のところにdropした場合 + sprite_t *sp = sact.draggedsp; + if (sact.draggedsp->type == SPRITE_GETA) { + // もとの場所にゆっくり戻す + spev_move_waitend(sp, sp->loc.x, sp->loc.y, 150); + } else { + // その場所に留まる + sp->loc = sp->cur; + } + + // drop音があれば、鳴らす + if (sact.draggedsp->numsound3) { + ssnd_play(sact.draggedsp->numsound3); + } + sact.draggedsp = NULL; + sact.dropped = FALSE; + } + } + + // その他キー入力があれば終了 + return sact.waitkey == -1 ? FALSE : TRUE; +} + +/* + スプライトキー待ち + @param vOK: 0ならば右クリック + @param vRND: スイッチスプライトの番号 + @param vD01: ゲットスプライトの番号 + @param vD02: プットスプライトの番号 + @param vD03: タイムアウトした場合=1, しない場合=0 + @param wTime: タイムアウト時間 (1/100sec) +*/ +int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout) { + int curtime, endtime; + + // とりあえず全更新 + sp_update_all(TRUE); + + // depthmap を準備 + g_slist_foreach(sact.updatelist, sp_draw_dmap, NULL); + + sact.waittype = KEYWAIT_SPRITE; + sact.waitkey = -1; + sact.sp_result_sw = 0; + sact.sp_result_get = 0; + sact.sp_result_put = 0; + sact.draggedsp = NULL; + + { + // とりあえず、現在のマウス位置を送って、switch sprite の + // 状態を更新しておく + agsevent_t agse; + MyPoint p; + sys_getMouseInfo(&p, FALSE); + agse.type = AGSEVENT_MOUSE_MOTION; + agse.d1 = p.x; + agse.d2 = p.y; + agse.d3 = 0; + nact->ags.eventcb(&agse); + } + + // 終了時間の計算 + curtime = get_high_counter(SYSTEMCOUNTER_MSEC); + endtime = timeout < 0 ? G_MAXINT: (curtime + timeout * 10); + + // スプライトキー待ちメイン + while (!waitcond(endtime)) { + sys_keywait(25, TRUE); + } + + if (sact.waitkey == 0) { + // 右クリックキャンセル + *vOK = 0; + if (vD03) *vD03 = 0; + } else if (sact.waitkey == -1) { + // timeout + *vOK = 1; + if (vD03) *vD03 = 1; + } else { + *vOK = 1; + if (vD03) *vD03 = 0; + } + + *vRND = sact.sp_result_sw; + *vD01 = sact.sp_result_get; + *vD02 = sact.sp_result_put; + + sact.waittype = KEYWAIT_NONE; + + return OK; +} + + diff --git a/modules/SACT/sprite_move.c b/modules/SACT/sprite_move.c new file mode 100644 index 0000000..b5c011c --- /dev/null +++ b/modules/SACT/sprite_move.c @@ -0,0 +1,188 @@ +/* + * sprite_move.c: スプライトの移動に関する各種処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_move.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "imput.h" +#include "nact.h" +#include "sact.h" +#include "sprite.h" +#include "counter.h" + +/* + + SP_MOVE によるスプライトの移動は、SACT.Drawが発行されると同時に + 移動を開始し、全ての移動が終了するまで待つ。 + + 移動が開始されるまでに削除、または新規に作成されたスプライトは + 移動しないので注意 + +*/ + + +static void move_drain(sprite_t *sp); +static int move_cb(sprite_t *sp, agsevent_t *e); + +// SP_MOVEコマンドの後始末 +static void move_drain(sprite_t *sp) { + // 古い場所のupdate + sp_updateme(sp); + + // 最終移動場所にスプライト位置をセット + sp->cur = sp->loc = sp->move.to; + + // あたらしい場所のupdate + sp_updateme(sp); + + // 後で、movelist から外してもらうための処理 + sact.teventremovelist = g_slist_append(sact.teventremovelist, sp); + + sp->move.moving = FALSE; + sp->move.time = 0; // 移動時間の初期化 +} + +// SP_MOVE の timer event callback +static int move_cb(sprite_t *sp, agsevent_t *e) { + int t, update = 0; + int now, newx, newy; + + // 現在時刻の取得 + now = sact.movecurtime; + + WARNING("no = %d now = %d st = %d, ed = %d\n", + sp->no, now, sp->move.starttime, sp->move.endtime); + + if (now >= sp->move.endtime) { + // 時間オーバーなら、最終位置に移動してMOVE終了 + move_drain(sp); + return 1; + } + + // 経過時間 + t = now - sp->move.starttime; + + newx = sp->loc.x + t * (sp->move.to.x - sp->loc.x) / sp->move.time; + newy = sp->loc.y + t * (sp->move.to.y - sp->loc.y) / sp->move.time; + + // 移動していたら新しい位置を記録して書き換えを指示 + if (newx != sp->cur.x || newy != sp->cur.y) { + // 古い場所のupdate + sp_updateme(sp); + sp->cur.x = newx; + sp->cur.y = newy; + // 新しい場所のupdate + sp_updateme(sp); + update++; + } else { + usleep(1); + } + + return update; +} + +/* + SP_MOVEコマンド、移動の準備 + @param data: sprite + @param userdata: 未使用 +*/ +void spev_move_setup(gpointer data, gpointer userdata) { + sprite_t *sp = (sprite_t *)data; + + // 非表示のものは移動しない(いいのかな) + if (!sp->show) return; + + // move 開始時刻の記録 + sp->move.starttime = sact.movestarttime; + sp->move.moving = TRUE; + + // MOVE_SPEED で設定した場合は、移動量を考慮して移動時間を決定 + if (sp->move.time == -1) { + // speed から timeへ + int dx = sp->move.to.x - sp->loc.x; + int dy = sp->move.to.y - sp->loc.y; + int d = (int)sqrt(dx*dx+dy*dy); + sp->move.time = d * 100 / sp->move.speed; + } + + // move 終了予定時刻 + sp->move.endtime = sp->move.starttime + sp->move.time; + + // タイマコールバック登録 + spev_add_teventlistener(sp, move_cb); + + WARNING("no=%d,from(%d,%d@%d)to(%d,%d@%d),time=%d\n", sp->no, + sp->cur.x, sp->cur.y, sp->move.starttime, + sp->move.to.x, sp->move.to.y, sp->move.endtime, + sp->move.time); + +} + +/* + スプライトの移動先を指定し、移動先にくるまで待つ + @param sp: 対象スプライト + @param dx: 移動先X座標 + @param dy: 移動先Y座標 + @param time: 移動速度 +*/ +void spev_move_waitend(sprite_t *sp, int dx, int dy, int time) { + sp->loc = sp->cur; + sp->move.to.x = dx; + sp->move.to.y = dy; + sp->move.speed = time; + sp->move.time = -1; + + sact.movelist = g_slist_append(sact.movelist, sp); + sact.movestarttime = get_high_counter(SYSTEMCOUNTER_MSEC); + g_slist_foreach(sact.movelist, spev_move_setup, NULL); + g_slist_free(sact.movelist); + sact.movelist = NULL; + + while (sp->move.moving) { + nact->callback(); + } +} + +/* + 全ての移動中のスプライトが移動完了するのを待つ +*/ +void spev_wait4moving_sp() { + GSList *node; + + // 移動中のスプライトは sact.updatelist にあるはずだから + // そのなかのスプライトについて、移動中かどうかのフラグをチェック + for (node = sact.updatelist; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + if (sp == NULL) continue; + if (!sp->show) continue; + + while (sp->move.moving) { + nact->callback(); + } + } +} diff --git a/modules/SACT/sprite_msg.c b/modules/SACT/sprite_msg.c new file mode 100644 index 0000000..21ac014 --- /dev/null +++ b/modules/SACT/sprite_msg.c @@ -0,0 +1,577 @@ +/* + * sprite_msg.c: メッセージスプライトの処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_msg.c,v 1.8 2004/10/31 04:18:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "ags.h" +#include "nact.h" +#include "imput.h" +#include "sact.h" +#include "sprite.h" +#include "ngraph.h" +#include "drawtext.h" +#include "sactlog.h" +#include "eucsjis.h" + +// メッセージキー待ちの時、表示するアニメーションに関する情報 +struct markinfo { + sprite_t *sp; + cginfo_t *cg; + int interval; +}; + +static boolean is_messagesprite(int wNum); +static void replacestr_cb(gpointer data, gpointer userdata); +static char *replacestr(char *msg); +static void update_mark(sprite_t *sp, cginfo_t *cg); +static int setupmark(int wNum1, int wNum2, struct markinfo *minfo); +static int get_linelen(BYTE *msg); +static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax); +static void append_to_log(char *msg); +static void sactlog_newline(); +static void set_align(char *msg, sprite_t *sp, int wSize, int wAlign); + + +// 文字列置き換え用 (表示時にon-the-flyで変換して表示) +#define REPLACEBUFSIZE MSGBUFMAX+100 +static char repbuf[2][REPLACEBUFSIZE]; +static char *replacesrc; +static char *replacedst; + +// 指定の番号のスプライトがメッセージスプライトかどうかをチェック +static boolean is_messagesprite(int wNum) { + // check sprite number is sane + if (wNum >= (SPRITEMAX -1) || wNum <= 0) return FALSE; + + // check sprite is set + if (sact.sp[wNum] == NULL) return FALSE; + + // check sprite is message sprite + if (sact.sp[wNum]->type != SPRITE_MSG) return FALSE; + + return TRUE; +} + +// 文字列の置き換え処理 +static void replacestr_cb(gpointer data, gpointer userdata) { + strexchange_t *ex = (strexchange_t *)data; + char *start, *next, *out; + + if (ex == NULL) return; + + start = replacesrc; + out = replacedst; + + while (TRUE) { + next = strstr(start, ex->src); + if (next == NULL) break; + strncat(out, start, (size_t)(next - start)); + strncat(out, ex->dst, max(0, (REPLACEBUFSIZE - (int)strlen(out)))); + start = next + strlen(ex->src); + } + strncat(out, start, max(0, REPLACEBUFSIZE - (int)strlen(out))); + + replacedst = replacesrc; + replacesrc = out; + replacedst[0] = '\0'; +} + +// 文字列の置き換え +static char *replacestr(char *msg) { + if (sact.strreplace == NULL) return msg; + + repbuf[0][0] = '\0'; + repbuf[1][0] = '\0'; + strncpy(repbuf[0], msg, REPLACEBUFSIZE); + replacesrc = repbuf[0]; + replacedst = repbuf[1]; + g_slist_foreach(sact.strreplace, replacestr_cb, NULL); + + return (repbuf[0][0] == '\0') ? repbuf[1] : repbuf[0]; +} + +// アニメパターンの描画 +static void update_mark(sprite_t *sp, cginfo_t *cg) { + boolean show = sp->show; + cginfo_t *curcg = sp->curcg; + + sp->show = TRUE; + sp->curcg = cg; + + sp_updateme(sp); + sp_update_clipped(); + + sp->show = show; + sp->curcg = curcg; +} + +// アニメパターンの初期化 +static int setupmark(int wNum1, int wNum2, struct markinfo *minfo) { + sprite_t *sp1, *sp2; + int i = 0; + + if (wNum1 == 0 || wNum2 == 0) return 0; + + sp1 = sact.sp[wNum1]; + sp2 = sact.sp[wNum2]; + if (sp1 == NULL || sp2 == NULL) return 0; + + if (sp1->cg1) { + minfo[i].sp = sp1; + minfo[i].cg = sp1->cg1; + minfo[i].interval = sp1->u.anime.interval; + i++; + } + if (sp1->cg2) { + minfo[i].sp = sp1; + minfo[i].cg = sp1->cg2; + minfo[i].interval = sp1->u.anime.interval; + i++; + } + if (sp1->cg3) { + minfo[i].sp = sp1; + minfo[i].cg = sp1->cg3; + minfo[i].interval = sp1->u.anime.interval; + i++; + } + if (sp2->cg1) { + minfo[i].sp = sp2; + minfo[i].cg = sp2->cg1; + minfo[i].interval = sp2->u.anime.interval; + i++; + } + if (sp2->cg2) { + minfo[i].sp = sp2; + minfo[i].cg = sp2->cg2; + minfo[i].interval = sp2->u.anime.interval; + i++; + } + if (sp2->cg3) { + minfo[i].sp = sp2; + minfo[i].cg = sp2->cg3; + minfo[i].interval = sp2->u.anime.interval; + i++; + } + return i; +} + +/* + メッセージをバッファに追加 + nact.cのメッセージ・コマンド解析ルーチンから呼ばれる + + @param msg: 追加する文字列 +*/ +void smsg_add(char *msg) { + int len; + + if (msg[0] == '\0') return; + + if (0) { + char *b = sjis2lang(msg); + fprintf(stderr, "add msg '%s'\n", b); + free(b); + } + + len = MSGBUFMAX - (int)strlen(sact.msgbuf); + if (len < 0) { + WARNING("buf shortage (%d)\n", len); + return; + } + + strncat(sact.msgbuf, msg, len); + sact.msgbuf[MSGBUFMAX -1] = '\0'; +} + +/* + 改行 + 改行はメッセージ情報内につっこみ、出力時に改行幅を取り出して改行 + + @param wNum: 改行するスプライト番号 + @param size: 改行幅 +*/ +void smsg_newline(int wNum, int size) { + BYTE buf[3]; + + if (!is_messagesprite(wNum)) return; + + buf[0] = '\n'; + buf[1] = size; + buf[2] = '\0'; + smsg_add(buf); +} + +/* + (ルビつき)メッセージの出力 + + @param wSpriteNumber: メッセージを表示するメッセージスプライト番号 + @param wSize: フォントの大きさ + @param wColorR: メッセージの色(Red) + @param wColorG: メッセージの色(Green) + @param wColorB: メッセージの色(Blue) + @param wFont: メッセージのフォント(0:ゴシック, 1:明朝) + @param wSpeed: メッセージの表示速度 (msec) + @param wLineSpace: 行間スペース + @param wAlign: 行そろえ + @param wRSize: ルビフォントサイズ + @param wRFont: ルビフォント + @param wRLineSpace: ルビと本文の文字間隔 + @param vLength: ??? +*/ +void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace, int wAlign, int wRSize, int wRFont, int wRLineSpace, int *wLength) { + char *msg; + sprite_t *sp; + int len = 0; // 処理した文字数? + boolean needupdate = FALSE; + MyRectangle uparea = {0,0,0,0}; + + // wRSize == 0 -> ルビ無し(SACT.MessageOutputからの呼出) + + if (sact.msgbuf[0] == '\0') return; + + if (!is_messagesprite(wNum)) return; + + // MessageSkip中は文字送り速度を最大に + if (sact.waitskiplv > 1) wSpeed = 0; + + // shortcut + sp = sact.sp[wNum]; + + // update開始Y座標 (X座標は0固定) + uparea.y = sp->u.msg.dspcur.y; + + // 文字列置換 + msg = replacestr(sact.msgbuf); + + // 文字アラインメントの調整 + set_align(msg, sp, wSize, wAlign); + + while (*msg) { + char mbuf[20], rbuf[20]; + int cw, delta, wcnt; + + wcnt = get_high_counter(SYSTEMCOUNTER_MSEC); + + mbuf[0] = rbuf[0] = '\0'; + msg = get_char(msg, mbuf, rbuf, sizeof(mbuf) -1); + + if (mbuf[0] == '\n') { + sp->u.msg.dspcur.x = 0; + sp->u.msg.dspcur.y += (mbuf[1] + wLineSpace + wRSize + wRLineSpace); + set_align(msg, sp, wSize, wAlign); + + sactlog_newline(); + + continue; + } + + if (rbuf[0] != '\0') { + int mlen = strlen(mbuf) * wSize /2; + int rlen = strlen(rbuf) * wRSize /2; + int adjx = max(0, (mlen - rlen) /2); + dt_setfont(wRFont, wRSize); + dt_drawtext_col(sp->u.msg.canvas, + sp->u.msg.dspcur.x + adjx, + sp->u.msg.dspcur.y, + rbuf, + wColorR, wColorG, wColorB); + } + dt_setfont(wFont, wSize); + + if (0) { + char *b = sjis2lang(mbuf); + fprintf(stderr, "msg '%s'\n", b); + free(b); + } + + cw = dt_drawtext_col(sp->u.msg.canvas, + sp->u.msg.dspcur.x, + sp->u.msg.dspcur.y + wRSize + wRLineSpace, + mbuf, + wColorR, wColorG, wColorB); + + needupdate = TRUE; + + append_to_log(mbuf); + + if (wSpeed > 0) { + sp_updateme_part(sp, + sp->u.msg.dspcur.x, + sp->u.msg.dspcur.y, + cw, + wSize + wRSize + wRLineSpace); + sp_update_clipped(); + needupdate = FALSE; + + // keywait + delta = get_high_counter(SYSTEMCOUNTER_MSEC) - wcnt; + if (delta < wSpeed) { + if (sys_keywait(wSpeed - delta, FALSE)) { + + wSpeed = 0; + } + } + } + + sp->u.msg.dspcur.x += cw; + } + + sactlog_newline(); + + // バッファリング中の文字のクリア + sact.msgbuf[0] = '\0'; + + // Waitなしの出力は最後にupdate + if (needupdate) { + uparea.width = sp->cursize.width; + uparea.height = min(sp->cursize.height, uparea.y - sp->u.msg.dspcur.y + wLineSpace + wLineSpace + wRSize); + sp_updateme_part(sp, uparea.x, uparea.y, uparea.width, uparea.height); + } + + // ???? + if (wLength) { + *wLength = len; + } +} + +/* + メッセージ領域のクリア + @param wNum: クリアするスプライト番号 + */ +void smsg_clear(int wNum) { + sprite_t *sp; + surface_t *sf; + + if (!is_messagesprite(wNum)) return; + + // 表示位置の初期化 + sp = sact.sp[wNum]; + sp->u.msg.dspcur.x = 0; + sp->u.msg.dspcur.y = 0; + + sact.msgbuf[0] = '\0'; + sact.msgbuf2[0] = '\0'; + + // キャンバスのクリア + sf = sp->u.msg.canvas; + memset(sf->pixel, 0, sf->bytes_per_line * sf->height); + memset(sf->alpha, 0, sf->width * sf->height); + + sp_updateme(sp); + + if (sact.logging) { + sact.log = g_list_append(sact.log, g_strdup("\n")); + } +} + +/* + 出力中の文字列があるかチェック + @return: なし(0) , あり(1) + */ +int smsg_is_empty() { + return (sact.msgbuf[0] != '\0'); +} + +/* + メッセージキー入力待ち + @param wNum1: スプライト番号1(アニメーションスプライト) + @param wNum2: スプライト番号2(アニメーションスプライト) + @param msglen: ? + */ +int smsg_keywait(int wNum1, int wNum2, int msglen) { + struct markinfo minfo[6]; + int i = 0, j, maxstep; + + if (sact.waitskiplv > 0) return 0; + + // アニメパターンの初期化 + maxstep = setupmark(wNum1, wNum2, minfo); + + sact.waittype = KEYWAIT_MESSAGE; + sact.waitkey = -1; + + while (sact.waitkey == -1) { + int st = get_high_counter(SYSTEMCOUNTER_MSEC); + int interval = 25; + + // アニメパターンがある場合、その更新 + // Zキーで隠されているとは表示しない + // (アニメパターンが隠す対象でない時はどうしよう...) + if (maxstep && + !sact.zhiding && + sact.waittype != KEYWAIT_BACKLOG) { + j = i % maxstep; + interval = minfo[j].interval; + update_mark(minfo[j].sp, minfo[j].cg); + i++; + } + sys_keywait(interval - (get_high_counter(SYSTEMCOUNTER_MSEC) - st), FALSE); + } + + sact.waittype = KEYWAIT_NONE; + + return sact.waitkey; +} + +/* + スプライト再描画のコールバック + @param sp: 再描画するスプライト + */ +int smsg_update(sprite_t *sp) { + int sx, sy, w, h, dx, dy; + surface_t update; + + // canvas が clean のときはなにもしない + // -> 説明スプライトのように、SetShowされたときに対応できないからだめ + //if (sact.msgbufempty) return OK; + + update.width = sact.updaterect.width; + update.height = sact.updaterect.height; + + dx = sp->cur.x - sact.updaterect.x; + dy = sp->cur.y - sact.updaterect.y; + + w = sp->cursize.width; + h = sp->cursize.height; + + sx = 0; sy = 0; + + if (!gr_clip(sp->u.msg.canvas, &sx, &sy, &w, &h, &update, &dx, &dy)) { + return NG; + } + + dx += sact.updaterect.x; + dy += sact.updaterect.y; + + gre_BlendUseAMap(sf0, dx, dy, sf0, dx, dy, sp->u.msg.canvas, sx, sy, w, h, sp->u.msg.canvas, sx, sy, sp->blendrate); + + WARNING("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n", + sp->no, sx, sy, w, h, dx, dy); + + return OK; +} + +// 改行を含む文字列バッファ中から、改行までの文字列の長さを取り出す +static int get_linelen(BYTE *msg) { + int c = 0; + + while (*msg) { + if (*msg == '\n') break; + if (0 == strncmp("|RB|", msg, 4)) { + msg += 4; + while (*msg != '|') { + msg++; c++; + } + msg++; + while (*msg != '|') { + msg++; + } + msg++; + } else { + msg++; c++; + } + } + return c; +} + +// 改行やルビを含む文字列バッファからそれらを取り出す +// 改行の場合 : 改行幅もいっしょに +// ルビつき文字の場合: メッセージ本体と対応するルビ文字列 +// それ以外 : 全角|半角文字1文字 +static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax) { + int c1, i; + + // 改行 + if (msg[0] == '\n') { + mbuf[0] = '\n'; + mbuf[1] = msg[1]; + mbuf[2] = '\0'; + return msg +2; + } + + // ルビつき文字 + if (0 == strncmp("|RB|", msg, 4)) { + msg += 4; + for (i = 0; *msg != '|' && i < bufmax; i++) { + mbuf[i] = *msg++; + } + msg++; mbuf[i] = '\0'; + for (i = 0; *msg != '|' && i < bufmax; i++) { + rbuf[i] = *msg++; + } + msg++; rbuf[i] = '\0'; + } else { + c1 = *msg++; + + *mbuf++ = c1; + + if ((c1 >= 0x81 && c1 < 0xa0) || (c1 >= 0xe0 && c1 <= 0xee)) { + *mbuf++ = *msg++; + } + *mbuf = '\0'; + } + return msg; +} + +// バックログ用バッファに追加 +static void append_to_log(char *msg) { + if (sact.logging) { + int len = MSGBUFMAX - (int)strlen(sact.msgbuf2); + strncat(sact.msgbuf2, msg, len); + sact.msgbuf2[MSGBUFMAX -1] = '\0'; + } +} + +// バックログを保存するリストに追加 +static void sactlog_newline() { + if (sact.logging) { + if (sact.msgbuf2[0] == '\0') return; + sact.log = g_list_append(sact.log, g_strdup(sact.msgbuf2)); + sact.msgbuf2[0] = '\0'; + } +} + +// 書き出し位置がx=0の時のみアラインメントの調整を行う +static void set_align(char *msg, sprite_t *sp, int wSize, int wAlign) { + if (sp->u.msg.dspcur.x == 0) { + int mlen = get_linelen(msg) * wSize/2; + int adjx = 0; + + switch (wAlign) { + case 1: // センタリング + adjx = (sp->cursize.width - mlen) / 2; + break; + case 2: // 右寄せ + adjx = (sp->cursize.width - mlen); + break; + } + sp->u.msg.dspcur.x = max(0, adjx); + } +} diff --git a/modules/SACT/sprite_put.c b/modules/SACT/sprite_put.c new file mode 100644 index 0000000..39ca6bf --- /dev/null +++ b/modules/SACT/sprite_put.c @@ -0,0 +1,107 @@ +/* + * sprite_put.c: プット・スイッチプットスプライト特有の処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_put.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "ags.h" +#include "sact.h" +#include "sactsound.h" +#include "sprite.h" + +static int eventCB_PUT(sprite_t *sp, agsevent_t *e); +static void cb_remove(sprite_t *sp); + +// プットスプライトのイベント処理 +static int eventCB_PUT(sprite_t *sp, agsevent_t *e) { + int update = 0; + + switch(e->type) { + case AGSEVENT_BUTTON_PRESS: + if (e->d3 != AGSEVENT_BUTTON_LEFT) return 0; + + // ボタン押下時のスプライトがあれば、それを表示 + if (sp->cg3) { + sp->curcg = sp->cg3; + update++; + } + + sp->pressed = TRUE; + break; + + case AGSEVENT_BUTTON_RELEASE: + if (sact.draggedsp == NULL && sp->type == SPRITE_PUT) return 0; + + if (sact.dropped) { + sact.sp_result_sw = sp->no; + sact.waitkey = sp->no; + if (sp->numsound3) { + ssnd_play(sp->numsound3); + } + } else { + // スイッチプットスプライトの決定の処理 + if (sp->cg2) { + sp->curcg = sp->cg2; + update++; + } + + // pressされたスプライトとreleaseされたスプライト + // が同じ場合のみ、そのスプライトが押されたと判断 + if (sp->pressed) { + sact.sp_result_sw = sp->no; + sact.waitkey = sp->no; + if (sp->numsound2) { + ssnd_play(sp->numsound2); + } + } + sp->pressed = FALSE; + } + break; + } + + if (update) { + sp_updateme(sp); + } + + return update; +} + +// スプライト削除時の処理 +static void cb_remove(sprite_t *sp) { + // event listener の削除 + spev_remove_eventlistener(sp); +} + +/* + sp_new の時にスプライトの種類毎の初期化 + @param sp: 初期化するスプライト +*/ +int sp_put_setup(sprite_t *sp) { + spev_add_eventlistener(sp, eventCB_PUT); + sp->remove = cb_remove; + + return OK; +} diff --git a/modules/SACT/sprite_quake.c b/modules/SACT/sprite_quake.c new file mode 100644 index 0000000..75cbff2 --- /dev/null +++ b/modules/SACT/sprite_quake.c @@ -0,0 +1,101 @@ +/* + * sprite_quake.c: スプライトを揺らす + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_quake.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "imput.h" +#include "sact.h" +#include "surface.h" +#include "ngraph.h" +#include "sprite.h" +#include "counter.h" +#include "randMT.h" + +/* + QuakeSpriteAddで設定したスプライトを揺らす + + @param wType: 0:縦横(全てのスプライトを同じように揺らす) + 1:縦横(全てのスプライトをバラバラに揺らす) + @param wAmplitudeX: X方向の振幅 + @param wAmplitudeY: Y方向の振幅 + @param wCount: 時間(1/100秒) + @param cancel: キーキャンセルあり(=1) +*/ +int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitudeY, int wCount, int cancel) { + int edtime, curtime; + int i = 0, key; + GSList *node; + + edtime = wCount * 10 + get_high_counter(SYSTEMCOUNTER_MSEC); + + while ((curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < edtime) { + if (wType == 0) { // 全てのスプライトを同じように動かす + int adjx = (int)(genrand() * wAmplitudeX/2); + int adjy = (int)(genrand() * wAmplitudeY/2); + adjx *= ((-1)*(i%2) + ((i+1)%2)); + adjy *= ((-1)*((i+1)%2) + (i%2)); + for (node = sact.sp_quake; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + if (sp == NULL) continue; + sp_updateme(sp); + sp->cur.x = sp->loc.x + adjx; + sp->cur.y = sp->loc.y + adjy; + sp_updateme(sp); + } + } else { // 全てのスプライトを別々に動かす + for (node = sact.sp_quake; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + int adjx = (int)(genrand() * wAmplitudeX/2); + int adjy = (int)(genrand() * wAmplitudeY/2); + if (sp == NULL) continue; + adjx *= ((-1)*(i%2) + ((i+1)%2)); + adjy *= ((-1)*((i+1)%2) + (i%2)); + sp_updateme(sp); + sp->cur.x = sp->loc.x + adjx; + sp->cur.y = sp->loc.y + adjy; + sp_updateme(sp); + } + } + sp_update_clipped(); + i++; + + // ウェイトとキャンセルチェック + key = sys_keywait(10, cancel); + if (cancel && key != 0) break; + } + + // 元のあった場所に戻す + for (node = sact.sp_quake; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + if (sp == NULL) continue; + sp->cur = sp->loc; + sp_updateme(sp); + } + sp_update_clipped(); + return OK; +} diff --git a/modules/SACT/sprite_sel.c b/modules/SACT/sprite_sel.c new file mode 100644 index 0000000..4ee9599 --- /dev/null +++ b/modules/SACT/sprite_sel.c @@ -0,0 +1,332 @@ +/* + * sprite_sel.c: 選択肢処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_sel.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "nact.h" +#include "ags.h" +#include "imput.h" +#include "key.h" +#include "sact.h" +#include "sprite.h" +#include "ngraph.h" +#include "drawtext.h" + +// 選択された要素(1~) キャンセルの場合は0、初期状態は -1 +static int selected_item; +static int selected_item_cur; + +// 選択肢を描画するsurface +static surface_t *selcanvas; + +// 前のカーソルの状態 +static boolean oldstate; // spriteの中か外か +static int oldindex; // 何番目の要素か(0~) + + +static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin); +static void cb_select_move(agsevent_t *e); +static void cb_select_release(agsevent_t *e); +static int update_selwindow(sprite_t *sp); +static void setup_selwindow(); +static void remove_selwindow(); +static int sel_main(); + + + + +/** + * 内側にマージンを含む sprite内領域チェック + * マージン内はsprite内部とは判断しない + */ +static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin) { + MyRectangle r; + cginfo_t *curcg = sp->curcg; + + r.x = sp->cur.x + margin; + r.y = sp->cur.y + margin; + r.width = curcg->sf->width - 2 * margin; + r.height = curcg->sf->height - 2 * margin; + return ags_regionContains(&r, x, y); +} + +// マウスが移動したときの callback +static void cb_select_move(agsevent_t *e) { + int x = e->d1, y = e->d2; + sprite_t *sp = sact.sp[sact.sel.spno]; + boolean newstate; + int newindex; + + // sprite内か? + newstate = sp_is_insprite2(sp, x, y, sact.sel.frame_dot); + newindex = (y - (sp->cur.y + sact.sel.frame_dot)) / (sact.sel.font_size + sact.sel.linespace); + + if (newstate == oldstate) { + if ((newstate == FALSE) || (newindex == oldindex)) { + // 前と状態が同じでかつ、新しい状態がspriteの外か、 + // indexが変わらない場合はなにもしない。 + return; + } + } + + if (newstate) { + // spriteの内部 + // fprintf(stderr, "in region %d\n", newindex); + //update_selwindow(newindex + 1); + selected_item_cur = newindex + 1; + } else { + // spriteの外部 + //update_selwindow(0); + selected_item_cur = 0; + } + + oldstate = newstate; + oldindex = newindex; + + // 再描画 + sp_updateme(sp); + sp_update_clipped(); +} + +// ボタンがリリースされたときの callback +static void cb_select_release(agsevent_t *e) { + int x = e->d1, y = e->d2; + sprite_t *sp = sact.sp[sact.sel.spno]; + boolean st; + int iy; + + switch (e->d3) { + case AGSEVENT_BUTTON_LEFT: + st = sp_is_insprite2(sp, x, y, sact.sel.frame_dot); + iy = (y - (sp->cur.y + sact.sel.frame_dot)) / (sact.sel.font_size + sact.sel.linespace); + + // カーソルが sprite の外の場合は無視 + if (st == FALSE) { + return; + } + + // 選択要素が空の場合も無視 + if (sact.sel.elem[iy + 1] == NULL) return; + + selected_item = iy + 1; + break; + + case AGSEVENT_BUTTON_RIGHT: + // キャンセル + selected_item = 0; + break; + } +} + +// 選択ウィンドを更新するときの callback +static int update_selwindow(sprite_t *sp) { + int selno = selected_item_cur; + int x0, y0; + + x0 = sp->cur.x; + y0 = sp->cur.y; + // 背景 CG + sp_draw(sp); + + // 選択されている要素 + if (selno && sact.sel.elem[selno] != NULL) { + int w = selcanvas->width - 2 * sact.sel.frame_dot; + int h = sact.sel.font_size + sact.sel.linespace; + int x = x0 + sact.sel.frame_dot; + int y = y0 + sact.sel.frame_dot + (selno -1) * h; + gr_fill(sf0, x, y, w, h, 0, 0, 0); + gr_drawrect(sf0, x, y, w, h, 255, 255, 255); + } + + // 選択肢文字列 + gr_expandcolor_blend(sf0, x0, y0, + sact.sel.charcanvas, 0, 0, + selcanvas->width, selcanvas->height, 255, 255, 255); + + return OK; +} + +// 選択ウィンドの準備 +static void setup_selwindow() { + sprite_t *sp = sact.sp[sact.sel.spno]; + int i; + + //選択ウィンド作業 surfaceの生成 + selcanvas = sf_dup(sp->cg1->sf); + + // 選択肢文字用 canvas + sact.sel.charcanvas = sf_create_pixel(selcanvas->width, selcanvas->height, 8); + + dt_setfont(sact.sel.font_type, sact.sel.font_size); + + // 指定のスプライトに文字(選択肢を書く) + for (i = 1; i < SEL_ELEMENT_MAX; i++) { + int x, y; + if (sact.sel.elem[i] == NULL) continue; + // 文字の場所計算 + x = 0; // 行そろえは無し + y = (i - 1) * (sact.sel.font_size + sact.sel.linespace); + dt_drawtext(sact.sel.charcanvas, + x + sact.sel.frame_dot, y + sact.sel.frame_dot, + sact.sel.elem[i]); + } + + // デフォルトで選択される選択肢がある場合、そこへカーソルを移動 + if (sact.sel.movecursor) { + ags_setCursorLocation(sp->cur.x + sact.sel.frame_dot + 2, + sp->cur.y + sact.sel.frame_dot + 2 + (sact.sel.font_size + sact.sel.linespace)*(sact.sel.movecursor -1), TRUE); + selected_item = (sact.sel.movecursor -1); + oldstate = TRUE; + oldindex = selected_item -1; + } + + // その他初期化 + selected_item_cur = 0; + + // スプライト再描画 callback の登録 + sp->update = update_selwindow; +} + +// 選択ウィンドの削除 +static void remove_selwindow() { + sprite_t *sp = sact.sp[sact.sel.spno]; + + // スプライト再描画 callback を元にもどす + sp->update = sp_draw; + + // スプライトを再描画して(おそらく消す) + sp_updateme(sp); + sp_update_clipped(); + + // 作業用 surface の削除 + sf_free(selcanvas); + sf_free(sact.sel.charcanvas); +} + + +// 選択メインループ +static int sel_main() { + sact.waittype = KEYWAIT_SELECT; + sact.waitkey = -1; + + selected_item = -1; + + while(selected_item == -1) { + sys_keywait(25, TRUE); + } + + sact.waittype = KEYWAIT_NONE; + + return selected_item; +} + +/* + 選択肢関連の初期化 +*/ +void ssel_init() { + // callbackの設定 + sact.sel.cbmove = cb_select_move; + sact.sel.cbrelease = cb_select_release; + + // デフォルトフォント + sact.sel.font_type = FONT_GOTHIC; +} + + +/* + 内部の選択肢情報をクリア +*/ +void ssel_clear() { + int i; + + for (i = 0; i < SEL_ELEMENT_MAX; i++) { + g_free(sact.sel.elem[i]); + sact.sel.elem[i] = NULL; + } +} + +/* + 登録文字列を内部選択肢情報に追加 + @param nString: 登録文字列変数 + @param wI : 登録位置 +*/ +void ssel_add(int nString, int wI) { + if ((wI >= SEL_ELEMENT_MAX -1) || (wI <= 0)) { + //error + return; + } + if (sact.sel.elem[wI] != NULL) { + g_free(sact.sel.elem[wI]); + } + + sact.sel.elem[wI] = g_strdup(v_str(nString -1)); +} + +/* + 選択ウィンドを開いて選択 + + @param wNum: 枠,背景とするスプライト番号 + @param wChoiceSize: 選択肢文字サイズ + @param wMenuOutSpc: 枠スプライトの外側からのピクセル数 + @param wChoiceLineSpace: 選択肢の行間 + @param wChoiceAutoMoveCursor: オープン時に自動的に移動する選択肢の番号 + @param nAlign: 行そろえ (0:左, 1:中央, 2: 右) +*/ +int ssel_select(int wNum, int wChoiceSize, int wMenuOutSpc, int wChoiceLineSpace, int wChoiceAutoMoveCursor, int nAlign) { + int ret = 0; + boolean saveflag; + + // check sprite number is sane + if (wNum >= (SPRITEMAX-1) || wNum <= 0) return ret; + + // check sprite is set + if (sact.sp[wNum] == NULL) return ret; + + // must be normal sprite + if (sact.sp[wNum]->type != SPRITE_NORMAL) return ret; + + sact.sel.spno = wNum; + sact.sel.font_size = wChoiceSize; + sact.sel.frame_dot = wMenuOutSpc; + sact.sel.linespace = wChoiceLineSpace; + sact.sel.movecursor = wChoiceAutoMoveCursor; + sact.sel.align = nAlign; + + // 古い sprite の表示フラグを保存 + saveflag = sact.sp[wNum]->show; + sact.sp[wNum]->show = TRUE; + setup_selwindow(); + + ret = sel_main(); + + // 表示フラグを元に戻す + sact.sp[wNum]->show = saveflag; + + remove_selwindow(); + + return ret; +} diff --git a/modules/SACT/sprite_switch.c b/modules/SACT/sprite_switch.c new file mode 100644 index 0000000..6080832 --- /dev/null +++ b/modules/SACT/sprite_switch.c @@ -0,0 +1,101 @@ +/* + * sprite_switch.c: スイッチスプライト特有の処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_switch.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "ags.h" +#include "sact.h" +#include "sactsound.h" +#include "sprite.h" + +static int eventCB_switch(sprite_t *sp, agsevent_t *e); +static void cb_remove(sprite_t *sp); + + +// スイッチスプライトのイベント処理 +static int eventCB_switch(sprite_t *sp, agsevent_t *e) { + int update = 0; + + switch(e->type) { + case AGSEVENT_BUTTON_PRESS: + if (e->d3 != AGSEVENT_BUTTON_LEFT) return 0; + + // ボタン押下時のスプライトがあれば、それを表示 + if (sp->cg3) { + sp->curcg = sp->cg3; + update++; + } + + sp->pressed = TRUE; + break; + + case AGSEVENT_BUTTON_RELEASE: + if (e->d3 != AGSEVENT_BUTTON_LEFT) return 0; + + // ここにくるときは forcusが当たっているときしかこないので、 + // curcg は cg2 に戻せばよい + if (sp->cg2) { + sp->curcg = sp->cg2; + update++; + } + + // pressされたスプライトとreleaseされたスプライトが同じ場合 + // にのみ、そのスプライトが押されたと判断 + if (sp->pressed) { + sact.sp_result_sw = sp->no; + sact.waitkey = sp->no; + if (sp->numsound2) { + ssnd_play(sp->numsound2); + } + } + sp->pressed = FALSE; + break; + } + + if (update) { + sp_updateme(sp); + } + + return update; +} + +// スプライト削除時の処理 +static void cb_remove(sprite_t *sp) { + // event listener の削除 + spev_remove_eventlistener(sp); +} + + +/* + sp_new の時にスプライトの種類毎の初期化 + @param sp: 初期化するスプライト +*/ +int sp_sw_setup(sprite_t *sp) { + spev_add_eventlistener(sp, eventCB_switch); + sp->remove = cb_remove; + return OK; +} diff --git a/modules/SACT/sprite_tevent.c b/modules/SACT/sprite_tevent.c new file mode 100644 index 0000000..5a27b3c --- /dev/null +++ b/modules/SACT/sprite_tevent.c @@ -0,0 +1,128 @@ +/* + * sprite_tevent.c: アニメーションスプライトとスプライトの移動 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_tevent.c,v 1.2 2003/04/25 17:23:55 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "menu.h" +#include "imput.h" +#include "nact.h" +#include "sact.h" +#include "sprite.h" +#include "counter.h" + +/* + + タイマイベントによるスプライトの移動とアニメーションスプライトの更新 + + 実際には、nact->callback()を全力で呼び出しでいることがほとんどで、 + タイマイベントが欲しいスプライト内部のコールバックで経過時間を計算し、 + 状態を更新している。 + + 他には system35 のメインループ nact_main() から呼ばれることや、 + X|SDLのキー待ち中等に呼ばれる。 + + スプライトの移動は SACT.Draw が呼ばれてから移動を開始し、移動終了まで + 待っているので、nact_mainから呼ばれるときはアニメーションスプライト + の更新処理だけ。 + +*/ + +static void tevent_callback(agsevent_t *e); + + +/* + タイマイベント callback メイン +*/ +static void tevent_callback(agsevent_t *e) { + GSList *node; + int update = 0; + + // SP_MOVE の同期移動のためのカウンタの読み込み + sact.movecurtime = get_high_counter(SYSTEMCOUNTER_MSEC); + + for (node = sact.teventlisteners; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + if (sp == NULL) continue; + if (sp->teventcb == NULL) continue; + + // 非表示ではイベントに反応しない + if (!sp->show) continue; + + // スプライト毎のタイマイベントハンドラの呼び出し + update += sp->teventcb(sp, e); + } + + // 変更があれば画面を更新 + if (update) { + sp_update_clipped(); + } + + // timer event litener の削除 (上のループ内で削除できないので) + for (node = sact.teventremovelist; node; node = node->next) { + sprite_t *sp = (sprite_t *)node->data; + if (sp == NULL) continue; + sact.teventlisteners = g_slist_remove(sact.teventlisteners, sp); + } + g_slist_free(sact.teventremovelist); + sact.teventremovelist = NULL; +} + +/* + タイマイベント callback の登録 + @param sp: 登録するスプライト + @param cb: 呼び出されるcallback +*/ +void spev_add_teventlistener(sprite_t *sp, int (*cb)(sprite_t *, agsevent_t *)) { + sp->teventcb = cb; + sact.teventlisteners = g_slist_append(sact.teventlisteners, sp); +} + +/* + 上で登録した callback の削除 + @param sp: 削除するスプライト +*/ +void spev_remove_teventlistener(sprite_t *sp) { + sact.teventlisteners = g_slist_remove(sact.teventlisteners, sp); +} + +/* + system35のメインループからで呼ばれるコールバック +*/ +void spev_main() { + agsevent_t e; + + e.type = AGSEVENT_TIMER; + tevent_callback(&e); + + // デフォルトのコールバックのうち、ここで必要なものだけ + // 処理。(VAコマンドcallbackはなし) + if (nact->popupmenu_opened) { + menu_gtkmainiteration(); + if (nact->is_quit) sys_exit(0); + } +} diff --git a/modules/SACT/sprite_update.c b/modules/SACT/sprite_update.c new file mode 100644 index 0000000..9ffbf3c --- /dev/null +++ b/modules/SACT/sprite_update.c @@ -0,0 +1,242 @@ +/* + * sprite_update.c: spriteの通常更新いろいろ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_update.c,v 1.1 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "ags.h" +#include "graphics.h" +#include "sact.h" +#include "surface.h" +#include "ngraph.h" +#include "sprite.h" + +// スプライト再描画間の間に変更のあったスプライトの領域の和 +static GSList *updatearea; + +static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst); +static void disjunction(gpointer region, gpointer data); +static void get_updatearea(); +static void do_update_each(gpointer data, gpointer userdata); + +// 領域1と領域2の積を計算 +static void intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst) { + int x1 = max(r1->x, r2->x); + int x2 = min(r1->x + r1->width, r2->x + r2->width); + int y1 = max(r1->y, r2->y); + int y2 = min(r1->y + r1->height, r2->y + r2->height); + + rst->x = x1; + rst->y = y1; + rst->width = x2 - x1; + rst->height = y2 - y1; +} + +// 領域1と領域2をすべて含む矩形領域を計算 +static void disjunction(gpointer region, gpointer data) { + MyRectangle *r1 = (MyRectangle *)region; + MyRectangle *r2 = (MyRectangle *)data; + int x1, x2, y1, y2; + + //WARNING("r1x=%d,r1y=%d,r1w=%d,r1h=%d\n", r1->x, r1->y, r1->width, r1->height); + //WARNING("r2x=%d,r2y=%d,r2w=%d,r2h=%d\n", r2->x, r2->y, r2->width, r2->height); + + if (r2->width == 0) { + r2->x = r1->x; + r2->y = r1->y; + r2->width = r1->width; + r2->height = r1->height; + return; + } + + x1 = min(r1->x, r2->x); + x2 = max(r1->x + r1->width, r2->x + r2->width); + y1 = min(r1->y, r2->y); + y2 = max(r1->y + r1->height, r2->y + r2->height); + + r2->x = x1; + r2->y = y1; + r2->width = x2 - x1; + r2->height = y2 - y1; + + //WARNING("res:r2x=%d,r2y=%d,r2w=%d,r2h=%d\n", r2->x, r2->y, r2->width, r2->height); +} + +// 更新の必要なスプライトの領域の和をとってクリッピングする +static void get_updatearea() { + MyRectangle clip = {0, 0, 0, 0}; + MyRectangle rsf0 = {0, 0, sf0->width, sf0->height}; + + g_slist_foreach(updatearea, disjunction, &clip); + + g_slist_free(updatearea); + updatearea = NULL; + + // surface0との領域の積をとる + intersection(&rsf0, &clip, &sact.updaterect); + + WARNING("clipped area x=%d y=%d w=%d h=%d\n", + sact.updaterect.x, sact.updaterect.y, + sact.updaterect.width, sact.updaterect.height); + + return; +} + +// updatelist に登録してあるすべてのスプライトを更新 +static void do_update_each(gpointer data, gpointer userdata) { + sprite_t *sp = (sprite_t *)data; + + // 非表示の場合はなにもしない + if (!sp->show) return; + + if (sp == sact.draggedsp) return; // drag中のスプライトは最後に表示 + + // スプライト毎のupdateルーチンの呼び出し + if (sp->update) { + sp->update(sp); + } +} + +/* + 画面全体の更新 + @param syncscreen: surface0 に描画したものを Screen に反映させるかどうか + */ +int sp_update_all(boolean syncscreen) { + + // スプライト移動がある場合は移動開始 + if (sact.movelist) { + // 移動開始時間を合わせる + sact.movestarttime = get_high_counter(SYSTEMCOUNTER_MSEC); + g_slist_foreach(sact.movelist, spev_move_setup, NULL); + g_slist_free(sact.movelist); + sact.movelist = NULL; + } + + // 画面全体を更新領域に + sact.updaterect.x = 0; + sact.updaterect.y = 0; + sact.updaterect.width = sf0->width; + sact.updaterect.height = sf0->height; + + // updatelistに登録してあるスプライトを再描画 + // updatelistはスプライトの番号順に並んでいる + g_slist_foreach(sact.updatelist, do_update_each, NULL); + + // このルーチンが呼ばれるときはスプライトはドラッグ中ではない + + // screenと同期は必要なときは画面全体をWindowへ転送 + if (syncscreen) { + ags_updateFull(); + } + + // 移動中のすべてのスプライトが移動終了するまで待つ + // こうしないと動きが同期しない + spev_wait4moving_sp(); + + return OK; +} + +/* + 画面の一部を更新 + updateme(_part)で登録した更新が必要なspriteの和の領域をupdate +*/ +int sp_update_clipped() { + // 更新領域の確定 + get_updatearea(); + + // 幅または高さが 0 の時はなにもしない + if (sact.updaterect.width == 0 || sact.updaterect.height == 0) { + return OK; + } + + // 更新領域に入っているスプライトの再描画 + g_slist_foreach(sact.updatelist, do_update_each, NULL); + + // drag中のスプライトを最後に描画 + if (sact.draggedsp) { + sact.draggedsp->update(sact.draggedsp); + } + + // 更新領域を Window に転送 + ags_updateArea(sact.updaterect.x, sact.updaterect.y, sact.updaterect.width, sact.updaterect.height); + + return OK; +} + +/* + sprite全体の更新を登録 + @param sp: 更新するスプライト +*/ +int sp_updateme(sprite_t *sp) { + MyRectangle *r; + + if (sp == NULL) return NG; + if (sp->cursize.width == 0 || sp->cursize.height == 0) return NG; + + r = g_new(MyRectangle, 1); + r->x = sp->cur.x; + r->y = sp->cur.y; + r->width = sp->cursize.width; + r->height = sp->cursize.height; + + updatearea = g_slist_append(updatearea, r); + + WARNING("x = %d, y = %d, spno = %d w=%d,h=%d\n", + r->x, r->y, sp->no, r->width, r->height); + + return OK; +} + +/* + spriteの一部更新を登録 + @param sp: 更新するスプライト + @param x: 更新領域X座標 + @param y: 更新領域Y座標 + @param w: 更新領域幅 + @param h: 更新領域高さ +*/ +int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) { + MyRectangle *r; + + if (sp == NULL) return NG; + if (w == 0 || h == 0) return NG; + + r = g_new(MyRectangle, 1); + r->x = sp->cur.x + x; + r->y = sp->cur.y + y; + r->width = w; + r->height = h; + + updatearea = g_slist_append(updatearea, r); + + WARNING("x = %d, y = %d, spno = %d w=%d,h=%d\n", + r->x, r->y, sp->no, r->width, r->height); + + return OK; +} + diff --git a/modules/SACT/sprite_xmenu.c b/modules/SACT/sprite_xmenu.c new file mode 100644 index 0000000..676fdd0 --- /dev/null +++ b/modules/SACT/sprite_xmenu.c @@ -0,0 +1,84 @@ +/* + * sprite_xmenu.c: XMenuXXX + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sprite_xmenu.c,v 1.2 2003/07/14 16:22:51 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "nact.h" +#include "variable.h" +#include "sact.h" + +struct _xm { + char *title; + int ret[SEL_ELEMENT_MAX]; + char *item[SEL_ELEMENT_MAX]; +}; + +static struct _xm xmenu; + +int spxm_clear(void) { + int i; + + free(xmenu.title); xmenu.title = NULL; + for (i = 0; i < SEL_ELEMENT_MAX; i++) { + free(xmenu.item[i]); xmenu.item[i] = NULL; + xmenu.ret[i] = 0; + } + return OK; +} + +int spxm_register(int reginum, int menuid) { + if (reginum > SEL_ELEMENT_MAX) return NG; + + xmenu.ret[reginum] = menuid; + xmenu.item[reginum] = strdup(sact.msgbuf); + sact.msgbuf[0] = '\0'; + return OK; +} + +int spxm_getnum(int reginum) { + if (reginum > SEL_ELEMENT_MAX) return 0; + return xmenu.ret[reginum]; +} + +int spxm_gettext(int reginum, int strno) { + if (reginum > SEL_ELEMENT_MAX) return NG; + v_strcpy(strno -1, xmenu.item[reginum]); + return OK; +} + +int spxm_titlereg(void) { + xmenu.title = strdup(sact.msgbuf); + sact.msgbuf[0] = '\0'; + return OK; +} + +int spxm_titleget(int strno) { + v_strcpy(strno -1, xmenu.title); + return OK; +} diff --git a/modules/ShArray/Makefile.am b/modules/ShArray/Makefile.am new file mode 100644 index 0000000..c948433 --- /dev/null +++ b/modules/ShArray/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = ShArray.la + +ShArray_la_LDFLAGS = -module -export-dynamic -avoid-version +ShArray_la_SOURCES = ShArray.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShArray -I$(top_srcdir)/modules/ShArray diff --git a/modules/ShArray/Makefile.in b/modules/ShArray/Makefile.in new file mode 100644 index 0000000..e2f7f1f --- /dev/null +++ b/modules/ShArray/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/ShArray +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +ShArray_la_LIBADD = +am_ShArray_la_OBJECTS = ShArray.lo +ShArray_la_OBJECTS = $(am_ShArray_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ShArray_la_SOURCES) +DIST_SOURCES = $(ShArray_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = ShArray.la +ShArray_la_LDFLAGS = -module -export-dynamic -avoid-version +ShArray_la_SOURCES = ShArray.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShArray -I$(top_srcdir)/modules/ShArray + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/ShArray/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/ShArray/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +ShArray.la: $(ShArray_la_OBJECTS) $(ShArray_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(ShArray_la_LDFLAGS) $(ShArray_la_OBJECTS) $(ShArray_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShArray.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/ShArray/ShArray.c b/modules/ShArray/ShArray.c new file mode 100644 index 0000000..91580f0 --- /dev/null +++ b/modules/ShArray/ShArray.c @@ -0,0 +1,1342 @@ +/* + * ShArray.c 各種配列演算 module + * + * かえるにょ国にょアリス + * 大悪司 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ShArray.c,v 1.4 2002/08/18 09:35:29 chikama Exp $ */ + +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + +void GetAtArray(void) { /* 0 */ + /* + 配列から演算しながら値を取り出す + + vAry: 配列 + cnt : 個数 + type: 演算の種類 + vResult: 演算結果を返す変数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int type = getCaliValue(); + int *vResult = getCaliVariable(); + int i, j; + + DEBUG_COMMAND("ShArray.GetAtArray %p,%d,%d,%p:\n", vAry, cnt, type, vResult); + + j = *vAry; vAry++; + for (i = 1; i < cnt; i++) { + switch(type) { + case 1: + j += *vAry; + break; + case 2: + j *= *vAry; + break; + case 3: + j &= *vAry; + break; + case 4: + j |= *vAry; + break; + case 5: + j ^= *vAry; + break; + } + vAry++; + } + + if (j > 65535) { + j = 65535; + } + + *vResult = j; +} + +void AddAtArray(void) { /* 1 */ + /* + 配列1に配列2を足す。65535 を超えたら 65535 に。 + + vAry1: 配列1 + vAry2: 配列2 + cnt : 個数 + */ + int *vAry1 = getCaliVariable(); + int *vAry2 = getCaliVariable(); + int cnt = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.AddAtArray %p,%p,%d:\n", vAry1, vAry2, cnt); + + for (i = 0; i < cnt; i++) { + int result = (*vAry1) + (*vAry2); + if (result > 65535) { + *vAry1 = 65535; + } else { + *vAry1 = result; + } + vAry1++; vAry2++; + } +} + +void SubAtArray(void) { /* 2 */ + /* + 配列1から配列2を引く。負になったら0をかく + + vAry1: 配列1 + vAry2: 配列2 + cnt : 個数 + */ + int *vAry1 = getCaliVariable(); + int *vAry2 = getCaliVariable(); + int cnt = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.SubAtArray %p,%p,%d:\n", vAry1, vAry2, cnt); + + for (i = 0; i < cnt; i++) { + int result = (*vAry1) - (*vAry2); + if (result < 0) { + *vAry1 = 0; + } else { + *vAry1 = result; + } + vAry1++; vAry2++; + } +} + +void MulAtArray(void) { /* 3 */ + /* + 配列1に配列2をかけて、配列1に格納、65535まで。 + + vAry1: 配列1 + vAry2: 配列2 + cnt : 個数 + */ + int *vAry1 = getCaliVariable(); + int *vAry2 = getCaliVariable(); + int cnt = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.MulAtArray %p,%p,%d:\n", vAry1, vAry2, cnt); + + for (i = 0; i < cnt; i++) { + int result = (*vAry1) * (*vAry2); + if (result > 65535) { + *vAry1 = 65535; + } else { + *vAry1 = result; + } + vAry1++; vAry2++; + } +} + +void DivAtArray(void) { /* 4 */ + /* + 配列1を配列2で割って、配列1に格納、65535まで。 + + vAry1: 配列1 + vAry2: 配列2 + cnt : 個数 + */ + int *vAry1 = getCaliVariable(); + int *vAry2 = getCaliVariable(); + int cnt = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.DivAtArray: %d,%d,%d:\n", vAry1, vAry2, cnt); + + for (i = 0; i < cnt; i++) { + if (*vAry2 == 0) { + *vAry1 = 0; + } else { + int result = (*vAry1) / (*vAry2); + if (result > 65535) { + *vAry1 = 65535; + } else { + *vAry1 = result; + } + } + vAry1++; vAry2++; + } +} + +void MinAtArray(void) { /* 5 */ + /* + 配列 vAry1 の中身を配列 vAry2 で下限に設定する + + vAry1: 配列1 + vAry2: 配列2 + cnt : 個数 + */ + int *vAry1 = getCaliVariable(); + int *vAry2 = getCaliVariable(); + int cnt = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.MinAtArray: %d,%d,%d:\n", vAry1, vAry2, cnt); + + for (i = 0; i < cnt; i++) { + if (*vAry1 < *vAry2) { + *vAry1 = *vAry2; + } + vAry1++; vAry2++; + } +} + +void MaxAtArray(void) { /* 6 */ + /* + 配列 vAry1 の中身を配列 vAry2 で上限に設定する + + vAry1: 配列1 + vAry2: 配列2 + cnt : 個数 + */ + int *vAry1 = getCaliVariable(); + int *vAry2 = getCaliVariable(); + int cnt = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.MaxAtArray: %d,%d,%d:\n", vAry1, vAry2, cnt); + + for (i = 0; i < cnt; i++) { + if (*vAry1 > *vAry2) { + *vAry1 = *vAry2; + } + vAry1++; vAry2++; + } +} + +void AndNumArray(void) { /* 7 */ + /* + 配列のデータと val で AND をとる + + vAry: 配列 + cnt : 個数 + val : ANDをとる値 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.AndNumArray: %p,%d,%d:\n", vAry, cnt, val); + + for (i = 0; i < cnt; i++) { + (*vAry) &= val; + vAry++; + } +} + +void OrNumArray(void) { /* 8 */ + /* + 配列のデータと val で OR をとる + + vAry: 配列 + cnt : 個数 + val : ORをとる値 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int i; + + DEBUG_COMMAND_YET("ShArray.OrNumArray: %p,%d,%d:\n", vAry, cnt, val); + + for (i = 0; i < cnt; i++) { + (*vAry) |= val; + vAry++; + } +} + +void XorNumArray(void) { /* 9 */ + /* + 配列のデータと val で XOR をとる + + vAry: 配列 + cnt : 個数 + val : XORをとる値 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.XorNumArray %p,%d,%d:\n", vAry, cnt, val); + + for (i = 0; i < cnt; i++) { + (*vAry) ^= val; + vAry++; + } +} + +void SetEquArray(void) { /* 10 */ + /* + 配列が val と等しければ 配列 vResults に 1 を、そうでなければ + 0 を代入 + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vResults : 結果を格納する配列 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.SetEquArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + *vResults = (*vAry == val) ? 1 : 0; + vResults++; vAry++; + } +} + +void SetNotArray(void) { /* 11 */ + /* + 配列が val と等しくなければ配列 vResults に 1 を、そうでなければ + 0 を代入 + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vResults : 結果を格納する配列 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.SetNotArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + *vResults = (*vAry != val) ? 1 : 0; + vResults++; vAry++; + } +} + +void SetLowArray(void) { /* 12 */ + /* + 配列データが val よりも小さければ vResult に 1 をセット + + vAry: 配列 + cnt : 個数 + val : 閾値 + vResult: 結果を返す変数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.SetLowArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + (*vResults) = ((*vAry < val) ? 1 : 0); + vResults++; vAry++; + } +} + +void SetHighArray(void) { /* 13 */ + /* + 配列データが val よりも大きければ vResult に 1 をセット + + vAry: 配列 + cnt : 個数 + val : 閾値 + vResults: 結果を返す変数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.SetHighArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + (*vResults) = ((*vAry > val) ? 1 : 0); + vResults++; vAry++; + } +} + +void SetRangeArray(void) { /* 14 */ + /* + 配列データがある範囲(min〜max)にあるかチェック + + vAry: 配列 + cnt : 個数 + min : 最小値 + max : 最大値 + vResults: 結果を返す変数 + min < vAry < max の時 vResults = 1; + それ以外 vResults = 0; + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int max = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.SetRangeArray %p,%d,%d,%d,%p:\n", vAry, cnt, min, max, vResults); + + for (i = 0; i < cnt; i++) { + *vResults = ((*vAry > min) && (*vAry < max)) ? 1 : 0; + vResults++; vAry++; + } +} + +void SetAndEquArray(void) { /* 15 */ + /* + 配列 vAry と mask との AND をとって val に等しければ + 配列 vResults に1を、等しくなければ 0 を書く + + vAry: 配列 + mask: 配列にかけるマスク + cnt : 個数 + val : 比較する値 + vResults : 結果を代入する配列 + + */ + int *vAry = getCaliVariable(); + int mask = getCaliValue(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.SetAndEquArray: %p,%d,%d,%d,%p:\n", vAry, mask, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + *vResults = ((*vAry & mask) == val) ? 1 : 0; + vResults++; vAry++; + } +} + +void AndEquArray(void) { /* 16 */ + /* + 配列 vAry 中で val と同じならば、vResult と 1 の AND を + 違うならば 0 をかく。 + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vResults : 結果を代入する配列 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.AndEquArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + *vResults &= ((*vAry == val) ? 1 : 0); + vResults++; vAry++; + } +} + +void AndNotArray(void) { /* 17 */ + /* + 配列 vAry 中で val と等しくないならば、vResult と 1 の AND を + 違う場合は 0 をかく。 + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vResults : 結果を代入する配列 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.AndNotArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + *vResults &= ((*vAry != val) ? 1 : 0); + vResults++; vAry++; + } +} + +void AndLowArray(void) { /* 18 */ + /* + 配列 vAry が min よりも小さいならば、vResult と 1 の AND を + そうでないならば 0 をかく。 + + vAry: 配列 + cnt : 個数 + min : 最小値 + vResults : 結果を代入する配列 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.AndLowArray: %d,%d,%d,%d:\n", vAry, cnt, min, vResults); + + for (i = 0; i < cnt; i++) { + *vResults &= ((*vAry < min) ? 1 : 0); + vResults++; vAry++; + } +} + +void AndHighArray(void) { /* 19 */ + /* + 配列 vAry が min よりも大きいならば、vResult と 1 の AND を + そうでないならば 0 をかく。 + + vAry: 配列 + cnt : 個数 + max : 最小値 + vResults : 結果を代入する配列 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int max = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.AndHighArray: %p,%d,%d,%p:\n", vAry, cnt, max, vResults); + + for (i = 0; i < cnt; i++) { + *vResults &= ((*vAry > max) ? 1 : 0); + vResults++; vAry++; + } +} + +void AndRangeArray(void) { /* 20 */ + /* + vAry が min から max にある場合、vResults と 1 の AND を + そうでなければ 0 をかく。 + + vAry: 配列 + cnt: 個数 + min: 最小値 + max: 最大値 + vResults: 結果を返す配列 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int max = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.AndRangeArray %d,%d,%d,%d,%d:\n", vAry, cnt, min, max, vResults); + + for (i = 0; i < cnt; i++) { + *vResults &= (((*vAry > min) && (*vAry < max)) ? 1 : 0); + vResults++; vAry++; + } +} + +void AndAndEquArray(void) { /* 21 */ + /* + 配列 vAry と mask との AND をとって val に等しければ + 配列 vResults と1の AND、等しくなければ 0 を書く + + vAry: 配列 + mask: 配列にかけるマスク + cnt : 個数 + val : 比較する値 + vResults : 結果を代入する配列 + + */ + int *vAry = getCaliVariable(); + int mask = getCaliValue(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.AndAndEquArray: %d,%d,%d,%d,%d:\n", vAry, mask, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + (*vResults) &= (((*vAry & mask) == val) ? 1 : 0); + vResults++; vAry++; + } +} + +void OrEquArray(void) { /* 22 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.OrEquArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void OrNotArray(void) { /* 23 */ + /* + 配列の値が val と等しくなければ vResult に 1 を書き込む + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vResults: 結果を書き込む変数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResults = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.OrNotArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults); + + for (i = 0; i < cnt; i++) { + // if (*vAry != val) *vResults = 1; + (*vResults) |= ((*vAry != val) ? 1 : 0); + vResults++; vAry++; + } +} + +void OrLowArray(void) { /* 24 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.OrLowArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void OrHighArray(void) { /* 25 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.OrHighArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void OrRangeArray(void) { /* 26 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.OrRangeArray: %d,%d,%d,%d,%d:\n", p1, p2, p3, p4,p5); +} + +void OrAndEquArray(void) { /* 27 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.OrAndEquArray: %d,%d,%d,%d,%d:\n", p1, p2, p3, p4,p5); +} + +void EnumEquArray(void) { /* 28 */ + /* + 配列のデータ中に val と同じデータを数を vResult に返す + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vResult: 一致する個数を返す変数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.EnumEquArray %p,%d,%d,%p:\n", vAry, cnt, val, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if (*vAry == val) (*vResult)++; + vAry++; + } +} + +void EnumEquArray2(void) { /* 29 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.EnumEquArray2: %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6); +} + +void EnumEquNotArray2(void) { /* 30 */ + /* + 配列1が val1 に等しく、配列2がval2 に等しくないものの数を + vResult に返す。 + + vAry1: 配列1 + vAry2: 配列2 + cnt: 個数 + val1: 配列1と比較する値 + val2: 配列2と比較する値 + vResult: 条件に一致する数を返す変数 + */ + int *vAry1 = getCaliVariable(); + int *vAry2 = getCaliVariable(); + int cnt = getCaliValue(); + int val1 = getCaliValue(); + int val2 = getCaliValue(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.EnumEquNotArray2 %p,%p,%d,%d,%d,%p:\n", vAry1, vAry2, cnt, val1, val2, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if ((*vAry1 == val1) && (*vAry2 != val2)) { + (*vResult)++; + } + vAry1++; vAry2++; + } +} + +void EnumNotArray(void) { /* 31 */ + /* + 配列のなかで val と等しくないものの個数を返す + + vAry: 配列 + cnt: 個数 + val: 比較する値 + vResult: 等しくないものの数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.EnumNotArray %p, %d, %d, %p:\n", vAry, cnt, val, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if (*vAry != val) { + (*vResult)++; + } + vAry++; + } +} + +void EnumNotArray2(void) { /* 32 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.EnumNotArray2: %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6); +} + +void EnumLowArray(void) { /* 33 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.EnumLowArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void EnumHighArray(void) { /* 34 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.EnumHighArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void EnumRangeArray(void) { /* 35 */ + /* + 配列の値のうちが min と max の間あるものの数を vResult に返す + + vAry: 配列 + cnt : 個数 + min : 最小値 + max : 最大値 + vResult: 一致した数を返す変数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int max = getCaliValue(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.EnumRangeArray %d,%d,%d,%d,%d:\n", vAry, cnt, min, max, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if ((*vAry > min) && (*vAry < max)) { + (*vResult)++; + } + vAry++; + } + +} + +void GrepEquArray(void) { /* 36 */ + /* + 配列の値が val と等しければ vLastMatch に一致した index を返し + vResult に 1 を返す + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vMatch: 一致したインデックス + vResult: 一つでも val と同じ値があれば 1 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vMatch = getCaliVariable(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.GrepEquArray %p,%d,%d,%p,%p:\n", vAry, cnt, val, vMatch, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if (*vAry == val) { + *vMatch = i; + *vResult = 1; + return; + } + vAry++; + } +} + +void GrepNotArray(void) { /* 37 */ + /* + 配列の値が val と等しくなければ vLastMatch にその index を返し + vResult に 1 を返す + + vAry: 配列 + cnt : 個数 + val : 比較する値 + vMatch: 一致するindex + vResult: 一つでも val と同じ値があれば 1 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int val = getCaliValue(); + int *vMatch = getCaliVariable(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.GrepNotArray %p,%d,%d,%p,%p:\n", vAry, cnt, val, vMatch, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if (*vAry != val) { + *vMatch = i; + *vResult = 1; + return; + } + vAry++; + } +} + +void GrepEquArray2(void) { /* 38 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.GrepEquArray2: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7); +} + +void GrepNotArray2(void) { /* 39 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.GrepNotArray2: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7); +} + +void GrepEquNotArray2(void) { /* 40 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.GrepEquNotArray2: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7); +} + +void GrepLowArray(void) { /* 41 */ + /* + 配列の値が min よりも小さければ vMatch に一致した index + を返し vResult に 1 を返す + + vAry: 配列 + cnt : 個数 + min : 最小値 + vMatch: 一致したインデックス + vResult: 一つでも val と同じ値があれば 1 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int *vMatch = getCaliVariable(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.GrepLowArray: %p,%d,%d,%p,%p:\n", vAry, cnt, min, vMatch, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if (*vAry < min) { + *vMatch = i; + *vResult = 1; + return; + } + vAry++; + } +} + +void GrepHighArray(void) { /* 42 */ + /* + 配列の値が min よりも大きければ vMatch に一致した index + を返し vResult に 1 を返す + + vAry: 配列 + cnt : 個数 + max : 最大値 + vMatch: 一致したインデックス + vResult: 一つでも val と同じ値があれば 1 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int max = getCaliValue(); + int *vMatch = getCaliVariable(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.GrepHighArray: %p,%d,%d,%p,%p:\n", vAry, cnt, max, vMatch, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if (*vAry > max) { + *vMatch = i; + *vResult = 1; + return; + } + vAry++; + } +} + +void GrepRangeArray(void) { /* 43 */ + /* + 配列の値が max と min の間にあれば vMatch に一致した index + を返し vResult に 1 を返す + + vAry: 配列 + cnt : 個数 + min : 最小値 + max : 最大値 + vMatch: 一致したインデックス + vResult: 一つでも val と同じ値があれば 1 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int max = getCaliValue(); + int *vMatch = getCaliVariable(); + int *vResult = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShArray.GrepRangeArray %p,%d,%d,%d,%p,%p:\n", vAry, cnt, max, min, vMatch, vResult); + + *vResult = 0; + + for (i = 0; i < cnt; i++) { + if ((*vAry > min) && (*vAry < max)) { + *vMatch = i; + *vResult = 1; + return; + } + vAry++; + } +} + +void GrepLowOrderArray(void) { /* 44 */ + /* + 配列 vAry の中で minよりも大きく、 max よりも小さいもの + のうち、最も小さいものの index を vLastMatch に返す。 + ただし。v1[index] は 0 である必要がある。 + + vAry: 配列 + cnt : 個数 + min : 最小値 + max : 最大値 + v1 : 結果を返す配列(0 の場所しか比較せず、最小の場所に 1 を書く + vLastMatch: 最小値を示す配列のindex + vResult: 最小値が見つかれば 1, 見つからなければ 0 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int max = getCaliValue(); + int *v1 = getCaliVariable(); + int *vLastMatch = getCaliVariable(); + int *vResult = getCaliVariable(); + int i, j, k = 0; + + DEBUG_COMMAND("ShArray.GrepLowOrderArray %p,%d,%d,%d,%p,%p,%p:\n", vAry, cnt, min, max, v1, vLastMatch, vResult); + + *vResult = 0; + for (i = 0; i < cnt; i++) { + if((*(vAry + i) == min) && (*(v1 + i) == 0)) { + *vResult = 1; + *vLastMatch = i; + *(v1 + i) = 1; + return; + } + } + + j = 65536; + for (i = 0; i < cnt; i++) { + if ((*(vAry + i) > min) && (*(vAry + i) < max) && + (*(v1 + i) == 0) && (*(vAry + i) < j)) { + j = *(vAry + i); + k = i; + } + } + if (j < 65536) { + *vResult = 1; + *vLastMatch = k; + *(v1 + k) = 1; + } + +} + +void GrepHighOrderArray(void) { /* 45 */ + /* + 配列 vAry の中で minよりも大きく、 max よりも小さいもの + のうち、最も大きいものの index を vLastMatch に返す。 + ただし。v1[index] は 0 である必要がある。 + + vAry: 配列 + cnt : 個数 + min : 最小値 + max : 最大値 + v1 : 結果を返す配列(0 の場所しか比較せず、最小の場所に 1 を書く + vLastMatch: 最大値を示す配列のindex + vResult: 最大値が見つかれば 1, 見つからなければ 0 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int max = getCaliValue(); + int *v1 = getCaliVariable(); + int *vLastMatch = getCaliVariable(); + int *vResult = getCaliVariable(); + int i, j, k = 0; + + DEBUG_COMMAND("ShArray.GrepHighOrderArray %p,%d,%d,%d,%p,%p,%p:\n", vAry, cnt, min, max, v1, vLastMatch, vResult); + + *vResult = 0; + for (i = 0; i < cnt; i++) { + if ((*(vAry + i) == max) && (*(v1 + i) == 0)) { + *vResult = 1; + *vLastMatch = i; + *(v1 + i) = 1; + return; + } + } + + j = -1; + for (i = 0; i < cnt; i++) { + if ((*(vAry + i) >= min) && (*(vAry + i) < max) && + (*(v1 + i) == 0) && (*(vAry + i) > j)) { + j = *(vAry + i); + k = i; + } + } + if (j >= 0) { + *vResult = 1; + *vLastMatch = k; + *(v1 + k) = 1; + } +} + +void ChangeEquArray(void) { /* 46 */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int src = getCaliValue(); + int dst = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.ChangeEquArray: %d,%d,%d,%d:\n", vAry, cnt, src, dst); + + for (i = 0; i < cnt; i++) { + if (*vAry == src) { + *vAry = dst; + } + vAry++; + } +} + +void ChangeNotArray(void) { /* 47 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.ChangeNotArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void ChangeLowArray(void) { /* 48 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.ChangeLowArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void ChangeHighArray(void) { /* 49 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("ShArray.ChangeHighArray: %d,%d,%d,%d:\n", p1, p2, p3, p4); +} + +void ChangeRangeArray(void) { /* 50 */ + /* + 配列内データが min から max の間にあるときは val で置き換え + + vAry: 配列 + cnt : 個数 + min : 最小値 + max : 最大値 + val : 置き換える値 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int min = getCaliValue(); + int max = getCaliValue(); + int val = getCaliValue(); + int i; + + DEBUG_COMMAND("ShArray.ChangeRangeArray %p,%d,%d,%d,%d:\n", vAry, cnt, min, max, val); + + for (i = 0; i < cnt; i++) { + if ((*vAry > min) && (*vAry < max)) { + *vAry = val; + } + vAry++; + } +} + +void CopyArrayToRect(void) { /* 51 */ + /* + vSrc の sw * sh の領域を vDst の dx,dy の位置にコピー + + vSrc: コピー元配列 + sw : コピー元 width + sh : コピー元 height + sx : コピー元 x + sy : コピー元 y + vDst: コピー先配列 + dw : コピー先 width + dh : コピー先 height + */ + int *vSrc = getCaliVariable(); + int sw = getCaliValue(); + int sh = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int *vDst = getCaliVariable(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int x, y; + + DEBUG_COMMAND("ShArray.CopyArrayToRect %p,%d,%d,%d,%d,%p,%d,%d:\n", vSrc, sw, sh, sx, sy, vDst, dw, dh); + + vSrc += (sy * sw + sx); + for (y = 0; y < dh; y++) { + for (x = 0; x < dw; x++) { + *(vDst + x) = *(vSrc + x); + } + vSrc += sw; vDst += dw; + } +} + +void CopyRectToArray(void) { /* 52 */ + /* + vSrc の sw * sh の領域を vDst の dx,dy の位置にコピー + + vSrc: コピー元配列 + sw : コピー元 width + sh : コピー元 height + vDst: コピー先配列 + dw : コピー先 width + dh : コピー先 height + dx : コピー先 x + dy : コピー先 y + */ + int *vSrc = getCaliVariable(); + int sw = getCaliValue(); + int sh = getCaliValue(); + int *vDst = getCaliVariable(); + int dw = getCaliValue(); + int dh = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int x, y; + + DEBUG_COMMAND("ShArray.CopyRectToArray %p,%d,%d,%p,%d,%d,%d,%d:\n", vSrc, sw, sh, vDst, dw, dh, dx, dy); + + vDst += (dy * dw + dx); + for (y = 0; y < sh; y++) { + for (x = 0; x < sw; x++) { + *(vDst + x) = *(vSrc + x); + } + vSrc += sw; vDst += dw; + } +} + +void ChangeSecretArray(void) { /* 53 */ + /* + 良く分からないが、データをコード化しているようだ + + vAry: 配列 + cnt : 個数 + type: 機能番号 + vResult: 結果を返す変数 + */ + int *vAry = getCaliVariable(); + int cnt = getCaliValue(); + int type = getCaliValue(); + int *vResult = getCaliVariable(); + static WORD key[4] = { 0x7A7A, 0xADAD, 0xBCBC, 0xCECE }; /* key */ + + DEBUG_COMMAND("ShArray.ChangeSecretArray %p,%d,%d,%p:\n", vAry, cnt, type, vResult); + + *vResult = 0; + + switch(type) { + case 0: + /* + cnt -1 番目のキーを vAry に取り出す + */ + if (cnt > 0 && cnt < 5) { + *vAry = key[cnt -1]; + *vResult = 1; + } + break; + case 1: + /* + vAry を cnt -1 番目のキーにセットする + */ + if (cnt > 0 && cnt < 5) { + key[cnt -1] = *vAry; + *vResult = 1; + } + break; + case 2: + { + /* + エンコードその1 + */ + int i, j = 0; + WORD ax = key[3] ^ 0x5a5a; + for (i = 0; i < cnt; i++) { + (*vAry) ^= ax; ax = (key[i&3] ^ *vAry); + j ^= ax; + if (i & 2) { + ax = !ax ^ (i*3); + } + if (i & 4) { + ax = (ax >> 4) | (ax << 12); + } + vAry++; + } + *vResult = j; + } + break; + case 3: + { + /* + エンコードその2 + */ + int i, j = 0, k; + WORD ax = key[3] ^ 0x5a5a; + for (i = 0; i < cnt; i++) { + k = *vAry; + *vAry ^= ax; ax = (key[i&3] ^ k); + j ^= ax; + if (i & 2) { + ax = !ax ^ (i*3); + } + if (i & 4) { + ax = (ax >> 4) | (ax << 12); + } + vAry++; + + } + *vResult = j; + } + break; + } +} diff --git a/modules/ShCalc/Makefile.am b/modules/ShCalc/Makefile.am new file mode 100644 index 0000000..9a9b2ec --- /dev/null +++ b/modules/ShCalc/Makefile.am @@ -0,0 +1,14 @@ +pkglib_LTLIBRARIES = ShCalc.la + +ShCalc_la_LDFLAGS = -module -export-dynamic -avoid-version +ShCalc_la_SOURCES = ShCalc.c +ShCalc_la_LIBADD = @GLIB_LIBS@ + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShCalc -I$(top_srcdir)/modules/ShCalc + + diff --git a/modules/ShCalc/Makefile.in b/modules/ShCalc/Makefile.in new file mode 100644 index 0000000..79e2b59 --- /dev/null +++ b/modules/ShCalc/Makefile.in @@ -0,0 +1,558 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/ShCalc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +ShCalc_la_DEPENDENCIES = +am_ShCalc_la_OBJECTS = ShCalc.lo +ShCalc_la_OBJECTS = $(am_ShCalc_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ShCalc_la_SOURCES) +DIST_SOURCES = $(ShCalc_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = ShCalc.la +ShCalc_la_LDFLAGS = -module -export-dynamic -avoid-version +ShCalc_la_SOURCES = ShCalc.c +ShCalc_la_LIBADD = @GLIB_LIBS@ +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShCalc -I$(top_srcdir)/modules/ShCalc + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/ShCalc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/ShCalc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +ShCalc.la: $(ShCalc_la_OBJECTS) $(ShCalc_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(ShCalc_la_LDFLAGS) $(ShCalc_la_OBJECTS) $(ShCalc_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShCalc.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/ShCalc/ShCalc.c b/modules/ShCalc/ShCalc.c new file mode 100644 index 0000000..001dcc0 --- /dev/null +++ b/modules/ShCalc/ShCalc.c @@ -0,0 +1,376 @@ +/* + * ShCalc.c 64ビット演算 module + * + * かえるにょ国にょアリス + * 大悪司 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ShCalc.c,v 1.4 2002/08/23 14:56:40 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "nact.h" +#include "system.h" +#include "xsystem35.h" +#include "randMT.h" + +static int numbase; +static gint64 l_1000A0C8; +static gint64 l_1000A0D0; +static gint64 l_1000A0D8; + +static gint64 mul64(gint64 a1, gint64 a2) { + return a1 * a2; +} + +static gint64 div64(gint64 a1, gint64 a2) { + if (a1 == 0 || a2 == 0) return 0; + + return a1 / a2; +} + +void SetIntNumBase(void) { /* 0 */ + /* + 64 bit 演算のための倍数をセット + + base: 倍数 + */ + int base = getCaliValue(); + + numbase = base; + + DEBUG_COMMAND("ShCalc.SetIntNumBase %d:\n", base); + +} + +void SetIntNum16(void) { /* 1 */ + /* + 64 bit 演算のための数値をセット + + var: 数値の入った変数 + */ + int *var = getCaliVariable(); + + l_1000A0D8 = mul64(*var, numbase); + + DEBUG_COMMAND("ShCalc.SetIntNum16 %p:\n", var); +} + +void SetIntNum32(void) { /* 2 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.SetIntNum32: %d:\n", p1); +} + +void GetIntNum16(void) { /* 3 */ + /* + 64 bit 演算した結果を得る + + var: 数値をいれる変数 + */ + int *var = getCaliVariable(); + gint64 i; + + i = div64(l_1000A0D8, numbase); + + if (i > 65535) { + i = l_1000A0C8 = 65535; + } + + *var = i; + + DEBUG_COMMAND("ShCalc.GetIntNum16 %d:\n", var); +} + +void GetIntNum32(void) { /* 4 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.GetIntNum32: %d:\n", p1); +} + +void AddIntNum16(void) { /* 5 */ + /* + 64 bit 加算 + + var: 足す数の入った変数 + */ + int *var = getCaliVariable(); + + l_1000A0D8 += mul64(*var, numbase); + + DEBUG_COMMAND("ShCalc.AddIntNum16 %p:\n", var); +} + +void AddIntNum32(void) { /* 6 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.AddIntNum32: %d:\n", p1); +} + +void SubIntNum16(void) { /* 7 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.SubIntNum16: %d:\n", p1); +} + +void SubIntNum32(void) { /* 8 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.SubIntNum32: %d:\n", p1); +} + +void MulIntNum16(void) { /* 9 */ + /* + 64 bit 乗算 + + var: 掛ける数の入った変数 + */ + int *var = getCaliVariable(); + + l_1000A0D8 *= mul64(*var, numbase); + + DEBUG_COMMAND("ShCalc.MulIntNum16: %p:\n", var); +} + +void MulIntNum32(void) { /* 10 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.MulIntNum32: %d:\n", p1); +} + +void DivIntNum16(void) { /* 11 */ + /* + 64 bit 除算 + + var: 足す数の入った変数 + */ + int *var = getCaliVariable(); + gint64 i; + + l_1000A0C8 = *var; + + i = mul64(l_1000A0C8, numbase); + l_1000A0D8 = div64(l_1000A0D8, i); + + DEBUG_COMMAND("ShCalc.DivIntNum16 %p:\n", var); +} + +void DivIntNum32(void) { /* 12 */ + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.DivIntNum32: %d:\n", p1); +} + +void CmpIntNum16(void) { /* 13 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.CmpIntNum16: %d,%d,%d:\n", p1, p2, p3); +} + +void CmpIntNum32(void) { /* 14 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.CmpIntNum32: %d,%d,%d:\n", p1, p2, p3); +} + +void GetLengthNum16(void) { /* 15 */ + /* + 数値の桁数を返す + var: 数値 + vResult: 数値の桁数を返す変数 + */ + int *var = getCaliVariable(); + int *vResult = getCaliVariable(); + + if (*var >= 10000) { + *vResult = 5; + } else if (*var >= 1000) { + *vResult = 4; + } else if (*var >= 100) { + *vResult = 3; + } else if (*var >= 10) { + *vResult = 2; + } else { + *vResult = 1; + } + + DEBUG_COMMAND("ShCalc.GetLengthNum16 %p,%p:\n", var, vResult); +} + +void GetLengthNum32(void) { /* 16 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("ShCalc.GetLengthNum32: %d,%d:\n", p1, p2); +} + +void NumToRate(void) { /* 17 */ + /* + p1 * (p3/p2) の演算結果を返す。 + + p1: 数値1 + p2: 数値2 + p3: 数値3 + flag: 0 切捨て + 1 切り上げ + vResult: 結果を返す変数 + */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int flag = getCaliValue(); + int *vResult = getCaliVariable(); + int i; + + i = (p1 * p3) / p2; + + if (flag != 0) { + if ((i * p2) != (p1 * p3)) { + i ++; + } + } + + *vResult = i; + + DEBUG_COMMAND("ShCalc.NumToRate %d,%d,%d,%d,%p:\n", p1, p2, p3, flag, vResult); + +} + +void NumToRateNum(void) { /* 18 */ + /* + p1 * (p2/p3) の演算結果を返す。 + + p1: 数値1 + p2: 数値2 + p3: 数値3 + flag: 0 切捨て + 1 切り上げ + vResult: 結果を返す変数 + */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int flag = getCaliValue(); + int *vResult = getCaliVariable(); + int i; + + i = (p1 * p2) / p3; + + if (flag != 0) { + if ((i * p3) != (p1 * p2)) { + i ++; + } + } + + *vResult = i; + + DEBUG_COMMAND("ShCalc.NumToRateNum %d,%d,%d,%d,%p:\n", p1, p2, p3, flag, vResult); +} + +void SetRandomSeed() { + /* + 乱数の種の設定 + + seed: 種 + */ + int seed = getCaliValue(); + + sgenrand(seed); + + DEBUG_COMMAND("ShCalc.SetRandomSeed %d:\n", seed); +} + +void GetRandomNumA() { + int num = getCaliValue(); + int *var = getCaliVariable(); + + if (num == 0 || num == 1) { + *var = num; + } else { + *var = (int)(genrand() * num) + 1; + } + + DEBUG_COMMAND("ShCalc.GetRandomNumA %d,%p:\n", num, var); +} + +void NumToBit() { + /* + 2^(beki-1) + + var: 値を返す変数 + */ + int beki = getCaliValue(); + int *var = getCaliVariable(); + int i, j = 1; + + if (beki < 17) { + for (i = 1; i < beki; i++) { + j <<= 1; + } + *var = j; + } else { + *var = 0; + } + + DEBUG_COMMAND("ShCalc.NumToBit %d,%p:\n", beki, var); +} + +void BitToNum() { + /* + val -> var + 1 -> 1 + 2 -> 2 + 4 -> 3 + 8 -> 4 + 16 -> 5 .... + others -> 0 + + var: 値を返す変数 + */ + int val = getCaliValue(); + int *var = getCaliVariable(); + int i; + + DEBUG_COMMAND("ShCalc.BitToNum %d,%p:\n", val, var); + + if (val == 0) { + *var = 0; + return; + } + + *var = 1; + while(val != 1) { + if (val % 2) { + *var = 0; + break; + } + val /= 2; + (*var)++; + } +} diff --git a/modules/ShGraph/Makefile.am b/modules/ShGraph/Makefile.am new file mode 100644 index 0000000..d79d8e5 --- /dev/null +++ b/modules/ShGraph/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = ShGraph.la + +ShGraph_la_LDFLAGS = -module -export-dynamic -avoid-version +ShGraph_la_SOURCES = ShGraph.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShGraph -I$(top_srcdir)/modules/ShGraph diff --git a/modules/ShGraph/Makefile.in b/modules/ShGraph/Makefile.in new file mode 100644 index 0000000..48a271e --- /dev/null +++ b/modules/ShGraph/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/ShGraph +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +ShGraph_la_LIBADD = +am_ShGraph_la_OBJECTS = ShGraph.lo +ShGraph_la_OBJECTS = $(am_ShGraph_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ShGraph_la_SOURCES) +DIST_SOURCES = $(ShGraph_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = ShGraph.la +ShGraph_la_LDFLAGS = -module -export-dynamic -avoid-version +ShGraph_la_SOURCES = ShGraph.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShGraph -I$(top_srcdir)/modules/ShGraph + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/ShGraph/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/ShGraph/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +ShGraph.la: $(ShGraph_la_OBJECTS) $(ShGraph_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(ShGraph_la_LDFLAGS) $(ShGraph_la_OBJECTS) $(ShGraph_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShGraph.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/ShGraph/ShGraph.c b/modules/ShGraph/ShGraph.c new file mode 100644 index 0000000..2fe4e89 --- /dev/null +++ b/modules/ShGraph/ShGraph.c @@ -0,0 +1,642 @@ +/* + * ShGraph.c アニメーション関連 module + * + * 大悪司 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ShGraph.c,v 1.7 2002/09/01 11:54:51 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +#include "ags.h" +#include "counter.h" +#include "music_client.h" + +#define SLOT 40 + +static void copy_sprite(int sx, int sy, int width, int height, int dx, int dy, int r, int g, int b); + +static MyRectangle maprect; /* アニメーション表示領域 */ +static MyRectangle mapback; /* 背景セーブ領域 */ +static int mapback_p5; /* 背景転送先 X */ +static int mapback_p6; /* 背景転送先 Y */ + +struct animsrc { + int x; + int y; + int w; + int h; + int uw; + int uh; + int r; + int g; + int b; +}; +static struct animsrc src[SLOT]; /* アニメーション各コマ転送元 */ + +struct _s0 { + int *dst_p1; + int *dst_p2; + int dw_1000A188; +}; +static struct _s0 s0[SLOT]; + +struct _s1 { + int add_p2; + int add_p3; + int w_1000A378; + int add_p4; + int add_p6; // wavfile; +}; +static struct _s1 s1[SLOT]; + +struct _s2 { + int dst_p3; + int dst_p4; + int dst_p5; + int dst_p6; + int w_1000A8A0; + int w_1000A8A2; +}; +static struct _s2 s2[SLOT]; + +static int* add_p5[SLOT]; /* どこまでアニメーションのコマが進んだか */ + + +void Init() { + /* + モジュール初期化 + */ + int p1 = getCaliValue(); /* ISurface */ + + DEBUG_COMMAND("ShGraph.Init %d:\n", p1); +} + +void GetSurfaceData() { + int p1 = getCaliValue(); /* ISurface */ + + DEBUG_COMMAND_YET("ShGraph.GetSurfaceData %d:\n", p1); +} + +void ChangeEquColor() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int *p5 = getCaliVariable(); + int *p6 = getCaliVariable(); + int p7 = getCaliValue(); /* ISurface */ + + DEBUG_COMMAND_YET("ShGraph.ChangeEquColor %d,%d,%d,%d,%p,%p,%d:\n", p1, p2, p3, p4, p5, p6, p7); +} + +void ChangeNotColor() { + /* + 指定の領域が src と等しくなければ dst に塗りつぶす + + x0: source x0 + y0: source y0 + width: source width + height: source height + *src: 塗りつぶし候補の色が入っている変数 src, src+1, src+2 + *dst: 塗りつぶしの色が入っている変数 dst, dst+1, dst+2 + */ + int x0 = getCaliValue(); + int y0 = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int *src = getCaliVariable(); /* r, g, b */ + int *dst = getCaliVariable(); /* r, g, b */ + int p7 = getCaliValue(); /* ISurface */ + agsurface_t *dib; + int x, y; + BYTE *dp; + + DEBUG_COMMAND("ShGraph.ChangeNotColor %d,%d,%d,%d,%p,%p,%d:\n", x0, y0, width, height, src, dst, p7); + + ags_check_param(&x0, &y0, &width, &height); + ags_sync(); + + dib = nact->ags.dib; + dp = GETOFFSET_PIXEL(dib, x0, y0); + + switch(dib->depth) { + case 15: + { + WORD pic15s = PIX15(*src, *(src+1), *(src+2)); + WORD pic15d = PIX15(*dst, *(dst+1), *(dst+2)); + WORD *yl; + + for (y = 0; y < height; y++) { + yl = (WORD *)(dp + y * dib->bytes_per_line); + for (x = 0; x < width; x++) { + if (*yl != pic15s) { + *yl = pic15d; + } + yl++; + } + } + break; + } + case 16: + { + WORD pic16s = PIX16(*src, *(src+1), *(src+2)); + WORD pic16d = PIX16(*dst, *(dst+1), *(dst+2)); + WORD *yl; + + for (y = 0; y < height; y++) { + yl = (WORD *)(dp + y * dib->bytes_per_line); + for (x = 0; x < width; x++) { + if (*yl != pic16s) { + *yl = pic16d; + } + yl++; + } + } + break; + } + case 24: + case 32: + { + DWORD pic24s = PIX24(*src, *(src+1), *(src+2)) & 0xf0f0f0; + DWORD pic24d = PIX24(*dst, *(dst+1), *(dst+2)) & 0xf0f0f0; + DWORD *yl; + + for (y = 0; y < height; y++) { + yl = (DWORD *)(dp + y * dib->bytes_per_line); + for (x = 0; x < width; x++) { + if ((*yl & 0xf0f0f0) != pic24s) { + *yl = pic24d; + } + yl++; + } + } + break; + } + } +} + +/* + アニメーション使用手順 + 1: まず、リセット (ResetAnimData 0:) + 2: アニメーションを表示する領域の設定 (SetAnimeRect x,y,w,h:) + 3: アニメーションの背景が書かれている領域の設定 + (SetAnimeBack sx,sy,w,h,dx,dy:) dx, dy は転送先 + 4: 各アニメーションのパターンの領域の設定 + (SetAnimeSrc slot,sx,sy,w,h,uw,uh,pal) + 5: 各アニメーションの表示座標の設定 + (SetAnimeDst slot,varx,vary,offx,offy,offw,offh:) + 6: アニメーションパターンの設定 + 何番のスロットをどの順番で再生するかを指定 + (SetAnimeData pat,src,dst,num,varpat,waveno:) + 例 + ShGraph.AddAnimeData 1,11,11,5,var1,81: + ShGraph.AddAnimeData 1,13,12,8,var2,84: + ShGraph.AddAnimeData 1,14,12,2,var3,20736: + + アニメその1は パターン 11->13->14 のスロットを再生。それぞれ、5コマ, + 8コマ,2コマづつ使用する。表示位置は 11->12->12 のスロットを使用。 + + 7: 実際に再生するアニメを決定。(AddAnimeRemain slot:) + 8: 指定するスロットまでアニメ再生 (PlayAnimeData lastslot,wait:) + lastslotが0の場合は 7 で指定したところまで。 + +*/ +void ResetAnimeData() { + /* + アニメーション用の各種データをクリア + + no: クリア対象スロット(0なら全スロットクリア) + */ + int no = getCaliValue(); + + DEBUG_COMMAND("ShGraph.ResetAnimeData %d:\n", no); + + if (no > 0 && no <= SLOT) { + memset(&src[no-1], 0, sizeof(struct animsrc)); + memset(&s0[no-1], 0, sizeof(struct _s2)); + memset(&s2[no-1], 0, sizeof(struct _s0)); + } else { + memset(src, 0, sizeof(struct animsrc) * SLOT); + memset(s0, 0, sizeof(struct _s0) * SLOT); + memset(s2, 0, sizeof(struct _s2) * SLOT); + } + + memset(s1, 0, sizeof(struct _s1) * SLOT); + memset(add_p5, 0, sizeof(int *) * SLOT); + +} + +void SetAnimeSrc() { + /* + アニメーションの各パターンのソース領域の設定 + + no: スロット番号 + x0: src x0 + y0: src y0 + w : src width + h : src height + uw: パターンの横の並びの数 + uh: パターンの縦の並びの数 + *pal: 抜き色を格納してある変数の先頭 (pal, pal+1, pal+2) + */ + int no = getCaliValue(); + int x0 = getCaliValue(); + int y0 = getCaliValue(); + int w = getCaliValue(); + int h = getCaliValue(); + int uw = getCaliValue(); + int uh = getCaliValue(); + int *pal = getCaliVariable(); + int r, g, b; + + DEBUG_COMMAND("ShGraph.SetAnimeSrc %d,%d,%d,%d,%d,%d,%d,%p:\n", no, x0, y0, w, h, uw, uh, pal); + + if (no <= 0 || no > SLOT) return; + + r = *pal; + g = *(pal + 1); + b = *(pal + 2); + + no--; + src[no].x = x0; + src[no].y = y0; + src[no].w = w; + src[no].h = h; + src[no].uw = uw; + src[no].uh = uh; + src[no].r = r; + src[no].g = g; + src[no].b = b; +} + +void SetAnimeDst() { + /* + アニメーションの描画先設定 + + no: スロット番号 + p1: 現在の描画先(x)を格納する変数 + p2: 現在の描画先(y)を格納する変数 + p3: 描画先オフセット (x) 10000が中央(0) + p4: 描画先オフセット (y) 10000が中央 + p5: 描画先オフセット追加分 (w) 10000が中央 + p6: 描画先オフセット追加分 (h) 10000が中央 + */ + int no = getCaliValue(); + int *p1 = getCaliVariable(); + int *p2 = getCaliVariable(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + + DEBUG_COMMAND("ShGraph.SetAnimeDst %d,%p,%p,%d,%d,%d,%d:\n", no, p1, p2, p3, p4, p5, p6); + + if (no <= 0 || no > SLOT) return; + + no--; + s0[no].dst_p1 = p1; + s0[no].dst_p2 = p2; + s2[no].dst_p3 = p3; + s2[no].dst_p4 = p4; + s2[no].dst_p5 = p5; + s2[no].dst_p6 = p6; + s2[no].w_1000A8A0 = 0; + s2[no].w_1000A8A2 = 0; +} + +void AddAnimeData() { + /* + アニメーション各種設定 + + no: スロット番号 + p2: アニメーションパターン格納先頭スロット + p3: アニメーションパターン表示先頭スロット + p4: アニメーションパターン個数 + p5: 現在どの何番目のパターンを書いているかを保存しておく変数 + p6: 効果音 WAV ファイル番号 + */ + int no = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int *p5 = getCaliVariable(); + int p6 = getCaliValue(); + int i; + + DEBUG_COMMAND("ShGraph.AddAnimeData %d,%d,%d,%d,%p,%d:\n", no, p2, p3, p4, p5, p6); + + if (no <= 0 || no > SLOT) return; + + no--; + for (i = 0; i < SLOT; i++) { + if (s1[i].add_p4 == 0 && s1[i].add_p6 == 0) break; + } + + if (i == SLOT) return; + + s1[i].w_1000A378 = s2[no].w_1000A8A0; + s2[no].w_1000A8A0 += p4; + if (p4 != 0) { + s2[no].w_1000A8A2 = i; + } + + s1[i].add_p2 = p2 -1; + s1[i].add_p3 = p3 -1; + s1[i].add_p4 = p4; + s1[i].add_p6 = p6; + + add_p5[i] = p5; +} + +void AddAnimeRemain() { + /* + アニメーション各種設定 + + no: スロット番号 + */ + int no = getCaliValue(); + int i, _max = 0; + + DEBUG_COMMAND("ShGraph.AddAnimeRemain %d:\n", no); + + if (no <= 0 || no > SLOT) return; + + for (i = 0; i < SLOT; i++) { + _max = max(s2[i].w_1000A8A0, _max); + } + + no--; + + if (s2[no].w_1000A8A0 < _max) { + i = s2[no].w_1000A8A2; + s1[i].add_p4 += (_max - s2[no].w_1000A8A0); + s2[no].w_1000A8A0 = _max; + } +} + +void SetAnimeRect() { + /* + アニメーション描画領域設定 + + x: region x + y: region y + w: region width + h: region height + */ + int x = getCaliValue(); + int y = getCaliValue(); + int w = getCaliValue(); + int h = getCaliValue(); + + DEBUG_COMMAND("ShGraph.SetAnimeRect %d,%d,%d,%d:\n", x, y, w, h); + + maprect.x = x; + maprect.y = y; + maprect.width = w; + maprect.height = h; +} + +void SetAnimeBack() { + /* + アニメーション背景領域設定 + + sx: 背景領域 x + sy: 背景領域 y + w: 背景領域 width + h: 背景領域 height + p5: 背景領域 転送先 x オフセット + p6: 背景領域 転送先 y オフセット + */ + int sx = getCaliValue(); + int sy = getCaliValue(); + int w = getCaliValue(); + int h = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + + DEBUG_COMMAND("ShGraph.SetAnimeBack %d,%d,%d,%d,%d,%d:\n", sx, sy, w, h, p5, p6); + + mapback.x = sx; + mapback.y = sy; + mapback.width = w; + mapback.height = h; + mapback_p5 = p5; + mapback_p6 = p6; +} + +void PlayAnimeData() { + /* + 実際にアニメーションを実行 + + p1: 最大再生スロット(0の場合は全部) + p2: アニメーションインターバル(10msec単位) + */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); /* ISurface */ + int p4 = getCaliValue(); /* ISys3xDIB */ + int p5 = getCaliValue(); /* ITimer */ + int p6 = getCaliValue(); /* IWinMsg */ + int interval, loop; + int i; + boolean is_backcopied; + agsurface_t *dib; + + DEBUG_COMMAND("ShGraph.PlayAnimeData %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6); + + interval = p2 * 10; + + if (p1 == 0) { + for (i = 0; i < SLOT; i++) { + p1 = max(s2[i].w_1000A8A0, p1); + } + } + if (p1 == 0) return; + + dib = ags_getDIB(); + + for (loop = 0; loop < p1; loop++) { + int cnt = get_high_counter(SYSTEMCOUNTER_MSEC); + is_backcopied = FALSE; + + for (i = 0; i < SLOT; i++) { + int srcno = s1[i].add_p2; + int dstno = s1[i].add_p3; + int wavno = s1[i].add_p6; + +#if 0 + printf("loop=%d,i=%d,w_1000A378=%d,add_p4=%d,srcno=%d, dstno=%d,dst_p1=%d,dst_p2=%d\n", + loop, i, s1[i].w_1000A378, s1[i].add_p4, + srcno, dstno, + *s0[dstno].dst_p1, *s0[dstno].dst_p2); +#endif + if (loop < s1[i].w_1000A378) continue; + + if (s1[i].add_p4 != 0) { + int sx, sy, dx, dy; + + if (!is_backcopied) { + is_backcopied = TRUE; + ags_copyArea(mapback.x, mapback.y, + mapback.width, mapback.height, + mapback_p5, mapback_p6); + ags_sync(); + } + + if (wavno != 0) { + if (wavno > 255) { + mus_pcm_stop(wavno % 255); + } + // printf("wavPlay %d\n", wavno % 256); + mus_wav_play(wavno % 256, 1); + s1[i].add_p6 = 0; + } + + sx = src[srcno].x + (*add_p5[i] % src[srcno].uw) * src[srcno].w; + sy = src[srcno].y + (*add_p5[i] / src[srcno].uw) * src[srcno].h; + + dx = *(s0[dstno].dst_p1) + s2[dstno].dst_p3 -10000; + dy = *(s0[dstno].dst_p2) + s2[dstno].dst_p4 -10000; + if (dx > 10000) dx = 0; + if (dy > 10000) dy = 0; + + copy_sprite(sx, sy, + src[srcno].w, src[srcno].h, + maprect.x + dx, maprect.y + dy, + src[srcno].r, src[srcno].g, src[srcno].b); + + *(s0[dstno].dst_p1) += (s2[dstno].dst_p5 - 10000); + *(s0[dstno].dst_p2) += (s2[dstno].dst_p6 - 10000); + if (*(s0[dstno].dst_p1) >= 10000) { + *(s0[dstno].dst_p1) = 0; + } + if (*(s0[dstno].dst_p2) >= 10000) { + *(s0[dstno].dst_p2) = 0; + } + + (*(add_p5[i]))++; + s1[i].add_p4--; + + if (*add_p5[i] >= (src[srcno].uw * src[srcno].uh)) { + *add_p5[i] = 0; + } + } else { + if (wavno == 0) continue; + + s1[i].add_p6 = 0; + + if (wavno > 255) { + mus_wav_stop(wavno % 256); + } + mus_wav_play(wavno % 256, 1); + // printf("wavPlay %d\n", wavno % 256); + } + } + if (is_backcopied && maprect.width != 0 && maprect.height != 0) { + ags_updateArea(maprect.x, maprect.y, maprect.width, maprect.height); + } + { + int now = get_high_counter(SYSTEMCOUNTER_MSEC); + if (now - cnt < interval) { + usleep((interval - (now-cnt)) * 1000); + } + } + } +} + +static void copy_sprite(int sx, int sy, int width, int height, int dx, int dy, int r, int g, int b) { + int x, y; + BYTE *sp, *dp; + agsurface_t *dib; + + if (dx < 0 || dy < 0) return; + + ags_check_param(&sx, &sy, &width, &height); + ags_check_param(&dx, &dy, &width, &height); + + dib = nact->ags.dib; + + sp = GETOFFSET_PIXEL(dib, sx, sy); + dp = GETOFFSET_PIXEL(dib, dx, dy); + + switch(dib->depth) { + case 15: + { + WORD pic15 = PIX15(r, g, b); + WORD *yls, *yld; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * dib->bytes_per_line); + yld = (WORD *)(dp + y * dib->bytes_per_line); + for (x = 0; x < width; x++) { + if (*yls != pic15) { + *yld = *yls; + } + yls++; yld++; + } + } + break; + } + case 16: + { + WORD pic16 = PIX16(r, g, b); + WORD *yls, *yld; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * dib->bytes_per_line); + yld = (WORD *)(dp + y * dib->bytes_per_line); + for (x = 0; x < width; x++) { + if (*yls != pic16) { + *yld = *yls; + } + yls++; yld++; + } + } + break; + } + case 24: + case 32: + { + DWORD pic24 = PIX24(r, g, b) & 0xf0f0f0; + DWORD *yls, *yld; + + for (y = 0; y < height; y++) { + yls = (DWORD *)(sp + y * dib->bytes_per_line); + yld = (DWORD *)(dp + y * dib->bytes_per_line); + for (x = 0; x < width; x++) { + if ((*yls & 0xf0f0f0) != pic24) { + *yld = *yls; + } + yls++; yld++; + } + } + break; + } + } +} diff --git a/modules/ShPort/Makefile.am b/modules/ShPort/Makefile.am new file mode 100644 index 0000000..14bbc1d --- /dev/null +++ b/modules/ShPort/Makefile.am @@ -0,0 +1,12 @@ +pkglib_LTLIBRARIES = ShPort.la + +ShPort_la_LDFLAGS = -module -export-dynamic -avoid-version +ShPort_la_SOURCES = ShPort.c +ShPort_la_LIBADD = @GLIB_LIBS@ + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShPort -I$(top_srcdir)/modules/ShPort diff --git a/modules/ShPort/Makefile.in b/modules/ShPort/Makefile.in new file mode 100644 index 0000000..6dc9fa3 --- /dev/null +++ b/modules/ShPort/Makefile.in @@ -0,0 +1,558 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/ShPort +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +ShPort_la_DEPENDENCIES = +am_ShPort_la_OBJECTS = ShPort.lo +ShPort_la_OBJECTS = $(am_ShPort_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ShPort_la_SOURCES) +DIST_SOURCES = $(ShPort_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = ShPort.la +ShPort_la_LDFLAGS = -module -export-dynamic -avoid-version +ShPort_la_SOURCES = ShPort.c +ShPort_la_LIBADD = @GLIB_LIBS@ +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShPort -I$(top_srcdir)/modules/ShPort + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/ShPort/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/ShPort/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +ShPort.la: $(ShPort_la_OBJECTS) $(ShPort_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(ShPort_la_LDFLAGS) $(ShPort_la_OBJECTS) $(ShPort_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShPort.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/ShPort/ShPort.c b/modules/ShPort/ShPort.c new file mode 100644 index 0000000..ef4c961 --- /dev/null +++ b/modules/ShPort/ShPort.c @@ -0,0 +1,180 @@ +/* + * ShPort.c Widget 呼び出し? module + * + * かえるにょ国にょアリス(未使用) + * 大悪司 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ShPort.c,v 1.6 2003/01/25 01:34:50 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "nact.h" +#include "system.h" +#include "xsystem35.h" +#include "graphicsdevice.h" + +// キー変換テーブル +#define KEYMAP_MAX 8 +static BYTE *keymap[KEYMAP_MAX]; + +void OutputMessageBox(void) { /* 0 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + + DEBUG_COMMAND_YET("ShPort.OutputMessageBox: %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6); +} + +void InputListNum(void) { /* 1 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("ShPortInputListNum: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6, p7); +} + +/** + * ShPort:Init + * ShPortサブシステム全体の初期化 + * @param p1: ISys3x + */ +void Init(void) { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("ShPort.Init: %d:\n", p1); +} + +/** + * ShPort:InitKeyStatus + * 指定のキーコードマップの初期化 + * @param no: キーコードマップの番号(1~) + */ +void InitKeyStatus(void) { + int no = getCaliValue(); + + if (no >= KEYMAP_MAX) { + WARNING("Overflow keymap table(p1)\n", no); + return; + } + + if (keymap[no -1] == NULL) { + keymap[no -1] = g_new0(BYTE, 256); + } else { + memset(keymap[no -1], 0, 256); + } + + DEBUG_COMMAND("ShPort.InitKeyStatus: %d:\n", no); +} + +/** + * ShPort:SetKeyStatus + * 指定マップのキーコードへの機能の割り付け。 + * @param no: マップ番号 + * @param key: キーコード + * @param func: 機能キーコード + */ +void SetKeyStatus(void) { + int no = getCaliValue(); + int key = getCaliValue(); + int func = getCaliValue(); + + if (no >= KEYMAP_MAX) { + WARNING("Overflow keymap table(p1)\n", no); + return; + } + + keymap[no -1][key] = func; + + DEBUG_COMMAND("ShPort.SetKeyStatus: %d,%d,%d:\n", no, key, func); +} + +/** + * ShPort:GetKeyStatus + * 指定マップのキーの押下状態の取得 + * @param no: マップ番号 + * @param var: 押下キーに対応する機能コードを返す変数 + */ +void GetKeyStatus(void) { + int no = getCaliValue(); + int *var = getCaliVariable(); + int i; + + if (no >= KEYMAP_MAX) { + WARNING("Overflow keymap table(p1)\n", no); + return; + } + + *var = 0; + for (i = 0; i < 256; i++) { + *var |= (keymap[no -1][i] * RawKeyInfo[i]); + } + + DEBUG_COMMAND("ShPort.GetKeyStatus: %d,%p:\n", no, var); +} + +void InputListString(void) { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("ShPort.InputListString: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6, p7); +} + +void InputOpenFile(void) { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("ShPort.InputOpenFile: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6, p7); +} + +void InputSaveFile(void) { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + + DEBUG_COMMAND_YET("ShPort.InputSaveFile: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6, p7); +} + diff --git a/modules/ShSound/Makefile.am b/modules/ShSound/Makefile.am new file mode 100644 index 0000000..874f7fa --- /dev/null +++ b/modules/ShSound/Makefile.am @@ -0,0 +1,13 @@ +pkglib_LTLIBRARIES = ShSound.la + +ShSound_la_LDFLAGS = -module -export-dynamic -avoid-version +ShSound_la_SOURCES = ShSound.c +ShSound_la_LIBADD = @GLIB_LIBS@ + + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShSound -I$(top_srcdir)/modules/ShSound diff --git a/modules/ShSound/Makefile.in b/modules/ShSound/Makefile.in new file mode 100644 index 0000000..fd06ad1 --- /dev/null +++ b/modules/ShSound/Makefile.in @@ -0,0 +1,558 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/ShSound +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +ShSound_la_DEPENDENCIES = +am_ShSound_la_OBJECTS = ShSound.lo +ShSound_la_OBJECTS = $(am_ShSound_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ShSound_la_SOURCES) +DIST_SOURCES = $(ShSound_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = ShSound.la +ShSound_la_LDFLAGS = -module -export-dynamic -avoid-version +ShSound_la_SOURCES = ShSound.c +ShSound_la_LIBADD = @GLIB_LIBS@ +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShSound -I$(top_srcdir)/modules/ShSound + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/ShSound/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/ShSound/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +ShSound.la: $(ShSound_la_OBJECTS) $(ShSound_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(ShSound_la_LDFLAGS) $(ShSound_la_OBJECTS) $(ShSound_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShSound.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/ShSound/ShSound.c b/modules/ShSound/ShSound.c new file mode 100644 index 0000000..dba7164 --- /dev/null +++ b/modules/ShSound/ShSound.c @@ -0,0 +1,276 @@ +/* + * ShSound.c 音楽関連 module + * + * 大悪司 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ShSound.c,v 1.13 2003/08/02 13:10:32 chikama Exp $ */ +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "xsystem35.h" +#include "nact.h" +#include "dri.h" +#include "ald_manager.h" +#include "wavfile.h" +#include "music_client.h" +#include "pcmlib.h" +#include "shpcmlib.c" + +/* for wav*Memory */ +static WAVFILE *wfile; + +void Init() { + /* + モジュール初期化 + */ + int p1 = getCaliValue(); /* ISys3x */ + + DEBUG_COMMAND("ShSound.Init %d:\n", p1); +} + +void wavLoad() { + /* + 指定のスロットにPCMファイルをロード + + slot: ロードするスロット(チャンネル)番号 + no : ロードするファイル番号 + */ + int slot = getCaliValue(); + int no = getCaliValue(); + + DEBUG_COMMAND("ShSound.wavLoad %d,%d:\n", slot, no); + + mus_wav_load(slot, no); +} + +void wavUnload() { + /* + 指定のスロットのPCMファイルを削除 + + slot: 削除するスロット番号 + */ + int slot = getCaliValue(); + + mus_wav_unload(slot); + + DEBUG_COMMAND("ShSound.wavUnload %d:\n",slot); +} + +void wavUnloadRange() { + /* + 指定のスロット(複数)のPCMファイルを削除 + + slot: 削除する最初のスロット番号 + range: 削除する個数 + */ + int slot = getCaliValue(); + int range = getCaliValue(); + int i; + + for (i = slot; i < (slot + range); i++) { + mus_wav_unload(i); + } + + DEBUG_COMMAND("ShSound.wavUnloadRange %d,%d:\n", slot, range); +} + +void wavUnloadAll() { + /* + すべてのスロットのPCMファイルを削除 + */ + int i; + + for (i = 0; i < 128; i++) { + mus_wav_unload(i); + } + + DEBUG_COMMAND("ShSound.wavUnloadAll:\n"); +} + +void wavLoadMemory() { + /* + 指定の番号の WAV ファイルをメモリ上に読み込み + + no: 読み込むファイル番号 + */ + int no = getCaliValue(); + + wfile = pcmlib_load_rw(no); + + DEBUG_COMMAND("ShSound.wavLoadMemory %d:\n", no); +} + +void wavSendMemory() { + /* + wavLoadMemory で読み込んだデータを指定のスロットに投入 + + slot: PCMデータを送るスロット番号 + */ + int slot = getCaliValue(); + + if (wfile) { + mus_wav_sendfile(slot, wfile); + pcmlib_free(wfile); + wfile = NULL; + } + + DEBUG_COMMAND("ShSound.wavSendMemory %d:\n", slot); +} + +void wavFadeVolumeMemory() { + /* + wavLoadMemory で読み込んだデータのボリュームのフェード + + start: フェード開始時間 (10msec単位) + range: フェード継続時間 (10msec単位) + */ + int start = getCaliValue(); + int range = getCaliValue(); + + if (wfile == NULL) return; + + pcmlib_fade_volume_memory(wfile, start, range); + + DEBUG_COMMAND("ShSound.wavFadeVolumeMemory %d,%d:\n", start, range); +} + +void wavReversePanMemory() { + /* + wavLoadMemoryで読み込んだデータの左右のチャンネルを反転 + */ + + if (wfile == NULL) return; + + pcmlib_reverse_pan_memory(wfile); + + DEBUG_COMMAND("ShSound.wavReversePanMemory:\n"); +} + +void wavPlay() { + /* + 指定のスロットのPCMを再生 + + slot: 再生するスロット番号 + loop: 0なら1回だけ再生、!0なら無限に繰り返し + */ + int slot = getCaliValue(); + int loop = getCaliValue(); + + mus_wav_play(slot, loop == 0 ? 1 : -1); + + DEBUG_COMMAND("ShSound.wavPlay %d, %d:\n", slot, loop); +} + +void wavPlayRing() { + /* + 指定の範囲のスロットのPCMを呼ばれる毎に繰り返し + + start: 最初のスロット番号 + cnt: 繰り返すスロットの個数 + *cur: 現在再生しているスロットのインデックス + */ + int start = getCaliValue(); + int cnt = getCaliValue(); + int *cur = getCaliVariable(); + + mus_wav_play(start + (*cur % cnt), 1); + *cur = (*cur + 1) % cnt; + + DEBUG_COMMAND("ShSound.wavPlayRing %d,%d,%d:\n", start, cnt, *cur); +} + +void wavStop() { + /* + 指定のスロットの再生を停止 + + slot: 停止するスロット番号 + */ + int slot = getCaliValue(); + + DEBUG_COMMAND("ShSound.wavStop %d:\n", slot); + + mus_wav_stop(slot); +} + +void wavStopAll() { + /* + 全てのスロットの再生を停止 + */ + int i; + + for (i = 0; i < 128; i++) { + mus_wav_stop(i); + } + + DEBUG_COMMAND("ShSound.wavStopAll:\n"); +} + +void wavPause() { + /* + 指定のスロットの再生を一時停止 + + slot: 一時停止するスロット番号 + */ + int slot = getCaliValue(); + + DEBUG_COMMAND_YET("ShSound.wavPause %d:\n", slot); +} + +void wavIsPlay() { + /* + 指定のスロットが再生中かどうかを調べる + + slot: 調べるスロット番号 + *result: 0なら停止中、!0なら再生中 + */ + int slot = getCaliValue(); + int *result = getCaliVariable(); + + *result = mus_wav_get_playposition(slot); + + DEBUG_COMMAND("ShSound.wavIsPlay %d,%p:\n", slot, result); +} + +void wavIsPlayRange() { + /* + 指定の範囲のスロットが再生中かどうかを調べる + + slot: 調べる最初のスロット + range: 調べるスロットの個数 + *result: 0:すべてのスロットが停止中, 1: どれかのスロットが再生中 + */ + int slot = getCaliValue(); + int range = getCaliValue(); + int *result = getCaliVariable(); + int i, ret = 0; + + for (i = slot; i < (slot + range); i++) { + ret += mus_wav_get_playposition(i); + } + + *result = ret; + + DEBUG_COMMAND("ShSound.wavIsPlayRange %d,%d,%p:\n", slot, range, result); +} diff --git a/modules/ShSound/shpcmlib.c b/modules/ShSound/shpcmlib.c new file mode 100644 index 0000000..61c62ed --- /dev/null +++ b/modules/ShSound/shpcmlib.c @@ -0,0 +1,131 @@ +/* + * shpcmlib.c ShSound用 pcmlib + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: shpcmlib.c,v 1.2 2003/08/02 13:10:32 chikama Exp $ */ +#include +#include + +#include "portab.h" +#include "wavfile.h" + +/* + 左右のチャンネルの入れ換え + + ARG + wfile: 対象 WAVFILE + + RETURN + none +*/ +void pcmlib_reverse_pan_memory(WAVFILE *wfile) { + int i; + + if (wfile == NULL) return; + + if (wfile->ch == 1) return; + + if (wfile->bits == 8) { + BYTE d; + BYTE *src = wfile->data; + for (i = 0; i < wfile->samples; i+=2) { + d = *src; + *src = *(src + 1); + *(src + 1) = d; + src += 2; + } + } else { + WORD d; + WORD *src = (WORD *)wfile->data; + for (i = 0; i < wfile->samples; i+=2) { + d = *src; + *src = *(src + 1); + *(src + 1) = d; + src += 2; + } + } +} + +/* + メモリ上の PCM データにフェード効果をかける +*/ +void pcmlib_fade_volume_memory(WAVFILE *wfile, int start, int range) { + int wavtime; + int startsample, rangesample; + int i; + + if (wfile == NULL) return; + + if (wfile->samples > (G_MAXINT / 100)) { + wavtime = (wfile->samples / wfile->rate) * 100; + } else { + wavtime = (wfile->samples * 100) / wfile->rate; + } + + if (wavtime < start) return; + + if (wavtime < (start + range)) return; + + startsample = (start * wfile->rate) / 100; + rangesample = (range * wfile->rate) / 100; + + if (wfile->bits == 8) { + // TODO + } else { + WORD *p = (WORD *)wfile->data + (startsample * wfile->ch); + WORD *pend; + + // 指定の場所から徐々に音量を下げる + rangesample *= wfile->ch; + for (i = rangesample; i < 0; i--, p++) { + *p = (*p * i) / rangesample; + } + + // 残りは無音 + pend = (WORD *)(wfile->data + wfile->bytes); + while(pend > p) { + *p = 0; p++; + } + } +} + +// メモリ上で加工できるようロードしてコピー +WAVFILE *pcmlib_load_rw(int no) { + dridata *dfile; + WAVFILE *wfile; + + dfile = ald_getdata(DRIFILE_WAVE, no -1); + if (dfile == NULL) { + WARNING("DRIFILE_WAVE fail to open %d\n", no -1); + return NULL; + } + + wfile = wav_getinfo(dfile->data); + if (wfile) { + void *p = g_malloc(wfile->bytes); + memcpy(p, wfile->data, wfile->bytes); + wfile->data = (BYTE *)p; + wfile->dfile = NULL; + } + + ald_freedata(dfile); + + return wfile; +} diff --git a/modules/ShString/Makefile.am b/modules/ShString/Makefile.am new file mode 100644 index 0000000..5e41b81 --- /dev/null +++ b/modules/ShString/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = ShString.la + +ShString_la_LDFLAGS = -module -export-dynamic -avoid-version +ShString_la_SOURCES = ShString.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShString -I$(top_srcdir)/modules/ShString diff --git a/modules/ShString/Makefile.in b/modules/ShString/Makefile.in new file mode 100644 index 0000000..08db5a3 --- /dev/null +++ b/modules/ShString/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/ShString +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +ShString_la_LIBADD = +am_ShString_la_OBJECTS = ShString.lo +ShString_la_OBJECTS = $(am_ShString_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ShString_la_SOURCES) +DIST_SOURCES = $(ShString_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = ShString.la +ShString_la_LDFLAGS = -module -export-dynamic -avoid-version +ShString_la_SOURCES = ShString.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/ShString -I$(top_srcdir)/modules/ShString + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/ShString/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/ShString/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +ShString.la: $(ShString_la_OBJECTS) $(ShString_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(ShString_la_LDFLAGS) $(ShString_la_OBJECTS) $(ShString_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShString.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/ShString/ShString.c b/modules/ShString/ShString.c new file mode 100644 index 0000000..a41daf9 --- /dev/null +++ b/modules/ShString/ShString.c @@ -0,0 +1,180 @@ +/* + * ShString.c 文字列操作 module + * + * かえるにょ国にょアリス(未使用) + * 大悪司 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ShString.c,v 1.6 2004/10/31 04:18:03 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "nact.h" +#include "system.h" +#include "xsystem35.h" +#include "variable.h" +#include "ags.h" + +void ExchangeString(void) { + /* + 文字列(target)中の一部(pat)を別の文字列(patr)で置き換える + */ + int target = getCaliValue(); + int pat = getCaliValue(); + int patr = getCaliValue(); + char *start = v_str(target -1); + char *next; + char dst[STRVAR_LEN] = ""; + + DEBUG_COMMAND("ShString.ExchangeString: %d,%d,%d:\n", target, pat, patr); + + if (v_strlen(target -1) == 0 || v_strlen(pat -1) == 0) { + return; + } + + while(TRUE) { + next = strstr(start, v_str(pat -1)); + if (next == NULL) break; + strncat(dst, start, (size_t)(next - start)); + strncat(dst, v_str(patr -1), sizeof(dst) - strlen(dst)); + start = next + v_strlen(pat -1); + } + + strncat(dst, start, sizeof(dst) - strlen(dst)); + v_strcpy(target -1, dst); +} + +void SetNum16String(void) { /* 1 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("ShString.SetNum16String: %d,%d:\n", p1, p2); +} + +void SetNum16HalfString(void) { /* 2 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("ShString.SetNum16HalfString: %d,%d:\n", p1, p2); +} + +void SetNum32String(void) { /* 3 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("ShString.SetNum32String: %d,%d:\n", p1, p2); +} + +void SetNum32HalfString(void) { /* 4 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("ShString.SetNum32HalfString: %d,%d:\n", p1, p2); +} + +void GetArrayString(void) { /* 5 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + + DEBUG_COMMAND_YET("ShString.GetArrayString: %d,%d,%d:\n", p1, p2, p3); +} + +void SetWindowTitle(void) { /* 6 */ + int strno = getCaliValue(); + int p2 = getCaliValue(); /* ISys3xSystem */ + + ags_setWindowTitle(v_str(strno - 1)); + + DEBUG_COMMAND("ShString.SetWindowTitle: %d,%d:\n", strno, p2); +} + +void FillString() { + /* + 指定の番号の文字列を他の文字列にコピー + + st: コピー先の文字列の最初の番号 + cnt: コピーする文字列の数 + src: コピー元の文字列番号 + */ + int st = getCaliValue(); + int cnt = getCaliValue(); + int src = getCaliValue(); + int p4 = getCaliValue(); /* ISys3xStringTable */ + int i; + + for (i = 0; i < cnt; i++) { + v_strcpy(st -1, v_str(src)); + } + + DEBUG_COMMAND("ShString.FillString: %d,%d,%d,%d:\n", st, cnt, src, p4); +} + +void SetStringNum16(void) { + /* + 文字列を数値に変換 + 大文字、小文字、混在可 + + p1: 変換元文字列番号 + p2: 変換された数値を格納する変数 + */ + int st = getCaliValue(); + int *var = getCaliVariable(); + char *str = v_str(st -1); + char _dst[100]; + char *dst = _dst; + + DEBUG_COMMAND("ShString.SetStringNum16: %d,%p:\n", st, var); + + + while(*str) { + if (*str >= '0' && *str <= '9') { + *dst = *str; + dst++; str++; + } else if ((unsigned char)*str == 0x82) { + str++; + if (*str >= '0' && *str <= '9') { + *dst = *str; + dst++; str++; + } else { + *var = 0; + return; + } + } else { + *var = 0; + return; + } + } + *dst = '\0'; + + *var = atoi(_dst); +} + +void SetStringNum32(void) { + int p1 = getCaliValue(); + int *p2 = getCaliVariable(); + + DEBUG_COMMAND_YET("ShString.SetStringNum32: %d,%p:\n", p1, p2); +} diff --git a/modules/dDemo/Makefile.am b/modules/dDemo/Makefile.am new file mode 100644 index 0000000..8639539 --- /dev/null +++ b/modules/dDemo/Makefile.am @@ -0,0 +1,13 @@ +pkglib_LTLIBRARIES = dDemo.la + +dDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +dDemo_la_SOURCES = dDemo.c +dDemo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/dDemo -I$(top_srcdir)/modules/dDemo diff --git a/modules/dDemo/Makefile.in b/modules/dDemo/Makefile.in new file mode 100644 index 0000000..a7d979d --- /dev/null +++ b/modules/dDemo/Makefile.in @@ -0,0 +1,559 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/dDemo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +dDemo_la_DEPENDENCIES = ../lib/libgraph.la ../lib/libalk.la +am_dDemo_la_OBJECTS = dDemo.lo +dDemo_la_OBJECTS = $(am_dDemo_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(dDemo_la_SOURCES) +DIST_SOURCES = $(dDemo_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = dDemo.la +dDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +dDemo_la_SOURCES = dDemo.c +dDemo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/dDemo -I$(top_srcdir)/modules/dDemo + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/dDemo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/dDemo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +dDemo.la: $(dDemo_la_OBJECTS) $(dDemo_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(dDemo_la_LDFLAGS) $(dDemo_la_OBJECTS) $(dDemo_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dDemo.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/dDemo/dDemo.c b/modules/dDemo/dDemo.c new file mode 100644 index 0000000..2610ad3 --- /dev/null +++ b/modules/dDemo/dDemo.c @@ -0,0 +1,60 @@ +// #define DDEMODEV + +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" +#include "imput.h" +#include "music_client.h" + +#ifdef DDEMODEV +#include "dDemo.h" +static struct ddemo dd; +#include "scene.c" +#endif + +void Init() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int *var = getCaliVariable(); + + *var = 1; +#ifdef DDEMODEV + dd.alk = alk_new("/home/masaki-c/game/daiakuji/dDemo.alk"); +#endif + + DEBUG_COMMAND_YET("dDemo.Init %d,%d,%d,%p:\n", p1, p2, p3, var); +} + +void SetKeyCancelFlag() { + int cancelflag = getCaliValue(); + + DEBUG_COMMAND_YET("dDemo.SetKeyCancelFlag %d:\n", cancelflag); +} + +void SetLoopFlag() { + /* Loop Flag */ + int loopflag = getCaliValue(); /* 0 なら無限繰り返し */ + + DEBUG_COMMAND_YET("dDemo.SetLoopFlag %d:\n", loopflag); +} + +void Run() { + DEBUG_COMMAND_YET("dDemo.Run:\n"); + +#ifdef DDEMODEV + mus_cdrom_start(13, 1); + // ddemo_scene(); + + while(0 == sys_getInputInfo()) { + usleep(1000 * 100); + } + + mus_cdrom_stop(); +#endif +} diff --git a/modules/eDemo/Makefile.am b/modules/eDemo/Makefile.am new file mode 100644 index 0000000..f1af95a --- /dev/null +++ b/modules/eDemo/Makefile.am @@ -0,0 +1,12 @@ +pkglib_LTLIBRARIES = eDemo.la + +eDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +eDemo_la_SOURCES = eDemo.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/eDemo -I$(top_srcdir)/modules/eDemo + diff --git a/modules/eDemo/Makefile.in b/modules/eDemo/Makefile.in new file mode 100644 index 0000000..afc2ecf --- /dev/null +++ b/modules/eDemo/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/eDemo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +eDemo_la_LIBADD = +am_eDemo_la_OBJECTS = eDemo.lo +eDemo_la_OBJECTS = $(am_eDemo_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(eDemo_la_SOURCES) +DIST_SOURCES = $(eDemo_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = eDemo.la +eDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +eDemo_la_SOURCES = eDemo.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/eDemo -I$(top_srcdir)/modules/eDemo + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/eDemo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/eDemo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +eDemo.la: $(eDemo_la_OBJECTS) $(eDemo_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(eDemo_la_LDFLAGS) $(eDemo_la_OBJECTS) $(eDemo_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eDemo.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/eDemo/eDemo.c b/modules/eDemo/eDemo.c new file mode 100644 index 0000000..5328791 --- /dev/null +++ b/modules/eDemo/eDemo.c @@ -0,0 +1,44 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + + +void Init() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("eDEMO.Init %d,%d,%d,%p:\n", p1, p2, p3, var); +} + +void SetKeyCancelFlag() { + int cancelflag = getCaliValue(); + + DEBUG_COMMAND_YET("eDEMO.SetKeyCancelFlag %d:\n", cancelflag); +} + +void SetLoopFlag() { + /* Loop Flag */ + int loopflag = getCaliValue(); /* 0 なら無限繰り返し */ + + DEBUG_COMMAND_YET("eDEMO.SetLoopFlag %d:\n", loopflag); +} + +void SetDrawStaffFlag() { + /* Loop Flag */ + int staffflag = getCaliValue(); + + DEBUG_COMMAND_YET("eDEMO.SetDrawStaffFlag %d:\n", staffflag); +} + +void Run() { + DEBUG_COMMAND_YET("eDEMO.Run:\n"); +} diff --git a/modules/eeDemo/Makefile.am b/modules/eeDemo/Makefile.am new file mode 100644 index 0000000..a389807 --- /dev/null +++ b/modules/eeDemo/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = eeDemo.la + +eeDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +eeDemo_la_SOURCES = eeDemo.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/eeDemo -I$(top_srcdir)/modules/eeDemo diff --git a/modules/eeDemo/Makefile.in b/modules/eeDemo/Makefile.in new file mode 100644 index 0000000..c4f79fb --- /dev/null +++ b/modules/eeDemo/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/eeDemo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +eeDemo_la_LIBADD = +am_eeDemo_la_OBJECTS = eeDemo.lo +eeDemo_la_OBJECTS = $(am_eeDemo_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(eeDemo_la_SOURCES) +DIST_SOURCES = $(eeDemo_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = eeDemo.la +eeDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +eeDemo_la_SOURCES = eeDemo.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/eeDemo -I$(top_srcdir)/modules/eeDemo + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/eeDemo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/eeDemo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +eeDemo.la: $(eeDemo_la_OBJECTS) $(eeDemo_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(eeDemo_la_LDFLAGS) $(eeDemo_la_OBJECTS) $(eeDemo_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eeDemo.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/eeDemo/eeDemo.c b/modules/eeDemo/eeDemo.c new file mode 100644 index 0000000..b5fab74 --- /dev/null +++ b/modules/eeDemo/eeDemo.c @@ -0,0 +1,39 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + + +void Init() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("eeDEMO.Init %d,%d,%d,%p:\n", p1, p2, p3, var); +} + +void SetKeyCancelFlag() { + int cancelflag = getCaliValue(); + + DEBUG_COMMAND_YET("eeDEMO.SetKeyCancelFlag %d:\n", cancelflag); +} + +void SetLoopFlag() { + /* Loop Flag */ + int loopflag = getCaliValue(); /* 0 なら無限繰り返し */ + + DEBUG_COMMAND_YET("eeDEMO.SetLoopFlag %d:\n", loopflag); +} + +void Run() { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("eeDEMO.Run %d:\n", p1); +} diff --git a/modules/lib/Makefile.am b/modules/lib/Makefile.am new file mode 100644 index 0000000..af8fb4e --- /dev/null +++ b/modules/lib/Makefile.am @@ -0,0 +1,37 @@ +noinst_LTLIBRARIES = libgraph.la libalk.la libdrawtext.la + +libgraph_la_LIBADD = @GLIB_LIBS@ +libgraph_la_SOURCES = graph.c surface.c cg.c \ + graph_expandcolor_blend.c \ + graph_fillrect.c \ + graph_fillrect_amap.c \ + graph_fillrect_acolor.c \ + graph_rect.c \ + graph_copy.c \ + graph_copy_amap.c \ + graph_copy_bright.c \ + graph_copy_whiteout.c \ + graph_blend_amap.c \ + graph_blend_screen.c \ + graph_saturadd_amap.c \ + graph_draw_amap.c \ + graph_stretch.c \ + graph_cg.c \ + graph_buller.c \ + gre_blend_useamap.c \ + gre_blend.c \ + gre_blend_screen.c + +libalk_la_SOURCES = alk.c +libalk_la_LIBADD = @GLIB_LIBS@ + +libdrawtext_la_SOURCES = drawtext.c +libdrawtext_la_LIBADD = @GLIB_LIBS@ + +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + $(LTDLINCL) \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib + diff --git a/modules/lib/Makefile.in b/modules/lib/Makefile.in new file mode 100644 index 0000000..7de3eb6 --- /dev/null +++ b/modules/lib/Makefile.in @@ -0,0 +1,594 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/lib +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libalk_la_DEPENDENCIES = +am_libalk_la_OBJECTS = alk.lo +libalk_la_OBJECTS = $(am_libalk_la_OBJECTS) +libdrawtext_la_DEPENDENCIES = +am_libdrawtext_la_OBJECTS = drawtext.lo +libdrawtext_la_OBJECTS = $(am_libdrawtext_la_OBJECTS) +libgraph_la_DEPENDENCIES = +am_libgraph_la_OBJECTS = graph.lo surface.lo cg.lo \ + graph_expandcolor_blend.lo graph_fillrect.lo \ + graph_fillrect_amap.lo graph_fillrect_acolor.lo graph_rect.lo \ + graph_copy.lo graph_copy_amap.lo graph_copy_bright.lo \ + graph_copy_whiteout.lo graph_blend_amap.lo \ + graph_blend_screen.lo graph_saturadd_amap.lo \ + graph_draw_amap.lo graph_stretch.lo graph_cg.lo \ + graph_buller.lo gre_blend_useamap.lo gre_blend.lo \ + gre_blend_screen.lo +libgraph_la_OBJECTS = $(am_libgraph_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libalk_la_SOURCES) $(libdrawtext_la_SOURCES) \ + $(libgraph_la_SOURCES) +DIST_SOURCES = $(libalk_la_SOURCES) $(libdrawtext_la_SOURCES) \ + $(libgraph_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +noinst_LTLIBRARIES = libgraph.la libalk.la libdrawtext.la +libgraph_la_LIBADD = @GLIB_LIBS@ +libgraph_la_SOURCES = graph.c surface.c cg.c \ + graph_expandcolor_blend.c \ + graph_fillrect.c \ + graph_fillrect_amap.c \ + graph_fillrect_acolor.c \ + graph_rect.c \ + graph_copy.c \ + graph_copy_amap.c \ + graph_copy_bright.c \ + graph_copy_whiteout.c \ + graph_blend_amap.c \ + graph_blend_screen.c \ + graph_saturadd_amap.c \ + graph_draw_amap.c \ + graph_stretch.c \ + graph_cg.c \ + graph_buller.c \ + gre_blend_useamap.c \ + gre_blend.c \ + gre_blend_screen.c + +libalk_la_SOURCES = alk.c +libalk_la_LIBADD = @GLIB_LIBS@ +libdrawtext_la_SOURCES = drawtext.c +libdrawtext_la_LIBADD = @GLIB_LIBS@ +AM_CFLAGS = @DEBUG_CFLAGS@ @GLIB_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + $(LTDLINCL) \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/lib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/lib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +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 +libalk.la: $(libalk_la_OBJECTS) $(libalk_la_DEPENDENCIES) + $(LINK) $(libalk_la_LDFLAGS) $(libalk_la_OBJECTS) $(libalk_la_LIBADD) $(LIBS) +libdrawtext.la: $(libdrawtext_la_OBJECTS) $(libdrawtext_la_DEPENDENCIES) + $(LINK) $(libdrawtext_la_LDFLAGS) $(libdrawtext_la_OBJECTS) $(libdrawtext_la_LIBADD) $(LIBS) +libgraph.la: $(libgraph_la_OBJECTS) $(libgraph_la_DEPENDENCIES) + $(LINK) $(libgraph_la_LDFLAGS) $(libgraph_la_OBJECTS) $(libgraph_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drawtext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_blend_amap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_blend_screen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_buller.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_cg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_copy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_copy_amap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_copy_bright.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_copy_whiteout.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_draw_amap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_expandcolor_blend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_fillrect.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_fillrect_acolor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_fillrect_amap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_rect.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_saturadd_amap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph_stretch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gre_blend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gre_blend_screen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gre_blend_useamap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/surface.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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 + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-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 + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-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/modules/lib/alk.c b/modules/lib/alk.c new file mode 100644 index 0000000..ec2d631 --- /dev/null +++ b/modules/lib/alk.c @@ -0,0 +1,102 @@ +/* + * alk.c ALK archive manager + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * @version 1.0 01/11/29 initial version +*/ +/* $Id: alk.c,v 1.2 2003/01/12 10:48:50 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "LittleEndian.h" +#include "alk.h" + +alk_t *alk_new(char *path) { + alk_t *alk; + int i, fd; + char *adr; + struct stat sbuf; + + if (0 > (fd = open(path, O_RDONLY))) { + WARNING("open: %s\n", strerror(errno)); + return NULL; + } + + if (0 > fstat(fd, &sbuf)) { + WARNING("fstat: %s\n", strerror(errno)); + close(fd); + return NULL; + } + + if (MAP_FAILED == (adr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, fd, 0))) { + WARNING("mmap: %s\n", strerror(errno)); + close(fd); + return NULL; + } + + if (0 != strncmp(adr, "ALK0", 4)) { + WARNING("mmap: %s\n", strerror(errno)); + munmap(adr, sbuf.st_size); + close(fd); + return NULL; + } + + alk = g_new0(alk_t, 1); + alk->mapadr = adr; + alk->size = sbuf.st_size; + alk->fd = fd; + + alk->datanum = LittleEndian_getDW(adr, 4); + alk->offset = g_new(int, alk->datanum); + + for (i = 0; i < alk->datanum; i++) { + alk->offset[i] = LittleEndian_getDW(adr, 8 + i * 8); + } + + return alk; +} + +int alk_free(alk_t *alk) { + if (alk == NULL) return OK; + + munmap(alk->mapadr, alk->size); + close(alk->fd); + g_free(alk->offset); + g_free(alk); + + return OK; +} + +char *alk_get(alk_t *alk, int no) { + if (no >= alk->datanum) return NULL; + + return alk->mapadr + alk->offset[no]; +} diff --git a/modules/lib/alk.h b/modules/lib/alk.h new file mode 100644 index 0000000..8a5e822 --- /dev/null +++ b/modules/lib/alk.h @@ -0,0 +1,52 @@ +/* + * alk.h ALK archive manager + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * @version 1.0 01/11/29 initial version +*/ +/* $Id: alk.h,v 1.2 2003/11/09 15:06:13 chikama Exp $ */ + +#ifndef __ALK_H__ +#define __ALK_H__ + +#include +#include + +/* + .ALK データ構造 + + char[4] sig = "ALK0"; シグネチャ + int32 num = ファイル数 + int32 offset; 個々のファイルのファイルの先頭からのオフセット + int32 size; 個々のファイルの大きさ(in bytes) +*/ + +typedef struct { + int fd; /* .alk ファイルの file discpriter */ + char *mapadr; /* mmap したファイルの先頭アドレス */ + off_t size; /* mmap したバイト数(ファイルサイズ) */ + int datanum; /* .alk ファイル中のファイル数 */ + int *offset; /* 各ファイルへのオフセット */ +} alk_t; + +extern alk_t *alk_new(char *path); +extern int alk_free(alk_t *alk); +extern char *alk_get(alk_t *alk, int no); + +#endif /* __ALK_H__ */ diff --git a/modules/lib/cg.c b/modules/lib/cg.c new file mode 100644 index 0000000..1234876 --- /dev/null +++ b/modules/lib/cg.c @@ -0,0 +1,145 @@ +/* + * cg.c DLL用に CGを surface に展開 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cg.c,v 1.2 2003/04/22 16:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "surface.h" +#include "cg.h" +#include "ags.h" +#include "pms.h" +#include "qnt.h" +#include "ngraph.h" +#include "dri.h" +#include "ald_manager.h" + +/** + * バッファのデータがどのCG形式かを最初の数バイトをみてチェック + * + * @param data: データ列 + * @return CGの種類(QNT/PMS8/PMS16のいずれか) + */ +static CG_TYPE check_cgformat(BYTE *data) { + if (qnt_checkfmt(data)) { + return ALCG_QNT; + } else if (pms256_checkfmt(data)) { + return ALCG_PMS8; + } else if (pms64k_checkfmt(data)) { + return ALCG_PMS16; + } + return ALCG_UNKNOWN; +} + +/** + * ファイル等から読み込んだCGデータをsurfaceに展開 + * + * @param b: データ列 + * @return CG が展開された surface + * 未知の形式のときは NULL が返る + */ +surface_t *sf_getcg(void *b) { + surface_t *sf = NULL; + int type; + cgdata *cg = NULL; + + type = check_cgformat(b); + switch(type) { + case ALCG_PMS8: + cg = pms256_extract(b); + break; + case ALCG_PMS16: + cg = pms64k_extract(b); + break; + case ALCG_QNT: + cg = qnt_extract(b); + break; + default: + break; + } + + if (cg == NULL) { + WARNING("Unknown Cg Type\n"); + return NULL; + } + + switch(type) { + case ALCG_PMS8: + sf = sf_create_alpha(cg->width, cg->height); + gr_draw_amap(sf, cg->x, cg->y, cg->pic, cg->width, cg->height, cg->width); + break; + + case ALCG_PMS16: + if (cg->alpha) { + sf = sf_create_surface(cg->width, cg->height, sf0->depth); + gr_drawimage16(sf, cg, cg->x, cg->y); + gr_draw_amap(sf, cg->x, cg->y, cg->alpha, cg->width, cg->height, cg->width); + } else { + sf = sf_create_pixel(cg->width, cg->height, sf0->depth); + gr_drawimage16(sf, cg, cg->x, cg->y); + } + break; + + case ALCG_QNT: + if (cg->alpha) { + sf = sf_create_surface(cg->width, cg->height, sf0->depth); + gr_drawimage24(sf, cg, cg->x, cg->y); + gr_draw_amap(sf, cg->x, cg->y, cg->alpha, cg->width, cg->height, cg->width); + } else { + sf = sf_create_pixel(cg->width, cg->height, sf0->depth); + gr_drawimage24(sf, cg, cg->x, cg->y); + } + break; + } + + if (cg->pic) g_free(cg->pic); + if (cg->pal) g_free(cg->pal); + if (cg->alpha) g_free(cg->alpha); + g_free(cg); + + return sf; +} + +/** + * ALDファイルから指定の番号のCGを読み込んで surfaceに展開 + * + * @param no: ファイル番号 (0-) + * @return CGが展開された surface + */ +surface_t *sf_loadcg_no(int no) { + dridata *dfile; + surface_t *sf; + + if (NULL == (dfile = ald_getdata(DRIFILE_CG, no))) { + return NULL; + } + + sf = sf_getcg(dfile->data); + + ald_freedata(dfile); + + return sf; +} diff --git a/modules/lib/drawtext.c b/modules/lib/drawtext.c new file mode 100644 index 0000000..9c27b0f --- /dev/null +++ b/modules/lib/drawtext.c @@ -0,0 +1,116 @@ +/* + * drawtext.c DLL用に surface 上に文字を描く + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: drawtext.c,v 1.2 2003/07/21 23:06:47 chikama Exp $ */ + +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "nact.h" +#include "ags.h" +#include "font.h" +#include "surface.h" +#include "ngraph.h" + +static int ftype; // フォントの種類 +static int fsize; // フォントの大きさ + +/** + * 次に描く文字のフォントの種類と大きさを設定 + * + * @param type: フォント種類 (FONT_MINCHO, FONT_GOTHIC) + * @param size: フォントサイズ + */ +int dt_setfont(int type, int size) { + ftype = type; + fsize = size; + return OK; +} + +/** + * surface にモノクロ文字を描画。アンチエイリアスされており256階調 + * 書き出すsurfaceは8ビットである必要あり + * + * @param sf: 描画する surface + * @param x: 描画位置X座標 + * @param y: 描画位置Y座標 + * @param buf: 描画文字列 (SJIS) + * @return: 実際に描画した幅 +*/ +int dt_drawtext(surface_t *sf, int x, int y, char *buf) { + agsurface_t *glyph; + int sx, sy, sw, sh; + FONT *font = nact->ags.font; + + font->sel_font(ftype, fsize); + + glyph = font->get_glyph(buf); + if (glyph == NULL) return 0; + + sx = x; sy = y; + sw = glyph->width; + sh = glyph->height; + if (!gr_clip_xywh(sf, &sx, &sy, &sw, &sh)) return 0; + + gr_copy(sf, sx, sy, glyph, 0, 0, sw, sh); + + return sw; +} + +/** + * surface にカラー文字を描画。alphamap に256階調のアンチエイリアスされた + * 文字を描き、pixelmap には、色情報を矩形で描く + * + * @param sf: 描画する surface + * @param x: 描画位置X座標 + * @param y: 描画位置Y座標 + * @param buf: 描画文字列(SJIS) + * @param r: 文字色赤 + * @param g: 文字色緑 + * @param b: 文字色青 + * @return: 実際に描画した幅 + */ +int dt_drawtext_col(surface_t *sf, int x, int y, char *buf, int r, int g, int b) { + agsurface_t *glyph; + int sx, sy, sw, sh; + FONT *font = nact->ags.font; + + font->sel_font(ftype, fsize); + + glyph = font->get_glyph(buf); + if (glyph == NULL) return 0; + + sx = x; sy = y; + sw = glyph->width; + sh = glyph->height; + if (!gr_clip_xywh(sf, &sx, &sy, &sw, &sh)) return 0; + + // alpha map に文字そのものを描く + gr_draw_amap(sf, sx, sy, glyph->pixel, sw, sh, glyph->bytes_per_line); + + // pixel map には色情報を矩形で描く + gr_fill(sf, sx, sy, sw, sh, r, g, b); + + return sw; +} diff --git a/modules/lib/drawtext.h b/modules/lib/drawtext.h new file mode 100644 index 0000000..e59c0f7 --- /dev/null +++ b/modules/lib/drawtext.h @@ -0,0 +1,31 @@ +/* + * drawtext.h DLL用に surface 上に文字を描く + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: drawtext.h,v 1.1 2003/04/22 16:34:28 chikama Exp $ */ + +#ifndef __DRAWTEXT_H__ +#define __DRAWTEXT_H__ + +extern int dt_setfont(int type, int size); +extern int dt_drawtext(surface_t *sf, int x, int y, char *buf); +extern int dt_drawtext_col(surface_t *sf, int x, int y, char *buf, int r, int g, int b); + +#endif /* __DRAWTEXT_H__ */ diff --git a/modules/lib/graph.c b/modules/lib/graph.c new file mode 100644 index 0000000..cf2834b --- /dev/null +++ b/modules/lib/graph.c @@ -0,0 +1,348 @@ +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "surface.h" +#include "graph.h" +#include "ngraph.h" +#include "nact.h" + +/* + gr_xxxx はクリッピングあり + gre_xxxx はクリッピングなし +*/ + +#undef WARNING +#define WARNING // + +#undef NOTICE +#define NOTICE // + + +/** + * surface から surface にコピーなどをする際に、転送元と転送先のsurface + * の大きさや、転送元・転送先座標、転送する領域の大きさなどから、実際に + * コピーする領域をクリッピングする + * + * @param ss: 転送元surface + * @param sx: 転送元X座標 + * @param sy: 転送元Y座標 + * @param sw: 転送幅 + * @param sh: 転送高さ + * @param ds: 転送先surface + * @param dx: 転送先X座標 + * @param dy: 転送先Y座標 + * @return TRUE -> 描画領域がある + * FALSE-> 転送領域の高さや幅が0以下になったり、転送元、転送先の座標が + * surfaceの範囲外になり、描画領域がなくなった。 + * それぞれの引数は適宜変更されている + */ +boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds, int *dx, int *dy) { + int w, h; + + if (ss == NULL) { + WARNING("ss surface is null\n"); + return FALSE; + } + if (ss == NULL) { + WARNING("ss surface is null\n"); + return FALSE; + } + + if (*sx > ss->width) { + WARNING("sx is too large (sx=%d,width=%d)\n", *sx, ss->width); + return FALSE; + } + if (*sy > ss->height) { + WARNING("sy is too large (sy=%d,height=%d)\n", *sy, ss->height); + return FALSE; + } + + if (*sx < 0) { + WARNING("sx is too small (sx=%d)\n", *sx); + return FALSE; + } + if (*sy < 0) { + WARNING("sy is too small (sy=%d)\n", *sy); + return FALSE; + } + + if (*dx > ds->width) { + WARNING("dx is too large (dx=%d,width=%d)\n", *dx, ds->width); + return FALSE; + } + if (*dy > ds->height) { + WARNING("dy is too large (dy=%d,height=%d)\n", *dy, ds->height); + return FALSE; + } + + w = *sw; + h = *sh; + + if (*dx < 0) { + *sx -= *dx; *sw += *dx; *dx = 0; + } + if (*dy < 0) { + *sy -= *dy; *sh += *dy; *dy = 0; + } + + *sw = MIN(ss->width - *sx, MIN(ds->width - *dx, *sw)); + *sh = MIN(ss->height - *sy, MIN(ds->height - *dy, *sh)); + + if (*sw <= 0) { + WARNING("sw become <=0\n"); + return FALSE; + } + if (*sh <= 0) { + WARNING("sh become <=0\n"); + return FALSE; + } + + if (*sw != w) { + NOTICE("width change %d -> %d\n", w, *sw); + } + if (*sh != h) { + NOTICE("height change %d -> %d\n", h, *sh); + } + + return TRUE; +} + +/** + * surface 内に描画を行う際に、surface の大きさで描画領域をクリッピングする + * + * @param ss: 描画surface + * @param sx: 描画開始X座標 + * @param sy: 描画開始Y座標 + * @param sw: 描画幅 + * @param sh: 描画高さ + * @return TRUE -> 描画領域がある + * FALSE-> 描画領域の高さや幅が0以下になったり、描画開始座標が + * surfaceの範囲外になり、描画領域がなくなった。 + * それぞれの引数は適宜変更されている + */ +boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) { + int w, h; + + if (ss == NULL) { + WARNING("ss surface is null\n"); + return FALSE; + } + + if (*sx > ss->width) { + WARNING("sx is too large (sx=%d,width=%d)\n", *sx, ss->width); + return FALSE; + } + if (*sy > ss->height) { + WARNING("sy is too large (sy=%d,height=%d)\n", *sy, ss->height); + return FALSE; + } + + w = *sw; + h = *sh; + + if (*sx < 0) { + *sw += *sx; *sx = 0; + } + if (*sy < 0) { + *sh += *sy; *sy = 0; + } + + *sw = MIN(ss->width - *sx, *sw); + *sh = MIN(ss->height - *sy, *sh); + + if (*sw <= 0) { + WARNING("sw become <=0\n"); + return FALSE; + } + if (*sh <= 0) { + WARNING("sh become <=0\n"); + return FALSE; + } + + if (*sw != w) { + NOTICE("width change %d -> %d\n", w, *sw); + } + if (*sh != h) { + NOTICE("height change %d -> %d\n", h, *sh); + } + + return TRUE; +} + +void gr_init() { +} + + +void gr_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv) { + + +} + +void gr_blend_src_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int alpha, int rate) { +} + +void gr_blend_add_satur(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height) { +} + + +void gr_blend_alpha_map_src_only(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height) { + // Dest Pixel = Blend(DestPixel, SrcPixel, SrcAlphaMap); +} + +void gr_blend_alpha_map_color(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int r, int g, int b) { + // Dest Pixel = Blend(DestPixel, Color, SrcAlphaMap); +} + +void gr_blend_alpha_map_color_alpha(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int r, int g, int b, int rate) { + // Dest Pixel = Blend(DestPixel, Color, SrcAlphaMap x rate); +} + +void gr_blend_alpha_map_alpha(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int rate) { + // Dest Pixel = Blend(DestPixel, SrcPixel, SrcAlphaMap x rate); +} + +void gr_blend_alpha_map_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv) { + // Dest Pixel = Blend(DestPixel, SrcPixel x lv, SrcAlphaMap); +} + +void gr_blend_alpha_map_alpha_src_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int rate, int lv) { + // Dest Pixel = Blend(DestPixel, SrcPixel x lv, SrcAlphaMap x rate); +} + +void gr_blend_use_amap_color(surface_t *dst, int dx, int dy, int width, int height, surface_t *alpha, int ax, int ay, int r, int g, int b, int rate) { +} + +void gr_blend_multiply(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int w, int h) { +} + +void gr_blend_screen_alpha(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int w, int h, int rate) { + // Screen x rate +} + + +void gr_screen_DA_DAxSA(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height) { + // DestAlpha = Screen(DestAlpha, SrcAlpha); +} + +void gr_add_DA_DAxSA(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height) { + // Dest Alpha = Satur(DestAlpha + SrcAlpha); +} + +void gr_copy_texture_wrap() { +} + +void gr_copy_texture_wrap_alpha() { +} + +void gr_copy_stretch_blend() { +} + +void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *src, int sx, int sy, int sw, int sh) { + float a1, a2, xd, yd; + int *row, *col; + int x, y; + BYTE *sp, *dp, *sa; + + if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) return; + if (!gr_clip_xywh(src, &sx, &sy, &sw, &sh)) return; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + sa = GETOFFSET_ALPHA(src, sx, sy); + + a1 = (float)sw / (float)dw; + a2 = (float)sh / (float)dh; + // src width と dst width が同じときに問題があるので+1 + row = g_new0(int, dw+1); + // 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる + // 可能性がある。 + col = g_new0(int, dh+1); + + for (yd = 0.0, y = 0; y < dh; y++) { + col[y] = yd; yd += a2; + } + + for (xd = 0.0, x = 0; x < dw; x++) { + row[x] = xd; xd += a1; + } + + switch(dst->depth) { + case 15: + { + WORD *yls, *yld; + BYTE *yla; + + for (y = 0; y < dh; y++) { + yls = (WORD *)(sp + *(y + col) * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + yla = (BYTE *)(sa + *(y + col) * src->width); + for (x = 0; x < dw; x++) { + *(yld + x) = ALPHABLEND15(*(yls+ *(row + x)), *(yld+x), *(yla+*(row+x))); + } + while(*(col + y) == *(col + y + 1)) { + yld += dst->width; + for (x = 0; x < dw; x++) { + *(yld + x) = ALPHABLEND15(*(yls+ *(row+x)), *(yld+x), *(yla+*(row+x))); + } + y++; + } + } + break; + } + case 16: + { + WORD *yls, *yld; + BYTE *yla; + + for (y = 0; y < dh; y++) { + yls = (WORD *)(sp + *(y + col) * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + yla = (BYTE *)(sa + *(y + col) * src->width); + for (x = 0; x < dw; x++) { + *(yld + x) = ALPHABLEND16(*(yls+ *(row + x)), *(yld+x), *(yla+*(row+x))); + } + while(*(col + y) == *(col + y + 1)) { + yld += dst->width; + for (x = 0; x < dw; x++) { + *(yld + x) = ALPHABLEND16(*(yls+ *(row+x)), *(yld+x), *(yla+*(row+x))); + } + y++; + } + } + break; + } + case 24: + case 32: + { + DWORD *yls, *yld; + BYTE *yla; + + for (y = 0; y < dh; y++) { + yls = (DWORD *)(sp + *(y + col) * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + yla = (BYTE *)(sa + *(y + col) * src->width); + for (x = 0; x < dw; x++) { + *(yld + x) = ALPHABLEND24(*(yls+ *(row + x)), *(yld+x), *(yla+*(row+x))); + } + while(*(col + y) == *(col + y + 1)) { + yld += dst->width; + for (x = 0; x < dw; x++) { + *(yld + x) = ALPHABLEND24(*(yls+ *(row+x)), *(yld+x), *(yla+*(row+x))); + } + y++; + } + } + break; + } + } + + g_free(row); + g_free(col); +} + +#include "graph2.c" diff --git a/modules/lib/graph.h b/modules/lib/graph.h new file mode 100644 index 0000000..3064f12 --- /dev/null +++ b/modules/lib/graph.h @@ -0,0 +1,17 @@ +#ifndef __GRAPH_H__ +#define __GRAPH_H__ + +#include "config.h" +#include "surface.h" + +extern void gr_init(); + +extern void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *src, int sx, int sy, int sw, int sh); +extern void gr_fill_alpha_overborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d); +extern void gr_fill_alpha_underborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d); +extern void gr_copy_alpha_map_sprite(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int cl); +extern void gr_blend_alpha_wds_stretch2x2(surface_t *src1, int sx1, int sy1, surface_t *src2, int sx2, int sy2, int sw, int sh, surface_t *dst, int dx, int dy); +extern void gr_blend_alpha_wds(surface_t *src1, int sx1, int sy1, surface_t *src2, int sx2, int sy2, int sw, int sh, surface_t *dst, int dx, int dy); + +#endif /* __GRAPH_H__ */ + diff --git a/modules/lib/graph2.c b/modules/lib/graph2.c new file mode 100644 index 0000000..6c3f2c3 --- /dev/null +++ b/modules/lib/graph2.c @@ -0,0 +1,164 @@ +void gr_fill_alpha_overborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d) { + BYTE *dp; + int x, y; + + if (dst == NULL) return; + if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) return; + + dp = GETOFFSET_ALPHA(dst, dx, dy); + if (dp == NULL) return; + + for (y = 0; y < dh; y++) { + for (x = 0; x < dw; x++) { + if (*(dp + x) >= (BYTE)s) *(dp + x) = (BYTE)d; + } + dp += dst->width; + } +} + +void gr_fill_alpha_underborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d) { + BYTE *dp; + int x, y; + + if (dst == NULL) return; + if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) return; + + dp = GETOFFSET_ALPHA(dst, dx, dy); + if (dp == NULL) return; + + for (y = 0; y < dh; y++) { + for (x = 0; x < dw; x++) { + if (*(dp + x) <= (BYTE)s) *(dp + x) = (BYTE)d; + } + dp += dst->width; + } +} + +void gr_copy_alpha_map_sprite(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int cl) { + BYTE *sp, *dp; + int x, y; + + if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return; + + sp = GETOFFSET_ALPHA(src, sx, sy); + dp = GETOFFSET_ALPHA(dst, dx, dy); + + if (src == dst) { + if (sy <= dy && dy < (sy + sh)) { + sp += (sh -1) * src->width; + dp += (sh -1) * dst->width; + for (y = 0; y < sh; y++) { + for (x = 0; x < sw; x++) { + if (*(sp + x) != cl) *(dp + x) = *(sp + x); + } + sp -= src->width; + dp -= dst->width; + } + } else { + for (y = 0; y < sh; y++) { + for (x = 0; x < sw; x++) { + if (*(sp + x) != cl) *(dp + x) = *(sp + x); + } + sp += src->width; + dp += dst->width; + } + } + } else { + for (y = 0; y < sh; y++) { + for (x = 0; x < sw; x++) { + if (*(sp + x) != cl) *(dp + x) = *(sp + x); + } + sp += src->width; + dp += dst->width; + } + } +} + +void gr_blend_alpha_wds_stretch2x2(surface_t *src1, int sx1, int sy1, surface_t *src2, int sx2, int sy2, int sw, int sh, surface_t *dst, int dx, int dy) { + surface_t *t = sf_create_surface(sw * 2, sh * 2, dst->depth); + + gr_copy_stretch(t, 0, 0, sw * 2, sh * 2, src2, sx2, sy2, sw, sh); + gr_blend_alpha_wds(t, 0, 0, src1, sx1, sy1, sw * 2, sh * 2, dst, dx, dy); + + sf_free(t); + +} + +void gr_blend_alpha_wds(surface_t *src1, int sx1, int sy1, surface_t *src2, int sx2, int sy2, int sw, int sh, surface_t *dst, int dx, int dy) { + int x, y; + BYTE *sp1, *sp2, *dp, *sa; + + sp1 = GETOFFSET_PIXEL(src1, sx1, sy1); + sp2 = GETOFFSET_PIXEL(src2, sx2, sy2); + sa = GETOFFSET_ALPHA(src1, sx1, sy1); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + switch(dst->depth) { + case 15: + { + WORD *yls1, *yls2, *yld; + BYTE *yla; + + for (y = 0; y < sh; y++) { + yls1 = (WORD *)(sp1 + y * src1->bytes_per_line); + yls2 = (WORD *)(sp2 + y * src2->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + yla = (BYTE *)(sa + y * src1->width); + + for (x = 0; x < sw; x++) { + *yld = SUTURADD15(*yls1, ALPHABLEND15(*yls1, *yls2, *yla)); + yls1++; yls2++; yld++; yla++; + } + } + break; + } + case 16: +// if (nact->mmx_is_ok) { + if (0) { +#ifdef ENABLE_MMX + ablend16_wds_pppp(dp, sp1, sp2, sa, sw, sh, + dst->bytes_per_line, + src1->bytes_per_line, + src2->bytes_per_line, + src1->width); +#endif + } else { + WORD *yls1, *yls2, *yld; + BYTE *yla; + + for (y = 0; y < sh; y++) { + yls1 = (WORD *)(sp1 + y * src1->bytes_per_line); + yls2 = (WORD *)(sp2 + y * src2->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + yla = (BYTE *)(sa + y * src1->width); + + for (x = 0; x < sw; x++) { + *yld = SUTURADD16(*yls1, ALPHABLEND16(*yls1, *yls2, *yla)); + //*yld = SUTURADD16(*yls1, ALPHALEVEL16(*yls2, *yla)); + yls1++; yls2++; yld++; yla++; + } + } + } + break; + case 24: + case 32: + { + DWORD *yls1, *yls2, *yld; + BYTE *yla; + + for (y = 0; y < sh; y++) { + yls1 = (DWORD *)(sp1 + y * src1->bytes_per_line); + yls2 = (DWORD *)(sp2 + y * src2->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + yla = (BYTE *)(sa + y * src1->width); + + for (x = 0; x < sw; x++) { + *yld = SUTURADD24(*yls1, ALPHABLEND24(*yls1, *yls2, *yla)); + yls1++; yls2++; yld++; yla++; + } + } + break; + } + } +} + diff --git a/modules/lib/graph_blend_amap.c b/modules/lib/graph_blend_amap.c new file mode 100644 index 0000000..93ed953 --- /dev/null +++ b/modules/lib/graph_blend_amap.c @@ -0,0 +1,23 @@ +// 転送元 alpha map を参照して、転送元ピクセルと転送先ピクセルをブレンドし、 +// 転送先ピクセルに描画 + +#include + +#include "portab.h" +#include "system.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_blend_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) { + if (src == NULL || dst == NULL) return NG; + if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return NG; + + if (src->alpha == NULL) { + WARNING("src alpha NULL\n"); + return NG; + } + + return gre_BlendUseAMap(dst, dx, dy, dst, dx, dy, src, sx, sy, sw, sh, src, sx, sy, 255); +} + diff --git a/modules/lib/graph_blend_screen.c b/modules/lib/graph_blend_screen.c new file mode 100644 index 0000000..3e4ce2a --- /dev/null +++ b/modules/lib/graph_blend_screen.c @@ -0,0 +1,18 @@ +// srcのsurfaceの一部をdstに飽和加算 + +#include + +#include "portab.h" +#include "system.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_blend_screen(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int w, int h) { + + if (src == NULL || dst == NULL) return NG; + if (!gr_clip(src, &sx, &sy, &w, &h, dst, &dx, &dy)) return NG; + + return gre_BlendScreen(dst, dx, dy, dst, dx, dy, src, sx, sy, w, h); +} + diff --git a/modules/lib/graph_buller.c b/modules/lib/graph_buller.c new file mode 100644 index 0000000..635005c --- /dev/null +++ b/modules/lib/graph_buller.c @@ -0,0 +1,235 @@ +#include +#include +#include + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_buller(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int step) { + BYTE *dp, *sp; + int x, y; + int r1, g1, b1; + int r2, g2, b2; + int r3, g3, b3; + + if (src == NULL || dst == NULL) return NG; + if (!gr_clip(src, &sx, &sy, &width, &height, dst, &dx, &dy)) return NG; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + switch(dst->depth) { + case 15: + { + WORD *yld, *yls; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < step; x++) { + *yld = *(yls+step); + yls++; yld++; + } + + for (; x < (width - step*2); x++) { + r1 = PIXR15((*(yls+step))); + g1 = PIXG15((*(yls+step))); + b1 = PIXB15((*(yls+step))); + r2 = PIXR15((*(yls-step))); + g2 = PIXG15((*(yls-step))); + b2 = PIXB15((*(yls-step))); + r3 = MIN(255, (r1+r2) >> 1); + g3 = MIN(255, (g1+g2) >> 1); + b3 = MIN(255, (b1+b2) >> 1); + + *yld = PIX15(r3, g3, b3); + yld++; yls++; + } + for (; x < width; x++) { + *yld = *(yls-step); + yls++; yld++; + } + } + break; + } + case 16: + { + WORD *yld, *yls; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < step; x++) { + *yld = *(yls+step); + yls++; yld++; + } + + for (; x < (width - step*2); x++) { + r1 = PIXR16((*(yls+step))); + g1 = PIXG16((*(yls+step))); + b1 = PIXB16((*(yls+step))); + r2 = PIXR16((*(yls-step))); + g2 = PIXG16((*(yls-step))); + b2 = PIXB16((*(yls-step))); + r3 = MIN(255, (r1+r2) >> 1); + g3 = MIN(255, (g1+g2) >> 1); + b3 = MIN(255, (b1+b2) >> 1); + + *yld = PIX16(r3, g3, b3); + yld++; yls++; + } + for (; x < width; x++) { + *yld = *(yls-step); + yls++; yld++; + } + } + break; + } + case 24: + case 32: + { + DWORD *yld, *yls; + + for (y = 0; y < height; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < step; x++) { + *yld = *(yls+step); + yls++; yld++; + } + + for (; x < (width - step*2); x++) { + r1 = PIXR24((*(yls+step))); + g1 = PIXG24((*(yls+step))); + b1 = PIXB24((*(yls+step))); + r2 = PIXR24((*(yls-step))); + g2 = PIXG24((*(yls-step))); + b2 = PIXB24((*(yls-step))); + r3 = MIN(255, (r1+r2) >> 1); + g3 = MIN(255, (g1+g2) >> 1); + b3 = MIN(255, (b1+b2) >> 1); + + *yld = PIX24(r3, g3, b3); + yld++; yls++; + } + for (; x < width; x++) { + *yld = *(yls-step); + yls++; yld++; + } + } + break; + }} + + return OK; +} + +// 縦方向ブラー +int gr_buller_v(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int step) { + BYTE *dp, *sp; + int x, y; + int r1, g1, b1; + int r2, g2, b2; + int r3, g3, b3; + + if (src == NULL || dst == NULL) return NG; + if (!gr_clip(src, &sx, &sy, &width, &height, dst, &dx, &dy)) return NG; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + switch(dst->depth) { + case 15: + { + WORD *yld, *yls; + + for (x = 0; x < width; x++) { + yls = (WORD *)(sp + x * src->bytes_per_pixel); + yld = (WORD *)(dp + x * dst->bytes_per_pixel); + for (y = 0; y < step; y++) { + *(yld+y*dst->width) = *(yls+(y+step)*src->width); + } + + for (; y < (height - step*2); y++) { + r1 = PIXR15((*(yls+(y+step)*src->width))); + g1 = PIXG15((*(yls+(y+step)*src->width))); + b1 = PIXB15((*(yls+(y+step)*src->width))); + r2 = PIXR15((*(yls+(y-step)*src->width))); + g2 = PIXG15((*(yls+(y-step)*src->width))); + b2 = PIXB15((*(yls+(y-step)*src->width))); + r3 = MIN(255, (r1+r2) >> 1); + g3 = MIN(255, (g1+g2) >> 1); + b3 = MIN(255, (b1+b2) >> 1); + + *(yld+y*dst->width) = PIX15(r3, g3, b3); + } + for (; y < height; y++) { + *(yld+y*dst->width) = *(yls+(y-step)*src->width); + } + } + break; + } + case 16: + { + WORD *yld, *yls; + + for (x = 0; x < width; x++) { + yls = (WORD *)(sp + x * src->bytes_per_pixel); + yld = (WORD *)(dp + x * dst->bytes_per_pixel); + for (y = 0; y < step; y++) { + *(yld+y*dst->width) = *(yls+(y+step)*src->width); + } + + for (; y < (height - step*2); y++) { + r1 = PIXR16((*(yls+(y+step)*src->width))); + g1 = PIXG16((*(yls+(y+step)*src->width))); + b1 = PIXB16((*(yls+(y+step)*src->width))); + r2 = PIXR16((*(yls+(y-step)*src->width))); + g2 = PIXG16((*(yls+(y-step)*src->width))); + b2 = PIXB16((*(yls+(y-step)*src->width))); + r3 = MIN(255, (r1+r2) >> 1); + g3 = MIN(255, (g1+g2) >> 1); + b3 = MIN(255, (b1+b2) >> 1); + + *(yld+y*dst->width) = PIX16(r3, g3, b3); + } + for (; y < height; y++) { + *(yld+y*dst->width) = *(yls+(y-step)*src->width); + } + } + break; + } + case 24: + case 32: + { + DWORD *yld, *yls; + + for (x = 0; x < width; x++) { + yls = (DWORD *)(sp + x * src->bytes_per_pixel); + yld = (DWORD *)(dp + x * dst->bytes_per_pixel); + for (y = 0; y < step; y++) { + *(yld+y*dst->width) = *(yls+(y+step)*src->width); + } + + for (; y < (height - step*2); y++) { + r1 = PIXR24((*(yls+(y+step)*src->width))); + g1 = PIXG24((*(yls+(y+step)*src->width))); + b1 = PIXB24((*(yls+(y+step)*src->width))); + r2 = PIXR24((*(yls+(y-step)*src->width))); + g2 = PIXG24((*(yls+(y-step)*src->width))); + b2 = PIXB24((*(yls+(y-step)*src->width))); + r3 = MIN(255, (r1+r2) >> 1); + g3 = MIN(255, (g1+g2) >> 1); + b3 = MIN(255, (b1+b2) >> 1); + + *(yld+y*dst->width) = PIX24(r3, g3, b3); + } + for (; y < height; y++) { + *(yld+y*dst->width) = *(yls+(y-step)*src->width); + } + } + break; + }} + + return OK; +} + diff --git a/modules/lib/graph_cg.c b/modules/lib/graph_cg.c new file mode 100644 index 0000000..aa47f70 --- /dev/null +++ b/modules/lib/graph_cg.c @@ -0,0 +1,182 @@ +/* + * graph_cg.c surface に 実際にcgデータを描く + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: graph_cg.c,v 1.2 2003/08/30 21:29:16 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "surface.h" +#include "cg.h" +#include "ags.h" +#include "ngraph.h" + +/** + * surface に 24bpp CG (QNT)を描画 + * + * @param ds: 描画 surface + * @param cg: 描画するCGデータ + * @param x: 描画X座標 + * @param y: 描画Y座標 + */ +void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y) { + int dx, dy, dw, dh; + BYTE *sp, *dp, r, g, b; + + dx = x; + dy = y; + dw = cg->width; + dh = cg->height; + + if (!gr_clip_xywh(ds, &dx, &dy, &dw, &dh)) return; + + cg->data_offset = (abs(dy - y) * cg->width + abs(dx - x)) * 3; + + sp = (BYTE *)(cg->pic + cg->data_offset); + dp = GETOFFSET_PIXEL(ds, dx, dy); + + switch(ds->depth) { + case 15: + { + WORD *yl; + + for (y = 0; y < dh; y++) { + yl = (WORD *)(dp + y * ds->bytes_per_line); + for (x = 0; x < dw; x++) { + r = *sp; + g = *(sp +1); + b = *(sp +2); + *yl = PIX15(r, g, b); + yl++; sp += 3; + } + sp += ((cg->width - dw) * 3); + } + break; + } + case 16: + { + WORD *yl; + + for (y = 0; y < dh; y++) { + yl = (WORD *)(dp + y * ds->bytes_per_line); + for (x = 0; x < dw; x++) { + r = *sp; + g = *(sp +1); + b = *(sp +2); + *yl = PIX16(r, g, b); + yl++; sp += 3; + } + sp += ((cg->width - dw) * 3); + } + break; + + } + case 24: + case 32: + { + DWORD *yl; + + for (y = 0; y < dh; y++) { + yl = (DWORD *)(dp + y * ds->bytes_per_line); + for (x = 0; x < dw; x++) { + r = *sp; + g = *(sp +1); + b = *(sp +2); + *yl = PIX24(r, g, b); + yl++; sp += 3; + } + sp += ((cg->width - dw) * 3); + } + break; + }} +} + +/** + * surface に 16bpp CG (PMS16/BMP)を描画 + * + * @param ds: 描画 surface + * @param cg: 描画するCGデータ + * @param x: 描画X座標 + * @param y: 描画Y座標 + */ +void gr_drawimage16(surface_t *ds, cgdata *cg, int x, int y) { + int dx, dy, dw, dh; + BYTE *dp; + WORD pic16, *sp; + + dx = x; + dy = y; + dw = cg->width; + dh = cg->height; + + if (!gr_clip_xywh(ds, &dx, &dy, &dw, &dh)) return; + + cg->data_offset = (abs(dy - y) * cg->width + abs(dx - x)) * 2; + + sp = (WORD *)(cg->pic + cg->data_offset); + dp = GETOFFSET_PIXEL(ds, dx, dy); + + switch(ds->depth) { + case 15: + { + WORD *yl; + + for (y = 0; y < dh; y++) { + yl = (WORD *)(dp + y * ds->bytes_per_line); + for (x = 0; x < dw; x++) { + pic16 = *sp; + *yl = PIX15(RGB_PIXR16(pic16), RGB_PIXG16(pic16), RGB_PIXB16(pic16)); + yl++; sp ++; + } + sp += (cg->width - dw); + } + break; + } + case 16: + { + for (y = 0; y < dh; y++) { + memcpy(dp, sp, dw * 2); + sp += cg->width; + dp += ds->bytes_per_line; + } + break; + + } + case 24: + case 32: + { + DWORD *yl; + + for (y = 0; y < dh; y++) { + yl = (DWORD *)(dp + y * ds->bytes_per_line); + for (x = 0; x < dw; x++) { + pic16 = *sp; + *yl = PIX24(RGB_PIXR16(pic16), RGB_PIXG16(pic16), RGB_PIXB16(pic16)); + yl++; sp++; + } + sp += (cg->width - dw); + } + break; + }} +} diff --git a/modules/lib/graph_copy.c b/modules/lib/graph_copy.c new file mode 100644 index 0000000..57afc09 --- /dev/null +++ b/modules/lib/graph_copy.c @@ -0,0 +1,80 @@ +/* + * graph_copy.c pixel データのコピー + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: graph_copy.c,v 1.2 2003/04/25 17:23:55 chikama Exp $ */ + +#include + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +/** + * 指定の surface の領域を 別の surface の指定位置へコピーする + * pixelデータのみコピー + * + * @param dst: 転送先 surface + * @param dx: 転送先X座標 + * @param dy: 転送先Y座標 + * @param src: 転送元surface + * @param sx: 転送元X座標 + * @param sy: 転送元Y座標 + * @param sw: 転送幅 + * @param sh: 転送高さ + */ +int gr_copy(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) { + BYTE *sp, *dp; + + if (src == NULL || dst == NULL) return NG; + if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return NG; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + if (sp == NULL || dp == NULL) return NG; + + if (src == dst) { + if (sy <= dy && dy < (sy + sh)) { + sp += (sh -1) * src->bytes_per_line; + dp += (sh -1) * dst->bytes_per_line; + while(sh--) { + memmove(dp, sp, sw * src->bytes_per_pixel); + sp -= src->bytes_per_line; + dp -= dst->bytes_per_line; + } + } else { + while(sh--) { + memmove(dp, sp, sw * src->bytes_per_pixel); + sp += src->bytes_per_line; + dp += dst->bytes_per_line; + } + } + } else { + while(sh--) { + memcpy(dp, sp, sw * src->bytes_per_pixel); + sp += src->bytes_per_line; + dp += dst->bytes_per_line; + } + } + + return OK; +} diff --git a/modules/lib/graph_copy_amap.c b/modules/lib/graph_copy_amap.c new file mode 100644 index 0000000..8712b4c --- /dev/null +++ b/modules/lib/graph_copy_amap.c @@ -0,0 +1,87 @@ +/* + * graph_copy_amap.c alpha map のコピー + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: graph_copy_amap.c,v 1.2 2003/04/25 17:23:55 chikama Exp $ */ + +#include + +#include "portab.h" +#include "system.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +/** + * 指定の surface の alphamap を別の surface の指定領域にコピーする + * + * @param dst: 転送先 surface + * @param dx: 転送先X座標 + * @param dy: 転送先Y座標 + * @param src: 転送元surface + * @param sx: 転送元X座標 + * @param sy: 転送元Y座標 + * @param sw: 転送幅 + * @param sh: 転送高さ + */ +int gr_copy_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) { + BYTE *sp, *dp; + + if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return NG; + + sp = GETOFFSET_ALPHA(src, sx, sy); + dp = GETOFFSET_ALPHA(dst, dx, dy); + + if (sp == NULL) { + WARNING("src alpha NULL\n"); + return NG; + } + + if (dp == NULL) { + WARNING("dst alpha NULL\n"); + return NG; + } + + if (src == dst) { + if (sy <= dy && dy < (sy + sh)) { + sp += (sh -1) * src->width; + dp += (sh -1) * dst->width; + while(sh--) { + memmove(dp, sp, sw); + sp -= src->width; + dp -= dst->width; + } + } else { + while(sh--) { + memmove(dp, sp, sw); + sp += src->width; + dp += dst->width; + } + } + } else { + while(sh--) { + memcpy(dp, sp, sw); + sp += src->width; + dp += dst->width; + } + } + + return OK; +} diff --git a/modules/lib/graph_copy_bright.c b/modules/lib/graph_copy_bright.c new file mode 100644 index 0000000..c7359ec --- /dev/null +++ b/modules/lib/graph_copy_bright.c @@ -0,0 +1,78 @@ +// 指定のsurface領域を明るさを lv/255 倍してコピー + +#include + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +void gr_copy_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv) { + int x, y; + BYTE *sp, *dp; + + if (!gr_clip(src, &sx, &sy, &width, &height, dst, &dx, &dy)) return; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + if (sp == NULL || dp == NULL) return; + + switch(dst->depth) { + case 15: + { + WORD *yls, *yld; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < width; x++) { + *yld = ALPHALEVEL15(*yls, lv); + yls++; yld++; + } + } + break; + } + case 16: + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + int alpha; + lv = 255 - lv; + alpha = lv | lv << 8 | lv << 16 | lv << 24; + ablend16_dpd(dp, 0, sp, alpha, width, height, dst->bytes_per_line, src->bytes_per_line); +#endif + } else { + WORD *yls, *yld; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < width; x++) { + *yld = ALPHALEVEL16(*yls, lv); + yls++; yld++; + } + } + } + break; + case 24: + case 32: + { + DWORD *yls, *yld; + + for (y = 0; y < height; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < width; x++) { + *yld = ALPHALEVEL24(*yls, lv); + yls++; yld++; + } + } + break; + } + } +} + diff --git a/modules/lib/graph_copy_whiteout.c b/modules/lib/graph_copy_whiteout.c new file mode 100644 index 0000000..15f4ef0 --- /dev/null +++ b/modules/lib/graph_copy_whiteout.c @@ -0,0 +1,70 @@ +// 指定のsurface領域をlv=255を真っ白 lv=0を通常としてコピー + +#include + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +void gr_copy_whiteout(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int lv) { + + int x, y; + BYTE *sp, *dp; + + if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + if (sp == NULL || dp == NULL) return; + + switch(dst->depth) { + case 15: + { + WORD *yls, *yld; + + for (y = 0; y < sh; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < sw; x++) { + *yld = WHITELEVEL15(*yls, lv); + yls++; yld++; + } + } + break; + } + case 16: + { + WORD *yls, *yld; + + for (y = 0; y < sh; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < sw; x++) { + *yld = WHITELEVEL16(*yls, lv); + yls++; yld++; + } + } + break; + } + case 24: + case 32: + { + DWORD *yls, *yld; + + for (y = 0; y < sh; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + + for (x = 0; x < sw; x++) { + *yld = WHITELEVEL24(*yls, lv); + yls++; yld++; + } + } + break; + } + } +} diff --git a/modules/lib/graph_draw_amap.c b/modules/lib/graph_draw_amap.c new file mode 100644 index 0000000..f6881ea --- /dev/null +++ b/modules/lib/graph_draw_amap.c @@ -0,0 +1,24 @@ +// 8bit surface (or data列)から surface の alpha map へコピー + +#include +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_draw_amap(surface_t *dst, int dx, int dy, BYTE *src, int width, int height, int scanline) { + int y; + BYTE *sp, *dp; + + sp = src; + dp = GETOFFSET_ALPHA(dst, dx, dy); + + for (y = 0; y < height; y++) { + memcpy(dp, sp, width); + sp += scanline; + dp += dst->width; + } + + return OK; +} + diff --git a/modules/lib/graph_expandcolor_blend.c b/modules/lib/graph_expandcolor_blend.c new file mode 100644 index 0000000..c70cb87 --- /dev/null +++ b/modules/lib/graph_expandcolor_blend.c @@ -0,0 +1,78 @@ +// color expansion and blending +// 8bppのモノクロをcolでブレンド + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_expandcolor_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int r, int g, int b) { + BYTE *sp, *dp; + int x, y; + int col; + + if (FALSE == gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) { + return NG; + } + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + switch(dst->depth) { + case 15: { + WORD *yd; + BYTE *ys; + col = PIX15(r, g, b); + for (y = 0; y < sh; y++) { + ys = (BYTE *)(sp + y * src->bytes_per_line); + yd = (WORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < sw; x++) { + if (*ys) { + *yd = ALPHABLEND15(col, *yd, (BYTE)*ys); + } + ys++; yd++; + } + } + break; + } + case 16: + col = PIX16(r, g, b); + //if (nact->mmx_is_ok) { + if (0) { + //ablend16_dpp(col, dp, sp, sw, sh, + // dst->bytes_per_line, src->bytes_per_line); + } else { + WORD *yd; + BYTE *ys; + for (y = 0; y < sh; y++) { + ys = (BYTE *)(sp + y * src->bytes_per_line); + yd = (WORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < sw; x++) { + if (*ys) { + *yd = ALPHABLEND16(col, *yd, (BYTE)*ys); + } + ys++; yd++; + } + } + } + break; + case 32: + case 24: { + DWORD *yd; + BYTE *ys; + col = PIX24(r, g, b); + for (y = 0; y < sh; y++) { + ys = (BYTE *)(sp + y * src->bytes_per_line); + yd = (DWORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < sw; x++) { + if (*ys) { + *yd = ALPHABLEND24(col, *yd, (BYTE)*ys); + } + ys++; yd++; + } + } + break; + }} + + return OK; +} diff --git a/modules/lib/graph_fillrect.c b/modules/lib/graph_fillrect.c new file mode 100644 index 0000000..64a1955 --- /dev/null +++ b/modules/lib/graph_fillrect.c @@ -0,0 +1,63 @@ +// fill rectangle + +#include +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_fill(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b) { + BYTE *dp, *dp_; + int x, y; + + if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) { + return NG; + } + + dp = dp_ = GETOFFSET_PIXEL(dst, dx, dy); + + switch(dst->depth) { + case 8: + memset(dp, r, dw); + break; + + case 15: + { + WORD pic15 = PIX15(r, g, b); + + for (x = 0; x < dw; x++) { + *((WORD *)dp + x) = pic15; + } + break; + } + case 16: + { + WORD pic16 = PIX16(r, g, b); + + for (x = 0; x < dw; x++) { + *((WORD *)dp + x) = pic16; + } + + break; + } + case 24: + case 32: + { + DWORD pic24 = PIX24(r, g, b); + + for (x = 0; x < dw; x++) { + *((DWORD *)dp + x) = pic24; + } + + break; + } + } + + dp += dst->bytes_per_line; + for (y = 1; y < dh; y++) { + memcpy(dp, dp_, dw * dst->bytes_per_pixel); + dp += dst->bytes_per_line; + } + + return OK; +} diff --git a/modules/lib/graph_fillrect_acolor.c b/modules/lib/graph_fillrect_acolor.c new file mode 100644 index 0000000..b965fb9 --- /dev/null +++ b/modules/lib/graph_fillrect_acolor.c @@ -0,0 +1,73 @@ +// 指定の色(rgb)をブレンド率(lv)を指定して矩形塗りつぶし + +#include "config.h" + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_fill_alpha_color(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b, int lv) { + int x, y; + BYTE *dp; + + if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) { + return NG; + } + + dp = GETOFFSET_PIXEL(dst, dx, dy); + + switch(dst->depth) { + case 15: + { + WORD pic15 = PIX15(r, g, b); + WORD *yls; + + for (y = 0; y < dh; y++) { + yls = (WORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < dw; x++) { + *yls = ALPHABLEND15(pic15, *yls, lv); + yls++; + } + } + break; + } + case 16: + if (nact->mmx_is_ok) { +#ifdef ENABLE_MMX + int alpha = lv | lv << 8 | lv << 16 | lv << 24; + WORD pic16 = PIX16(r, g, b); + ablend16_dpd(dp, pic16, dp, alpha, dw, dh, dst->bytes_per_line, dst->bytes_per_line); +#endif + } else { + WORD pic16 = PIX16(r, g, b); + WORD *yls; + + for (y = 0; y < dh; y++) { + yls = (WORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < dw; x++) { + *yls = ALPHABLEND16(pic16, *yls, lv); + yls++; + } + } + } + break; + case 24: + case 32: + { + DWORD pic24 = PIX24(r, g, b); + DWORD *yls; + + for (y = 0; y < dh; y++) { + yls = (DWORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < dw; x++) { + *yls = ALPHABLEND24(pic24, *yls, lv); + yls++; + } + } + break; + } + } + + return OK; +} diff --git a/modules/lib/graph_fillrect_amap.c b/modules/lib/graph_fillrect_amap.c new file mode 100644 index 0000000..cc10bbf --- /dev/null +++ b/modules/lib/graph_fillrect_amap.c @@ -0,0 +1,24 @@ +// alpha map の矩形塗りつぶし + +#include +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_fill_alpha_map(surface_t *dst, int dx, int dy, int dw, int dh, int lv) { + BYTE *a; + + if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) { + return NG; + } + + a = GETOFFSET_ALPHA(dst, dx, dy); + + while(dh--){ + memset(a, lv, dw); + a += dst->width; + } + + return OK; +} diff --git a/modules/lib/graph_rect.c b/modules/lib/graph_rect.c new file mode 100644 index 0000000..dbf6312 --- /dev/null +++ b/modules/lib/graph_rect.c @@ -0,0 +1,99 @@ +// draw rectangle + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_drawrect(surface_t *dst, int x, int y, int w, int h, int r, int g, int b) { + BYTE *dp; + int i; + int col = 0; + + if (FALSE == gr_clip_xywh(dst, &x, &y, &w, &h)) { + return NG; + } + + dp = GETOFFSET_PIXEL(dst, x, y); + + switch(dst->depth) { + case 8: + col = r; break; + case 15: + col = PIX15(r, g, b); break; + case 16: + col = PIX16(r, g, b); break; + case 24: + case 32: + col = PIX24(r, g, b); break; + } + + switch(dst->depth) { + case 8: + /* top */ + for (i = 0; i < w; i++) { + *((BYTE *)dp + i) = col; + } + + /* side */ + h-=2; + for (i = 0; i < h; i++) { + dp += dst->bytes_per_line; + *((BYTE *)dp) = col; + *((BYTE *)dp + w - 1) = col; + } + + /* bottom */ + dp += dst->bytes_per_line; + for (i = 0; i < w; i++) { + *((BYTE *)dp + i) = col; + } + break; + case 15: + case 16: + /* top */ + for (i = 0; i < w; i++) { + *((WORD *)dp + i) = col; + } + + /* side */ + h-=2; + for (i = 0; i < h; i++) { + dp += dst->bytes_per_line; + *((WORD *)dp) = col; + *((WORD *)dp + w - 1) = col; + } + + /* bottom */ + dp += dst->bytes_per_line; + for (i = 0; i < w; i++) { + *((WORD *)dp + i) = col; + } + + break; + case 24: + case 32: + /* top */ + for (i = 0; i < w; i++) { + *((DWORD *)dp + i) = col; + } + + /* side */ + h-=2; + for (i = 0; i < h; i++) { + dp += dst->bytes_per_line; + *((DWORD *)dp) = col; + *((DWORD *)dp + w - 1) = col; + } + + /* bottom */ + dp += dst->bytes_per_line; + for (i = 0; i < w; i++) { + *((DWORD *)dp + i) = col; + } + + break; + } + + return OK; +} diff --git a/modules/lib/graph_saturadd_amap.c b/modules/lib/graph_saturadd_amap.c new file mode 100644 index 0000000..aecec01 --- /dev/null +++ b/modules/lib/graph_saturadd_amap.c @@ -0,0 +1,42 @@ +// alpha map の飽和加算 + +#include +#include "portab.h" +#include "system.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gr_saturadd_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) { + BYTE *sp, *dp; + int x, y; + + if (FALSE == gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) { + return NG; + } + + if (src->alpha == NULL) { + WARNING("src alpha NULL\n"); + return NG; + } + + if (dst->alpha == NULL) { + WARNING("dst alpha NULL\n"); + return NG; + } + + sp = GETOFFSET_ALPHA(src, sx, sy); + dp = GETOFFSET_ALPHA(dst, dx, dy); + + for (y = 0; y < sh; y++) { + BYTE *yls = sp + y * src->width; + BYTE *yld = dp + y * dst->width; + for (x = 0; x < sw; x++) { + int s = *yls, d = *yld; + *yld = (BYTE)(MIN(255, (s + d))); + yls++; yld++; + } + } + + return OK; +} diff --git a/modules/lib/graph_stretch.c b/modules/lib/graph_stretch.c new file mode 100644 index 0000000..1c37d55 --- /dev/null +++ b/modules/lib/graph_stretch.c @@ -0,0 +1,89 @@ +// 拡大・縮小 + +#include +#include + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +void gr_copy_stretch(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *src, int sx, int sy, int sw, int sh) { + float a1, a2, xd, yd; + int *row, *col; + int x, y; + BYTE *sp, *dp; + + if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) return; + if (!gr_clip_xywh(src, &sx, &sy, &sw, &sh)) return; + + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + a1 = (float)sw / (float)dw; + a2 = (float)sh / (float)dh; + + // src width と dst width が同じときに問題があるので+1 + row = g_new0(int, dw+1); + // 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる + // 可能性がある。 + col = g_new0(int, dh+1); + + for (yd = 0.0, y = 0; y < dh; y++) { + col[y] = yd; yd += a2; + } + + for (xd = 0.0, x = 0; x < dw; x++) { + row[x] = xd; xd += a1; + } + + switch(dst->depth) { + case 15: + case 16: + { + WORD *yls, *yld; + BYTE *_yls, *_yld; + + for (y = 0; y < dh; y++) { + yls = (WORD *)(sp + *(y + col) * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < dw; x++) { + *(yld + x) = *(yls + *(row + x)); + } + _yld = (BYTE *)yld; + while(*(col + y) == *(col + y + 1)) { + _yls = _yld; + _yld += dst->bytes_per_line; + memcpy(_yld, _yls, dw * 2); + y++; + } + } + break; + } + case 24: + case 32: + { + DWORD *yls, *yld; + BYTE *_yls, *_yld; + + for (y = 0; y < dh; y++) { + yls = (DWORD *)(sp + *(y + col) * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + for (x = 0; x < dw; x++) { + *(yld + x) = *(yls+ *(row + x)); + } + _yld = (BYTE *)yld; + while(*(col + y) == *(col + y + 1)) { + _yls = _yld; + _yld += dst->bytes_per_line; + memcpy(_yld, _yls, dw * 4); + y++; + } + } + break; + } + } + + g_free(row); + g_free(col); +} diff --git a/modules/lib/gre_blend.c b/modules/lib/gre_blend.c new file mode 100644 index 0000000..a7984a5 --- /dev/null +++ b/modules/lib/gre_blend.c @@ -0,0 +1,81 @@ +// dst の上に src をブレンド率 lv でブレンドしたものを write へ書き出し + +#include "config.h" + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gre_Blend(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv) { + BYTE *sp, *dp, *wp; + int x, y; + + wp = GETOFFSET_PIXEL(write, wx, wy); + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + switch(dst->depth) { + case 15: + { + WORD *yls, *yld, *ylw; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND15(*yls, *yld, lv); + yls++; yld++; ylw++; + } + } + break; + } + case 16: + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + int alpha = lv | lv << 8 | lv << 16 | lv << 24; + ablend16_ppd(wp, sp, dp, alpha, + width, height, + write->bytes_per_line, + src->bytes_per_line, + dst->bytes_per_line); +#endif + } else { + WORD *yls, *yld, *ylw; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND16(*yls, *yld, lv); + yls++; yld++; ylw++; + } + } + } + break; + case 24: + case 32: + { + DWORD *yls, *yld, *ylw; + + for (y = 0; y < height; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + ylw = (DWORD *)(wp + y * write->bytes_per_line); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND24(*yls, *yld, lv); + yls++; yld++; ylw++; + } + } + break; + } + } + + return OK; +} diff --git a/modules/lib/gre_blend_screen.c b/modules/lib/gre_blend_screen.c new file mode 100644 index 0000000..549ebd7 --- /dev/null +++ b/modules/lib/gre_blend_screen.c @@ -0,0 +1,71 @@ +// +#include "config.h" +#include + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gre_BlendScreen(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height) { + BYTE *sp, *dp, *wp; + int x, y; + + wp = GETOFFSET_PIXEL(write, wx, wy); + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + + switch(dst->depth) { + case 15: + { + WORD *yls, *yld, *ylw; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + + for (x = 0; x < width; x++) { + *ylw = SUTURADD15(*yls, *yld); + yls++; yld++; ylw++; + } + } + break; + } + case 16: + { + WORD *yls, *yld, *ylw; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + + for (x = 0; x < width; x++) { + *ylw = SUTURADD16(*yls, *yld); + yls++; yld++; ylw++; + } + } + break; + } + case 32: + case 24: + { + DWORD *yls, *yld, *ylw; + + for (y = 0; y < height; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + ylw = (DWORD *)(wp + y * write->bytes_per_line); + + for (x = 0; x < width; x++) { + *ylw = SUTURADD24(*yls, *yld); + yls++; yld++; ylw++; + } + } + break; + } + } + + return OK; +} diff --git a/modules/lib/gre_blend_useamap.c b/modules/lib/gre_blend_useamap.c new file mode 100644 index 0000000..1160d40 --- /dev/null +++ b/modules/lib/gre_blend_useamap.c @@ -0,0 +1,160 @@ +// dst の上に src をalphamapを参照しつつ、ブレンド率 lv でブレンド +// したものを write へ書き出し + +#include "config.h" + +#include "portab.h" +#include "surface.h" +#include "ngraph.h" +#include "ags.h" + +int gre_BlendUseAMap(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, surface_t *alpha, int ax, int ay, int lv) { + BYTE *sp, *dp, *wp, *ap; + int x, y; + + wp = GETOFFSET_PIXEL(write, wx, wy); + sp = GETOFFSET_PIXEL(src, sx, sy); + dp = GETOFFSET_PIXEL(dst, dx, dy); + ap = GETOFFSET_ALPHA(alpha, ax, ay); + + if (lv == 255) { + switch(dst->depth) { + case 15: + { + WORD *yls, *yld, *ylw; + BYTE *yla; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + yla = (BYTE *)(ap + y * alpha->width); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND15(*yls, *yld, *yla); + yls++; yld++; ylw++; yla++; + } + } + break; + } + case 16: + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + ablend16_ppp(wp, sp, dp, ap, + width, height, + write->bytes_per_line, + src->bytes_per_line, + dst->bytes_per_line, + alpha->width, 255); +#endif + } else { + WORD *yls, *yld, *ylw; + BYTE *yla; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + yla = (BYTE *)(ap + y * alpha->width); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND16(*yls, *yld, *yla); + yls++; yld++; ylw++; yla++; + } + } + } + break; + case 24: + case 32: + { + DWORD *yls, *yld, *ylw; + BYTE *yla; + + for (y = 0; y < height; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + ylw = (DWORD *)(wp + y * write->bytes_per_line); + yla = (BYTE *)(ap + y * alpha->width); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND24(*yls, *yld, *yla); + yls++; yld++; ylw++; yla++; + } + } + break; + } + } + + } else { + switch(dst->depth) { + case 15: + { + WORD *yls, *yld, *ylw; + BYTE *yla; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + yla = (BYTE *)(ap + y * alpha->width); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND15(*yls, *yld, (*yla * lv) / 255); + yls++; yld++; ylw++; yla++; + } + } + break; + } + case 16: + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + ablend16_ppp(wp, sp, dp, ap, + width, height, + write->bytes_per_line, + src->bytes_per_line, + dst->bytes_per_line, + alpha->width, lv); +#endif + } else { + WORD *yls, *yld, *ylw; + BYTE *yla; + + for (y = 0; y < height; y++) { + yls = (WORD *)(sp + y * src->bytes_per_line); + yld = (WORD *)(dp + y * dst->bytes_per_line); + ylw = (WORD *)(wp + y * write->bytes_per_line); + yla = (BYTE *)(ap + y * alpha->width); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND16(*yls, *yld, (*yla * lv) / 255); + yls++; yld++; ylw++; yla++; + } + } + } + break; + case 24: + case 32: + { + DWORD *yls, *yld, *ylw; + BYTE *yla; + + for (y = 0; y < height; y++) { + yls = (DWORD *)(sp + y * src->bytes_per_line); + yld = (DWORD *)(dp + y * dst->bytes_per_line); + ylw = (DWORD *)(wp + y * write->bytes_per_line); + yla = (BYTE *)(ap + y * alpha->width); + + for (x = 0; x < width; x++) { + *ylw = ALPHABLEND24(*yls, *yld, (*yla * lv) / 255); + yls++; yld++; ylw++; yla++; + } + } + break; + } + } + } + + return OK; +} diff --git a/modules/lib/ngraph.h b/modules/lib/ngraph.h new file mode 100644 index 0000000..d8d28a0 --- /dev/null +++ b/modules/lib/ngraph.h @@ -0,0 +1,90 @@ +#ifndef __NGRAPH_H__ +#define __NGRAPH_H__ + +#include "portab.h" +#include "nact.h" +#include "ags.h" +#include "surface.h" + +#define sf0 nact->ags.dib + +// DLL 用 graphic 関連関数 + +/* in graph.c */ +extern boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds, int *dx, int *dy); +extern boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh); + + +/* in graph_expandcolor_blend.c */ +// 8bppのモノクロをcolでブレンド +extern int gr_expandcolor_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int r, int g, int b); + +/* in graph_fillrect.c */ +extern int gr_fill(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b); + +/* in graph_fillrect_amap.c */ +extern int gr_fill_alpha_map(surface_t *dst, int dx, int dy, int dw, int dh, int lv); + +/* in graph_fillrect_acolor.c */ +extern int gr_fill_alpha_color(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b, int lv); + +/* in graph_rect.c */ +// 矩形枠描画 +extern int gr_drawrect(surface_t *dst, int x, int y, int w, int h, int r, int g, int b); + +/* in graph_copy.c */ +extern int gr_copy(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh); + +/* in graph_copy_bright.c */ +void gr_copy_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv); + +/* in graph_copy_amap.c */ +extern int gr_copy_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh); + +/* in graph_blend_amap.c */ +extern int gr_blend_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh); + +/* in graph_saturadd_amap.c */ +// alpha map の飽和加算 +extern int gr_saturadd_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh); + +/* in graph_draw_amap.c */ +extern int gr_draw_amap(surface_t *dst, int dx, int dy, BYTE *src, int width, int height, int scanline); + +// /* in graph_bright_dst_only.c */ +#define gr_bright_dst_only(dst,dx,dy,w,h,lv) gr_copy_bright(dst,dx,dy,dst,dx,dy,w,h,lv) +// extern void gr_bright_dst_only(surface_t *dst, int dx, int dy, int w, int h, int lv); + +/* in gre_blend_useamap.c */ +extern int gre_BlendUseAMap(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, surface_t *alpha, int ax, int ay, int lv); + +/* in gre_blend.c */ +extern int gre_Blend(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv); + +/* in gre_blend_screen.c */ +extern int gre_BlendScreen(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height); + +/* in graph_buller */ +extern int gr_buller(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int step); +extern int gr_buller_v(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int step); + +/* in graph_stretch.c */ +extern void gr_copy_stretch(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *src, int sx, int sy, int sw, int sh); + +/* in graph_copy_whiteout.c */ +extern void gr_copy_whiteout(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int lv); + + +/* in graph_cg.c */ +extern void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y); +extern void gr_drawimage16(surface_t *ds, cgdata *cg, int x, int y); + + + + +/* defined in cg.c */ +extern surface_t *sf_getcg(void *buf); +extern surface_t *sf_loadcg_no(int no); + + +#endif /* __GRAPH_H__ */ diff --git a/modules/lib/surface.c b/modules/lib/surface.c new file mode 100644 index 0000000..3436d41 --- /dev/null +++ b/modules/lib/surface.c @@ -0,0 +1,191 @@ +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "surface.h" +#include "system.h" + +static surface_t *create(int width, int height, int depth, boolean has_pixel, boolean has_alpha) { + surface_t *s = g_new0(surface_t, 1); + + s->width = width; + s->height = height; + s->has_alpha = has_alpha; + s->has_pixel = has_pixel; + + s->bytes_per_line = width; + s->bytes_per_pixel = 1; + s->depth = depth; + + if (s->has_pixel) { + switch (s->depth) { + case 8: + s->pixel = g_new0(BYTE, width * (height +1)); + s->bytes_per_line = width; + s->bytes_per_pixel = 1; + break; + case 15: + case 16: + s->pixel = g_new0(BYTE, width * (height +1) * 2); + s->bytes_per_line = width * 2; + s->bytes_per_pixel = 2; + break; + case 24: + case 32: + s->pixel = g_new0(BYTE, width * (height +1) * 4); + s->bytes_per_line = width * 4; + s->bytes_per_pixel = 4; + break; + default: + WARNING("depth %d is not supported\n", s->depth); + } + } else { + s->pixel = NULL; + } + + if (s->has_alpha) { + s->alpha = g_new0(BYTE, width * (height +1)); + } + + return s; +} + +/** + * surfaceの生成 (pixel + alpha) + * @param width: surfaceの幅 + * @param height: surfaceの高さ + * @param depth: surfaceのpixelのBPP (8|15|16|24|32), alphaは8固定 + * @return 生成した surface オブジェクト + */ +surface_t *sf_create_surface(int width, int height, int depth) { + return create(width, height, depth, TRUE, TRUE); +} + +/** + * surfaceの生成 (alphaのみ) + * @param width: surfaceの幅 + * @param height: surfaceの高さ + * @return 生成した surface オブジェクト + */ +surface_t *sf_create_alpha(int width, int height) { + return create(width, height, 8, FALSE, TRUE); +} + +/** + * surfaceの生成 (pixelのみ) + * @param width: surfaceの幅 + * @param height: surfaceの高さ + * @param depth: surfaceのBPP(8|15|16|24|32) + * @return 生成した surface オブジェクト + */ +surface_t *sf_create_pixel(int width, int height, int depth) { + return create(width, height, depth, TRUE, FALSE); +} + +/** + * surfaceオブジェクトの開放 + * @param s: 開放するオブジェクト + * @return: なし + */ +void sf_free(surface_t *s) { + if (s == NULL) return; + if (s->pixel) g_free(s->pixel); + if (s->alpha) g_free(s->alpha); + g_free(s); +} + +/** + * surface の複製を作成(dupulicate) + * @param in: 複製もと + * @return : 複製したsurface + */ +surface_t *sf_dup(surface_t *in) { + surface_t *sf; + int len; + + if (in == NULL) return NULL; + + sf = g_new(surface_t, 1); + memcpy(sf, in, sizeof(surface_t)); + + if (in->has_pixel) { + len = sf->bytes_per_line * sf->height; + sf->pixel = g_new(BYTE, len + sf->bytes_per_line); + memcpy(sf->pixel, in->pixel, len); + } + + if (in->has_alpha) { + len = sf->width * sf->height; + sf->alpha = g_new(BYTE, len + sf->width); + memcpy(sf->alpha, in->alpha, len); + } + + return sf; +} + +/** + * surface全体のコピー + * @param dst: コピー先 surface + * @param src: コピー元 surface + * @return なし + */ +void sf_copyall(surface_t *dst, surface_t *src) { + int len; + + if (src == NULL || dst == NULL) return; + + if (src->width != dst->width) return; + + if (src->height != dst->height) return; + + if (src->bytes_per_pixel != dst->bytes_per_pixel) return; + + if (src->has_alpha && dst->has_alpha) { + len = src->width * src->height; + memcpy(dst->alpha, src->alpha, len); + } + + if (src->has_pixel && dst->has_pixel) { + len = src->bytes_per_line * src->height; + memcpy(dst->pixel, src->pixel, len); + } +} + +/** + * surface の複製 + * @param in: 複製もと + * @param copypixel: pixelをコピーするか + * @param copyalpha: alpha pixel をコピーするか + * @return: 複製した surface + */ +surface_t *sf_dup2(surface_t *in, boolean copypixel, boolean copyalpha) { + surface_t *sf; + int len; + + if (in == NULL) return NULL; + + sf = g_new(surface_t, 1); + memcpy(sf, in, sizeof(surface_t)); + + if (in->has_pixel) { + len = sf->bytes_per_line * sf->height; + sf->pixel = g_new(BYTE, len + sf->bytes_per_line); + if (copypixel) { + memcpy(sf->pixel, in->pixel, len); + } + } + + if (in->has_alpha) { + len = sf->width * sf->height; + sf->alpha = g_new(BYTE, len + sf->width); + if (copyalpha) { + memcpy(sf->alpha, in->alpha, len); + } + } + + return sf; +} + diff --git a/modules/lib/surface.h b/modules/lib/surface.h new file mode 100644 index 0000000..e699faa --- /dev/null +++ b/modules/lib/surface.h @@ -0,0 +1,18 @@ +#ifndef __SURFACE_H__ +#define __SURFACE_H__ + +#include "portab.h" +#include "ags.h" + +#define surface_t agsurface_t + +extern surface_t *sf_create_surface(int width, int height, int depth); +extern surface_t *sf_create_alpha(int width, int height); +extern surface_t *sf_create_pixel(int width, int height, int depth); +extern void sf_free(surface_t *s); +extern surface_t *sf_dup(surface_t *in); +extern surface_t *sf_dup2(surface_t *in, boolean copypixel, boolean copyalpha); +extern void sf_copyall(surface_t *dst, surface_t *src); + + +#endif /* __SURFACE_H__ */ diff --git a/modules/nDEMO/Makefile.am b/modules/nDEMO/Makefile.am new file mode 100644 index 0000000..527769c --- /dev/null +++ b/modules/nDEMO/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = nDEMO.la + +nDEMO_la_LDFLAGS = -module -export-dynamic -avoid-version +nDEMO_la_SOURCES = nDEMO.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/nDEMO -I$(top_srcdir)/modules/nDEMO diff --git a/modules/nDEMO/Makefile.in b/modules/nDEMO/Makefile.in new file mode 100644 index 0000000..eac452a --- /dev/null +++ b/modules/nDEMO/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/nDEMO +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +nDEMO_la_LIBADD = +am_nDEMO_la_OBJECTS = nDEMO.lo +nDEMO_la_OBJECTS = $(am_nDEMO_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(nDEMO_la_SOURCES) +DIST_SOURCES = $(nDEMO_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = nDEMO.la +nDEMO_la_LDFLAGS = -module -export-dynamic -avoid-version +nDEMO_la_SOURCES = nDEMO.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/nDEMO -I$(top_srcdir)/modules/nDEMO + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/nDEMO/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/nDEMO/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +nDEMO.la: $(nDEMO_la_OBJECTS) $(nDEMO_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(nDEMO_la_LDFLAGS) $(nDEMO_la_OBJECTS) $(nDEMO_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nDEMO.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/nDEMO/nDEMO.c b/modules/nDEMO/nDEMO.c new file mode 100644 index 0000000..862b0cf --- /dev/null +++ b/modules/nDEMO/nDEMO.c @@ -0,0 +1,36 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + +void Init() { + int p1 = getCaliValue(); /* ISys3x */ + int p2 = getCaliValue(); /* IWinMsg */ + int p3 = getCaliValue(); /* ITimer */ + int *var = getCaliVariable(); + + *var = 0; + + DEBUG_COMMAND_YET("nDEMO.Init %p:\n", var); +} + +void SetKeyCancelFlag() { + int p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("nDEMO.SetKeyCancelFlag %d:\n", p1); +} + +void SetLoopFlag() { + int p1 = getCaliVariable(); + + DEBUG_COMMAND_YET("nDEMO.SetLoopFlag %d:\n", p1); +} + +void Run() { + DEBUG_COMMAND_YET("nDEMO.Run:\n"); +} + diff --git a/modules/nDEMOE/Makefile.am b/modules/nDEMOE/Makefile.am new file mode 100644 index 0000000..d90b454 --- /dev/null +++ b/modules/nDEMOE/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = nDEMOE.la + +nDEMOE_la_LDFLAGS = -module -export-dynamic -avoid-version +nDEMOE_la_SOURCES = nDEMOE.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/nDEMOE -I$(top_srcdir)/modules/nDEMOE diff --git a/modules/nDEMOE/Makefile.in b/modules/nDEMOE/Makefile.in new file mode 100644 index 0000000..674be8a --- /dev/null +++ b/modules/nDEMOE/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/nDEMOE +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +nDEMOE_la_LIBADD = +am_nDEMOE_la_OBJECTS = nDEMOE.lo +nDEMOE_la_OBJECTS = $(am_nDEMOE_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(nDEMOE_la_SOURCES) +DIST_SOURCES = $(nDEMOE_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = nDEMOE.la +nDEMOE_la_LDFLAGS = -module -export-dynamic -avoid-version +nDEMOE_la_SOURCES = nDEMOE.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/nDEMOE -I$(top_srcdir)/modules/nDEMOE + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/nDEMOE/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/nDEMOE/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +nDEMOE.la: $(nDEMOE_la_OBJECTS) $(nDEMOE_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(nDEMOE_la_LDFLAGS) $(nDEMOE_la_OBJECTS) $(nDEMOE_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nDEMOE.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/nDEMOE/nDEMOE.c b/modules/nDEMOE/nDEMOE.c new file mode 100644 index 0000000..8edcd46 --- /dev/null +++ b/modules/nDEMOE/nDEMOE.c @@ -0,0 +1,28 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + +void Init() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int *var = getCaliVariable(); + + DEBUG_COMMAND_YET("nDEMOE.Init %p:\n", var); +} + +void SetKeyCancelFlag() { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("nDEMOE.SetKeyCancelFlag %d:\n", p1); +} + +void Run() { + DEBUG_COMMAND_YET("nDEMOE.Run:\n"); +} + diff --git a/modules/oDEMO/Makefile.am b/modules/oDEMO/Makefile.am new file mode 100644 index 0000000..5470ead --- /dev/null +++ b/modules/oDEMO/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = oDEMO.la + +oDEMO_la_LDFLAGS = -module -export-dynamic -avoid-version +oDEMO_la_SOURCES = oDEMO.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/oDEMO -I$(top_srcdir)/modules/oDEMO diff --git a/modules/oDEMO/Makefile.in b/modules/oDEMO/Makefile.in new file mode 100644 index 0000000..104b332 --- /dev/null +++ b/modules/oDEMO/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/oDEMO +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +oDEMO_la_LIBADD = +am_oDEMO_la_OBJECTS = oDEMO.lo +oDEMO_la_OBJECTS = $(am_oDEMO_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(oDEMO_la_SOURCES) +DIST_SOURCES = $(oDEMO_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = oDEMO.la +oDEMO_la_LDFLAGS = -module -export-dynamic -avoid-version +oDEMO_la_SOURCES = oDEMO.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/oDEMO -I$(top_srcdir)/modules/oDEMO + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/oDEMO/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/oDEMO/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +oDEMO.la: $(oDEMO_la_OBJECTS) $(oDEMO_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(oDEMO_la_LDFLAGS) $(oDEMO_la_OBJECTS) $(oDEMO_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oDEMO.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/oDEMO/oDEMO.c b/modules/oDEMO/oDEMO.c new file mode 100644 index 0000000..0a256f0 --- /dev/null +++ b/modules/oDEMO/oDEMO.c @@ -0,0 +1,37 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + + +void Init() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("oDEMO.Init %d,%d,%d,%p:\n", p1, p2, p3, var); +} + +void SetKeyCancelFlag() { + int cancelflag = getCaliValue(); + + DEBUG_COMMAND_YET("oDEMO.SetKeyCancelFlag %d:\n", cancelflag); +} + +void SetLoopFlag() { + /* Loop Flag */ + int loopflag = getCaliValue(); /* 0 なら無限繰り返し */ + + DEBUG_COMMAND_YET("oDEMO.SetLoopFlag %d:\n", loopflag); +} + +void Run() { + DEBUG_COMMAND_YET("oDEMO.Run:\n"); +} diff --git a/modules/oujimisc/Makefile.am b/modules/oujimisc/Makefile.am new file mode 100644 index 0000000..4ca4df2 --- /dev/null +++ b/modules/oujimisc/Makefile.am @@ -0,0 +1,11 @@ +pkglib_LTLIBRARIES = oujimisc.la + +oujimisc_la_LDFLAGS = -module -export-dynamic -avoid-version +oujimisc_la_SOURCES = oujimisc.c + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/oujimisc -I$(top_srcdir)/modules/oujimisc diff --git a/modules/oujimisc/Makefile.in b/modules/oujimisc/Makefile.in new file mode 100644 index 0000000..80aee77 --- /dev/null +++ b/modules/oujimisc/Makefile.in @@ -0,0 +1,557 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/oujimisc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +oujimisc_la_LIBADD = +am_oujimisc_la_OBJECTS = oujimisc.lo +oujimisc_la_OBJECTS = $(am_oujimisc_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(oujimisc_la_SOURCES) +DIST_SOURCES = $(oujimisc_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = oujimisc.la +oujimisc_la_LDFLAGS = -module -export-dynamic -avoid-version +oujimisc_la_SOURCES = oujimisc.c +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/oujimisc -I$(top_srcdir)/modules/oujimisc + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/oujimisc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/oujimisc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +oujimisc.la: $(oujimisc_la_OBJECTS) $(oujimisc_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(oujimisc_la_LDFLAGS) $(oujimisc_la_OBJECTS) $(oujimisc_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oujimisc.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/oujimisc/oujimisc.c b/modules/oujimisc/oujimisc.c new file mode 100644 index 0000000..14d7699 --- /dev/null +++ b/modules/oujimisc/oujimisc.c @@ -0,0 +1,116 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + +void MakeMapSetParam() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.MakeMapSetParam %d,%d,%d,%d:\n", p1,p2,p3,p4); +} + +void MakeMapSetChipParam() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.MakeMapSeChipParam %d,%d,%d,%d,%d:\n", p1,p2,p3,p4,p5); + +} + +void MakeMapDraw() { + int p1 = getCaliValue(); /* ISys3xDIB */ + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int *p6 = getCaliVariable(); + int *p7 = getCaliVariable(); + int *p8 = getCaliVariable(); + + DEBUG_COMMAND_YET("oujimisc.MakeMapDraw %d,%d,%d,%d,%d,%p,%p,%p:\n", p1,p2,p3,p4,p5,p6,p7,p8); +} + +void MakeMapInit() { + int p1 = getCaliValue(); /* ISys3x */ + + DEBUG_COMMAND_YET("oujimisc.MakeMapInit %d:\n", p1); +} + +void DrawNumber() { + int p1 = getCaliValue(); /* ISys3xDIB */ + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int p7 = getCaliValue(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.DrawNumber %d,%d,%d,%d,%d,%d,%d,%d:\n", p1,p2,p3,p4,p5,p6,p7,p8); +} + +void TempMapCreateShadow() { + DEBUG_COMMAND_YET("oujimisc.TempMapCreateShadow:\n"); +} + +void TempMapInit() { + int p1 = getCaliValue(); /* ISys3x */ + int p2 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.TempMapInit %d,%d:\n", p1,p2); +} + +void TempMapLoadToShadow() { + int p1 = getCaliValue(); + int *p2 = getCaliVariable(); + int *p3 = getCaliVariable(); + int *p4 = getCaliVariable(); + int p5 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.TempMapLoadToShadow %d,%p,%p,%p,%d:\n", p1,p2,p3,p4,p5); +} + +void TempMapSaveToShadow() { + int p1 = getCaliValue(); + int *p2 = getCaliVariable(); + int *p3 = getCaliVariable(); + int *p4 = getCaliVariable(); + int p5 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.TempMapSaveToShadow %d,%p,%p,%p,%d:\n", p1,p2,p3,p4,p5); +} + +void TempMapFileSave() { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.TempMapFileSave %d:\n", p1); +} + +void TempMapFileLoad() { + int p1 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.TempMapFileLoad %d:\n", p1); +} + +void CalcMoveDiffer() { + int *p1 = getCaliVariable(); + int *p2 = getCaliVariable(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + int p5 = getCaliValue(); + int p6 = getCaliValue(); + int *p7 = getCaliVariable(); + int p8 = getCaliValue(); + + DEBUG_COMMAND_YET("oujimisc.CalcMoveDiffer %p,%p,%d,%d,%d,%d,%p,%d:\n", p1,p2,p3,p4,p5,p6,p7,p8); +} diff --git a/modules/tDemo/Makefile.am b/modules/tDemo/Makefile.am new file mode 100644 index 0000000..06b0544 --- /dev/null +++ b/modules/tDemo/Makefile.am @@ -0,0 +1,13 @@ +pkglib_LTLIBRARIES = tDemo.la + +tDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +tDemo_la_SOURCES = tDemo.c +tDemo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la + +AM_CFLAGS = @DEBUG_CFLAGS@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/tDemo -I$(top_srcdir)/modules/tDemo diff --git a/modules/tDemo/Makefile.in b/modules/tDemo/Makefile.in new file mode 100644 index 0000000..b2b8b8e --- /dev/null +++ b/modules/tDemo/Makefile.in @@ -0,0 +1,559 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = modules/tDemo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +tDemo_la_DEPENDENCIES = ../lib/libgraph.la ../lib/libalk.la +am_tDemo_la_OBJECTS = tDemo.lo +tDemo_la_OBJECTS = $(am_tDemo_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(tDemo_la_SOURCES) +DIST_SOURCES = $(tDemo_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkglib_LTLIBRARIES = tDemo.la +tDemo_la_LDFLAGS = -module -export-dynamic -avoid-version +tDemo_la_SOURCES = tDemo.c +tDemo_la_LIBADD = ../lib/libgraph.la ../lib/libalk.la +AM_CFLAGS = @DEBUG_CFLAGS@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_builddir)/modules/lib -I$(top_srcdir)/modules/lib \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/modules/tDemo -I$(top_srcdir)/modules/tDemo + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/tDemo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/tDemo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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 +tDemo.la: $(tDemo_la_OBJECTS) $(tDemo_la_DEPENDENCIES) + $(LINK) -rpath $(pkglibdir) $(tDemo_la_LDFLAGS) $(tDemo_la_OBJECTS) $(tDemo_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tDemo.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-pkglibLTLIBRARIES 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 \ + uninstall-pkglibLTLIBRARIES + +# 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/modules/tDemo/tDemo.c b/modules/tDemo/tDemo.c new file mode 100644 index 0000000..19b1c38 --- /dev/null +++ b/modules/tDemo/tDemo.c @@ -0,0 +1,37 @@ +#include "config.h" + +#include + +#include "portab.h" +#include "system.h" +#include "xsystem35.h" +#include "nact.h" + +void Init() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int *var = getCaliVariable(); + + *var = 1; + + DEBUG_COMMAND_YET("tDemo.Init %d,%d,%d,%p:\n", p1, p2, p3, var); +} + +void SetKeyCancelFlag() { + int cancelflag = getCaliValue(); + + DEBUG_COMMAND_YET("tDemo.SetKeyCancelFlag %d:\n", cancelflag); +} + +void SetLoopFlag() { + /* Loop Flag */ + int loopflag = getCaliValue(); /* 0 なら無限繰り返し */ + + DEBUG_COMMAND_YET("tDemo.SetLoopFlag %d:\n", loopflag); +} + +void Run() { + DEBUG_COMMAND_YET("tDemo.Run:\n"); +} + diff --git a/patch/README.TXT b/patch/README.TXT new file mode 100644 index 0000000..e15545e --- /dev/null +++ b/patch/README.TXT @@ -0,0 +1,38 @@ + +README.TXT : このファイル +pastel.diff: ぱすてるチャイム用シナリオパッチスクリプト + + + +pastel.diff の説明 + +ぱすてるチャイムでは明らかにシナリオにおかしいところがあります。 +Windows版ではなぜか問題なく動くのですが、xsystem35 では異常終了 +してしまいます。そこで、シナリオデータにパッチを当てることで +対応します。 + +pastel.diff をゲームのシナリオデータのあるディレクトリにコピーして +そのディレクトリに移動した後、 ./pastel.diff (シナリオファイル名) と +実行してください。 +(例) + > ./pastel.diff pastel_sa.ald + +古いデータは pastel_sa.ald.org として保存されます。 +シナリオデータは Ver 1.00 と Ver 1.01 に適用できます。 + +問題の箇所は FF_HENSU.ADV 中の + + DF var563[0],1000,0: + DC 7,20,0: + !var601:0! + !var602:0! + !var603:0! +->> DS var601,var602,0,20: + +の部分で、正しくは + + DS var601,var602,0,7: + +とならなければならないはずです。page 20 はまだアロケート(DC)されて +いないため、エラーとなります。この書き換えをスクリプトによって行っています。 + diff --git a/patch/pastel.diff b/patch/pastel.diff new file mode 100755 index 0000000..8cb9fe8 --- /dev/null +++ b/patch/pastel.diff @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "pascha.diff targetfile" + exit 1 +fi + +if [ ! -f "$1" ]; then + echo "$1 not found" + exit 1 +fi +cp $1 $1.org +chmod u+w $1 +echo 'G' | dd of=$1 ibs=1 obs=1 count=1 seek=7272 conv=notrunc +chmod u-w $1 +echo "done!" +exit 0 diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..bef7f4a --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1 @@ +ja diff --git a/po/Makefile.in.in b/po/Makefile.in.in new file mode 100644 index 0000000..ada8bb4 --- /dev/null +++ b/po/Makefile.in.in @@ -0,0 +1,317 @@ +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License but which still want to provide support for the GNU gettext +# functionality. +# Please note that the actual code of GNU gettext is covered by the GNU +# General Public License and is *not* in the public domain. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = @datadir@ +localedir = $(datadir)/locale +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` + +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + +POTFILES = \ + +CATALOGS = @CATALOGS@ + +# Makevars gets inserted here. (Don't remove this line!) + +.SUFFIXES: +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all: all-@USE_NLS@ + +all-yes: $(CATALOGS) +all-no: + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common); do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +install-data-no: all +install-data-yes: all + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext"; then \ + for file in $(DISTFILES.common); do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +check: all + +dvi info tags TAGS ID: + +mostlyclean: + rm -f remove-potcdate.sed + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + $(MAKE) update-po + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: $(DISTFILES) + dists="$(DISTFILES)"; \ + if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir); \ + else \ + cp -p $(srcdir)/$$file $(distdir); \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +force: + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 0000000..d69ddf8 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,41 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Masaki Chikama + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = chikama@nabal.aist-nara.ac.jp + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..e995d2e --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,5 @@ +./src/menu.c +./src/menu_gui.c +./src/menu_gui_volval.c +./src/s39init.c + diff --git a/po/ja.gmo b/po/ja.gmo new file mode 100644 index 0000000..16a6c61 Binary files /dev/null and b/po/ja.gmo differ diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 0000000..3201c54 --- /dev/null +++ b/po/ja.po @@ -0,0 +1,142 @@ +# xsystem35 +# Copyright (C) 2001 Free Software Foundation, Inc. +# CHIKAMA Masaki , 2001-2004 +# CHIKAMA Masaki , 2004. +# +#: src/menu_gui.c:207 +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: xsystem35 1.7.3pre3\n" +"Report-Msgid-Bugs-To: chika@8ne.sakura.ne.jp\n" +"POT-Creation-Date: 2004-08-24 23:32+0900\n" +"PO-Revision-Date: 2004-08-24 14:40+0900\n" +"Last-Translator: CHIKAMA Masaki \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=euc-jp\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/menu.c:89 +#, c-format +msgid "MAX %d charater" +msgstr "最大 %d 文字" + +#: src/menu_gui.c:81 +msgid "InputNumber" +msgstr "数値入力" + +#: src/menu_gui.c:122 src/menu_gui.c:830 +msgid "default" +msgstr "既定値" + +#: src/menu_gui.c:132 +msgid "min" +msgstr "最小値" + +#: src/menu_gui.c:142 +msgid "max" +msgstr "最大値" + +#: src/menu_gui.c:193 src/menu_gui.c:306 src/menu_gui.c:473 src/menu_gui.c:866 +msgid "OK" +msgstr "OK" + +#: src/menu_gui.c:200 src/menu_gui.c:299 +msgid "Cancel" +msgstr "キャンセル" + +#: src/menu_gui.c:247 +msgid "InputString" +msgstr "文字列入力" + +#: src/menu_gui.c:258 +msgid "title" +msgstr "タイトル" + +#: src/menu_gui.c:274 +msgid "MAX charater" +msgstr "最大文字数" + +#: src/menu_gui.c:283 +msgid "Notice) HANKAKU is not available" +msgstr "註)全角文字のみ有効" + +#: src/menu_gui.c:343 src/menu_gui.c:758 +msgid "Exit" +msgstr "終了" + +#: src/menu_gui.c:358 +msgid "Exit System35 ?" +msgstr "System35を終了しますか?" + +#: src/menu_gui.c:372 +msgid "Yes" +msgstr "はい" + +#: src/menu_gui.c:379 +msgid "No" +msgstr "いいえ" + +#: src/menu_gui.c:415 src/menu_gui.c:743 +msgid "About" +msgstr "情報" + +#: src/menu_gui.c:441 +msgid "Information1" +msgstr "情報1" + +#: src/menu_gui.c:453 +msgid "Information2" +msgstr "情報2" + +#: src/menu_gui.c:465 +msgid "Information3" +msgstr "情報3" + +#: src/menu_gui.c:540 +msgid "MessageSkip" +msgstr "メッセージスキップ" + +#: src/menu_gui.c:558 src/menu_gui.c:600 src/menu_gui.c:650 src/menu_gui.c:684 +#: src/menu_gui.c:718 +msgid "ON" +msgstr "有効" + +#: src/menu_gui.c:566 src/menu_gui.c:608 src/menu_gui.c:658 src/menu_gui.c:692 +#: src/menu_gui.c:726 +msgid "OFF" +msgstr "無効" + +#: src/menu_gui.c:582 +msgid "MouseAutoMove" +msgstr "マウスカーソル移動" + +#: src/menu_gui.c:624 src/menu_gui_volval.c:43 +msgid "VolumeValance" +msgstr "ボリュームバランス" + +#: src/menu_gui.c:632 +msgid "PCM-audio" +msgstr "PCMオーディオ" + +#: src/menu_gui.c:666 +msgid "CDROM-audio" +msgstr "CDROMオーディオ" + +#: src/menu_gui.c:700 +msgid "MIDI-audio" +msgstr "MIDIオーディオ" + +#: src/menu_gui_volval.c:89 +msgid "mute" +msgstr "ミュート" + +#: src/menu_gui_volval.c:114 +msgid "small" +msgstr "小" + +#: src/menu_gui_volval.c:122 +msgid "large" +msgstr "大" + diff --git a/po/xsystem35.pot b/po/xsystem35.pot new file mode 100644 index 0000000..5973401 --- /dev/null +++ b/po/xsystem35.pot @@ -0,0 +1,505 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#: src/menu_gui.c:207 +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-08-24 23:32+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/menu.c:89 +#, c-format +msgid "MAX %d charater" +msgstr "" + +#: src/menu.c:143 src/menu.c:145 src/menu.c:147 +#, c-format +msgid "%d " +msgstr "" + +#: src/menu_gui.c:80 src/menu_gui_volval.c:39 src/menu_gui_volval.c:41 +msgid "window1" +msgstr "" + +#: src/menu_gui.c:81 +msgid "InputNumber" +msgstr "" + +#: src/menu_gui.c:87 src/menu_gui_volval.c:107 +msgid "hbox1" +msgstr "" + +#: src/menu_gui.c:94 +msgid "vbox1" +msgstr "" + +#: src/menu_gui.c:108 +msgid "spinbutton1" +msgstr "" + +#: src/menu_gui.c:115 +msgid "table1" +msgstr "" + +#: src/menu_gui.c:122 src/menu_gui.c:830 +msgid "default" +msgstr "" + +#: src/menu_gui.c:124 +msgid "label3" +msgstr "" + +#: src/menu_gui.c:132 +msgid "min" +msgstr "" + +#: src/menu_gui.c:134 +msgid "label9" +msgstr "" + +#: src/menu_gui.c:142 +msgid "max" +msgstr "" + +#: src/menu_gui.c:144 +msgid "label10" +msgstr "" + +#: src/menu_gui.c:152 src/menu_gui.c:162 src/menu_gui.c:172 +msgid "0" +msgstr "" + +#: src/menu_gui.c:154 +msgid "label11" +msgstr "" + +#: src/menu_gui.c:164 +msgid "label12" +msgstr "" + +#: src/menu_gui.c:174 +msgid "label13" +msgstr "" + +#: src/menu_gui.c:184 +msgid "vbox2" +msgstr "" + +#: src/menu_gui.c:193 src/menu_gui.c:306 src/menu_gui.c:473 src/menu_gui.c:866 +msgid "OK" +msgstr "" + +#: src/menu_gui.c:195 +msgid "button1" +msgstr "" + +#: src/menu_gui.c:200 src/menu_gui.c:299 +msgid "Cancel" +msgstr "" + +#: src/menu_gui.c:202 +msgid "button2" +msgstr "" + +#: src/menu_gui.c:209 +msgid "label4" +msgstr "" + +#: src/menu_gui.c:214 src/menu_gui.c:319 src/menu_gui.c:774 src/menu_gui.c:777 +#: src/menu_gui.c:780 src/menu_gui.c:784 src/menu_gui.c:787 src/menu_gui.c:790 +#: src/menu_gui.c:793 src/menu_gui.c:796 src/menu_gui.c:799 src/menu_gui.c:803 +#: src/menu_gui.c:806 src/menu_gui.c:832 +msgid "activate" +msgstr "" + +#: src/menu_gui.c:217 src/menu_gui.c:220 src/menu_gui.c:313 src/menu_gui.c:316 +#: src/menu_gui.c:389 src/menu_gui.c:392 src/menu_gui.c:482 src/menu_gui.c:873 +msgid "clicked" +msgstr "" + +#: src/menu_gui.c:241 +msgid "window2" +msgstr "" + +#: src/menu_gui.c:247 +msgid "InputString" +msgstr "" + +#: src/menu_gui.c:253 +msgid "vbox3" +msgstr "" + +#: src/menu_gui.c:258 +msgid "title" +msgstr "" + +#: src/menu_gui.c:260 +msgid "label5" +msgstr "" + +#: src/menu_gui.c:269 +msgid "entry1" +msgstr "" + +#: src/menu_gui.c:274 +msgid "MAX charater" +msgstr "" + +#: src/menu_gui.c:276 src/menu_gui_volval.c:116 +msgid "label6" +msgstr "" + +#: src/menu_gui.c:283 +msgid "Notice) HANKAKU is not available" +msgstr "" + +#: src/menu_gui.c:285 src/menu_gui_volval.c:124 +msgid "label7" +msgstr "" + +#: src/menu_gui.c:294 +msgid "hbox2" +msgstr "" + +#: src/menu_gui.c:301 +msgid "button4" +msgstr "" + +#: src/menu_gui.c:308 +msgid "button3" +msgstr "" + +#: src/menu_gui.c:337 +msgid "window3" +msgstr "" + +#: src/menu_gui.c:343 src/menu_gui.c:758 +msgid "Exit" +msgstr "" + +#: src/menu_gui.c:349 +msgid "vbox4" +msgstr "" + +#: src/menu_gui.c:358 +msgid "Exit System35 ?" +msgstr "" + +#: src/menu_gui.c:360 +msgid "label8" +msgstr "" + +#: src/menu_gui.c:367 +msgid "hbox3" +msgstr "" + +#: src/menu_gui.c:372 +msgid "Yes" +msgstr "" + +#: src/menu_gui.c:374 +msgid "button5" +msgstr "" + +#: src/menu_gui.c:379 +msgid "No" +msgstr "" + +#: src/menu_gui.c:381 +msgid "button6" +msgstr "" + +#: src/menu_gui.c:386 +msgid "destroy" +msgstr "" + +#: src/menu_gui.c:414 +msgid "window4" +msgstr "" + +#: src/menu_gui.c:415 src/menu_gui.c:743 +msgid "About" +msgstr "" + +#: src/menu_gui.c:420 +msgid "fixed1" +msgstr "" + +#: src/menu_gui.c:427 +msgid "notebook1" +msgstr "" + +#: src/menu_gui.c:434 +msgid "" +"System 3.5 scenario decoder\n" +"for X\n" +"Version " +msgstr "" + +#: src/menu_gui.c:434 +msgid " [proj. RainyMoon]" +msgstr "" + +#: src/menu_gui.c:436 +msgid "label26" +msgstr "" + +#: src/menu_gui.c:441 +msgid "Information1" +msgstr "" + +#: src/menu_gui.c:443 +msgid "label23" +msgstr "" + +#: src/menu_gui.c:453 +msgid "Information2" +msgstr "" + +#: src/menu_gui.c:455 +msgid "label24" +msgstr "" + +#: src/menu_gui.c:465 +msgid "Information3" +msgstr "" + +#: src/menu_gui.c:467 +msgid "label25" +msgstr "" + +#: src/menu_gui.c:475 +msgid "button11" +msgstr "" + +#: src/menu_gui.c:533 +msgid "menu1" +msgstr "" + +#: src/menu_gui.c:540 +msgid "MessageSkip" +msgstr "" + +#: src/menu_gui.c:542 +msgid "item1" +msgstr "" + +#: src/menu_gui.c:549 +msgid "item1_menu" +msgstr "" + +#: src/menu_gui.c:558 src/menu_gui.c:600 src/menu_gui.c:650 src/menu_gui.c:684 +#: src/menu_gui.c:718 +msgid "ON" +msgstr "" + +#: src/menu_gui.c:561 +msgid "item2" +msgstr "" + +#: src/menu_gui.c:566 src/menu_gui.c:608 src/menu_gui.c:658 src/menu_gui.c:692 +#: src/menu_gui.c:726 +msgid "OFF" +msgstr "" + +#: src/menu_gui.c:569 +msgid "item3" +msgstr "" + +#: src/menu_gui.c:576 +msgid "__________1" +msgstr "" + +#: src/menu_gui.c:582 +msgid "MouseAutoMove" +msgstr "" + +#: src/menu_gui.c:584 +msgid "item4" +msgstr "" + +#: src/menu_gui.c:591 +msgid "item4_menu" +msgstr "" + +#: src/menu_gui.c:603 +msgid "item5" +msgstr "" + +#: src/menu_gui.c:611 +msgid "item6" +msgstr "" + +#: src/menu_gui.c:618 +msgid "__________2" +msgstr "" + +#: src/menu_gui.c:624 src/menu_gui_volval.c:43 +msgid "VolumeValance" +msgstr "" + +#: src/menu_gui.c:626 src/menu_gui.c:634 +msgid "item7" +msgstr "" + +#: src/menu_gui.c:632 +msgid "PCM-audio" +msgstr "" + +#: src/menu_gui.c:641 +msgid "item7_menu" +msgstr "" + +#: src/menu_gui.c:653 +msgid "item8" +msgstr "" + +#: src/menu_gui.c:661 +msgid "item9" +msgstr "" + +#: src/menu_gui.c:666 +msgid "CDROM-audio" +msgstr "" + +#: src/menu_gui.c:668 +msgid "item10" +msgstr "" + +#: src/menu_gui.c:675 +msgid "item10_menu" +msgstr "" + +#: src/menu_gui.c:687 +msgid "item11" +msgstr "" + +#: src/menu_gui.c:695 +msgid "item12" +msgstr "" + +#: src/menu_gui.c:700 +msgid "MIDI-audio" +msgstr "" + +#: src/menu_gui.c:702 +msgid "item13" +msgstr "" + +#: src/menu_gui.c:709 +msgid "item13_menu" +msgstr "" + +#: src/menu_gui.c:721 +msgid "item14" +msgstr "" + +#: src/menu_gui.c:729 +msgid "item15" +msgstr "" + +#: src/menu_gui.c:736 +msgid "__________3" +msgstr "" + +#: src/menu_gui.c:745 +msgid "item16" +msgstr "" + +#: src/menu_gui.c:752 +msgid "__________4" +msgstr "" + +#: src/menu_gui.c:760 +msgid "item17" +msgstr "" + +#: src/menu_gui.c:765 +msgid "deactivate" +msgstr "" + +#: src/menu_gui.c:768 src/menu_gui.c:771 src/menu_gui_volval.c:97 +msgid "toggled" +msgstr "" + +#: src/menu_gui.c:820 +msgid "window5" +msgstr "" + +#: src/menu_gui.c:825 +msgid "entry2" +msgstr "" + +#: src/menu_gui.c:848 +msgid "window6" +msgstr "" + +#: src/menu_gui.c:849 +msgid "MessageBox" +msgstr "" + +#: src/menu_gui.c:854 +msgid "vbox5" +msgstr "" + +#: src/menu_gui.c:859 +msgid "Messge" +msgstr "" + +#: src/menu_gui.c:861 +msgid "label51" +msgstr "" + +#: src/menu_gui.c:868 +msgid "button16" +msgstr "" + +#: src/menu_gui_volval.c:45 +msgid "frame1" +msgstr "" + +#: src/menu_gui_volval.c:53 +msgid "table2" +msgstr "" + +#: src/menu_gui_volval.c:65 +msgid "label1" +msgstr "" + +#: src/menu_gui_volval.c:74 +msgid "value-changed" +msgstr "" + +#: src/menu_gui_volval.c:80 +msgid "hscale1" +msgstr "" + +#: src/menu_gui_volval.c:89 +msgid "mute" +msgstr "" + +#: src/menu_gui_volval.c:91 +msgid "checkbutton1" +msgstr "" + +#: src/menu_gui_volval.c:114 +msgid "small" +msgstr "" + +#: src/menu_gui_volval.c:122 +msgid "large" +msgstr "" + +#: src/menu_gui_volval.c:130 +msgid "delete_event" +msgstr "" diff --git a/src/LittleEndian.c b/src/LittleEndian.c new file mode 100644 index 0000000..48c8988 --- /dev/null +++ b/src/LittleEndian.c @@ -0,0 +1,62 @@ +/* + * LittleEndian.c get little endian value + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * + * @version 0.00 97/11/06 初版 +*/ +/* $Id: LittleEndian.c,v 1.5 2000/11/25 13:08:56 chikama Exp $ */ + +#include "portab.h" + +int LittleEndian_getDW(const BYTE *b,int index) { + int c0, c1, c2, c3; + int d0, d1; + c0 = *(b + index + 0); + c1 = *(b + index + 1); + c2 = *(b + index + 2); + c3 = *(b + index + 3); + d0 = c0 + (c1 << 8); + d1 = c2 + (c3 << 8); + return (DWORD)(d0 + (d1 << 16)); +} + +int LittleEndian_get3B(const BYTE *b,int index) { + int c0, c1, c2; + c0 = *(b + index + 0); + c1 = *(b + index + 1); + c2 = *(b + index + 2); + return c0 + (c1 << 8) + (c2 << 16); +} + +int LittleEndian_getW(const BYTE *b,int index) { + int c0, c1; + c0 = *(b + index + 0); + c1 = *(b + index + 1); + return c0 + (c1 << 8); +} + +void LittleEndian_putW(int num, BYTE *b, int index) { + int c0, c1; + num %= 65536; + c0 = num % 256; + c1 = num / 256; + b[index] = c0; b[index+1] = c1; +} + diff --git a/src/LittleEndian.h b/src/LittleEndian.h new file mode 100644 index 0000000..46fabca --- /dev/null +++ b/src/LittleEndian.h @@ -0,0 +1,36 @@ +/* + * LittleEndian.h get little endian value + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * + * @version 0.00 97/11/06 初版 +*/ +/* $Id: LittleEndian.h,v 1.6 2000/11/25 13:08:56 chikama Exp $ */ + +#ifndef __LITTLEENDIAN__ +#define __LITTIEENDIAN__ + +#include "portab.h" + +extern int LittleEndian_getDW(const BYTE *b,int index); +extern int LittleEndian_get3B(const BYTE *b,int index); +extern int LittleEndian_getW(const BYTE *b,int index); +extern void LittleEndian_putW(int num, BYTE *b, int index); + +#endif /* !__LITTLEENDIAN__ */ diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..c759aea --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,86 @@ +# +# Makefile.am for xsystem35 +# + +#programe name +bin_PROGRAMS = xsystem35 + +INCLUDES = $(LTDLINCL) + +xsystem35_LDFLAGS = @EXTRALDFLAGS@ + +AM_CFLAGS = @DEBUG_CFLAGS@ @X_CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@ @ESD_CFLAGS@ @SDL_CFLAGS@ @EXTRACFLAGS@ @VORBIS_CFLAGS@ -DMODULE_PATH=\"$(libdir)/@PACKAGE@\" -DLOCALEDIR=\""$(datadir)/locale"\" + + +SRC_SYS35CMD := cmdb.c cmdc.c cmdd.c cmde.c cmdf.c cmdg.c cmdh.c cmdi.c cmdj.c cmdk.c cmdl.c cmdm.c cmdn.c cmdo.c cmdp.c cmdq.c cmds.c cmdt.c cmdu.c cmdv.c cmdw.c cmdy.c cmdz.c cmd2F.c cmd2F60.c +SRC_CG := pms.c vsp.c bmp.c qnt.c +SRC_MUS := music.c music_client.c music_server.c music_cdrom.c music_midi.c music_pcm.c music_fader.c wavfile.c wavmix.c audio.c midi.c cdrom.c sndcnv.c musstream.c pcmlib.c music_bgm.c musstream_wav.c musstream_ogg.c musstream_wav_ima.c +SRC_MISC := LittleEndian.c counter.c imput.c profile.c mt19937-1.c @JOY_S@.c eucsjis.c filecheck.c tempname.c +SRC_SCO := cali.c scenario.c variable.c cmd_check.c hankana2sjis.c nact.c selection.c message.c savedata.c hankaku.c s39ain.c s39init.c +SRC_GRAPH := ags.c font.c flood.c cg.c ecopy.c antialiase.c alpha_plane.c cursor.c + +SRC_NET := network.c +SRC_DLL := + +xsystem35_SOURCES = \ + xsystem35.c \ + dri.c \ + ald_manager.c \ + cache.c \ + $(SRC_SYS35CMD) \ + $(SRC_CG) \ + $(SRC_SCO) \ + $(SRC_MUS) \ + $(SRC_GRAPH) \ + $(SRC_MISC) \ + $(SRC_NET) \ + $(SRC_DLL) + +xsystem35_DEPENDENCIES = \ + $(SRC_AUDIO:.c=.o) \ + $(SRC_CDROM:.c=.o) \ + $(SRC_MIDI:.c=.o) \ + $(SRC_GRAPHDEV:.c=.o) \ + $(SRC_FONT:.c=.o) \ + $(SRC_ABLEND:.s=.o) \ + $(SRC_MENU:.c=.o) + +xsystem35_LDADD = \ + @ZLIB_LIBS@ \ + @X_LIBS@ \ + @GLIB_LIBS@ \ + @GTK_LIBS@ \ + @ALSA_LIBS@ \ + @ESD_LIBS@ \ + @SDL_LIBS@ \ + @EXTRALIBS@ \ + @LIBINTL@ \ + $(LIBLTDL) \ + @VORBIS_LIBS@ \ + @VORBISFILE_LIBS@ \ + $(SRC_ABLEND:.s=.o) \ + $(SRC_AUDIO:.c=.o) \ + $(SRC_CDROM:.c=.o) \ + $(SRC_MIDI:.c=.o) \ + $(SRC_GRAPHDEV:.c=.o) \ + $(SRC_FONT:.c=.o) \ + $(SRC_MENU:.c=.o) + +audio_oss.o: audio_oss.c audio_oss.h mixer_oss.c + +audio_alsa.o: audio_alsa.c audio_alsa.h mixer_alsa.c + +audio_esd.o: audio_esd.c audio_esd.h mixer_esd.c + +image.o: image.c image15.c image16.c image24.c image24p.c + + +sdl_input.c: + perl xsyskey.pl > sdl_input.c + +.s.o: + nasm -f elf $< + +objs: $(system35_OBJECTS) $(xsystem35_DEPENDENCIES) + @: + diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..e785eac --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,734 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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@ + +# +# Makefile.am for xsystem35 +# + +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 = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = xsystem35$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/macros/aclocal-include.m4 \ + $(top_srcdir)/macros/alsa.m4 $(top_srcdir)/macros/esd.m4 \ + $(top_srcdir)/macros/freetype.m4 \ + $(top_srcdir)/macros/freetype2.m4 \ + $(top_srcdir)/macros/gettext.m4 \ + $(top_srcdir)/macros/glib-2.0.m4 $(top_srcdir)/macros/glib.m4 \ + $(top_srcdir)/macros/gtk-2.0.m4 $(top_srcdir)/macros/gtk.m4 \ + $(top_srcdir)/macros/iconv.m4 $(top_srcdir)/macros/lib-ld.m4 \ + $(top_srcdir)/macros/lib-link.m4 \ + $(top_srcdir)/macros/lib-prefix.m4 \ + $(top_srcdir)/macros/libtool.m4 $(top_srcdir)/macros/ltdl.m4 \ + $(top_srcdir)/macros/ogg.m4 $(top_srcdir)/macros/progtest.m4 \ + $(top_srcdir)/macros/sdl.m4 $(top_srcdir)/macros/vorbis.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am__objects_1 = cmdb.$(OBJEXT) cmdc.$(OBJEXT) cmdd.$(OBJEXT) \ + cmde.$(OBJEXT) cmdf.$(OBJEXT) cmdg.$(OBJEXT) cmdh.$(OBJEXT) \ + cmdi.$(OBJEXT) cmdj.$(OBJEXT) cmdk.$(OBJEXT) cmdl.$(OBJEXT) \ + cmdm.$(OBJEXT) cmdn.$(OBJEXT) cmdo.$(OBJEXT) cmdp.$(OBJEXT) \ + cmdq.$(OBJEXT) cmds.$(OBJEXT) cmdt.$(OBJEXT) cmdu.$(OBJEXT) \ + cmdv.$(OBJEXT) cmdw.$(OBJEXT) cmdy.$(OBJEXT) cmdz.$(OBJEXT) \ + cmd2F.$(OBJEXT) cmd2F60.$(OBJEXT) +am__objects_2 = pms.$(OBJEXT) vsp.$(OBJEXT) bmp.$(OBJEXT) \ + qnt.$(OBJEXT) +am__objects_3 = cali.$(OBJEXT) scenario.$(OBJEXT) variable.$(OBJEXT) \ + cmd_check.$(OBJEXT) hankana2sjis.$(OBJEXT) nact.$(OBJEXT) \ + selection.$(OBJEXT) message.$(OBJEXT) savedata.$(OBJEXT) \ + hankaku.$(OBJEXT) s39ain.$(OBJEXT) s39init.$(OBJEXT) +am__objects_4 = music.$(OBJEXT) music_client.$(OBJEXT) \ + music_server.$(OBJEXT) music_cdrom.$(OBJEXT) \ + music_midi.$(OBJEXT) music_pcm.$(OBJEXT) music_fader.$(OBJEXT) \ + wavfile.$(OBJEXT) wavmix.$(OBJEXT) audio.$(OBJEXT) \ + midi.$(OBJEXT) cdrom.$(OBJEXT) sndcnv.$(OBJEXT) \ + musstream.$(OBJEXT) pcmlib.$(OBJEXT) music_bgm.$(OBJEXT) \ + musstream_wav.$(OBJEXT) musstream_ogg.$(OBJEXT) \ + musstream_wav_ima.$(OBJEXT) +am__objects_5 = ags.$(OBJEXT) font.$(OBJEXT) flood.$(OBJEXT) \ + cg.$(OBJEXT) ecopy.$(OBJEXT) antialiase.$(OBJEXT) \ + alpha_plane.$(OBJEXT) cursor.$(OBJEXT) +am__objects_6 = LittleEndian.$(OBJEXT) counter.$(OBJEXT) \ + imput.$(OBJEXT) profile.$(OBJEXT) mt19937-1.$(OBJEXT) \ + @JOY_S@.$(OBJEXT) eucsjis.$(OBJEXT) filecheck.$(OBJEXT) \ + tempname.$(OBJEXT) +am__objects_7 = network.$(OBJEXT) +am__objects_8 = +am_xsystem35_OBJECTS = xsystem35.$(OBJEXT) dri.$(OBJEXT) \ + ald_manager.$(OBJEXT) cache.$(OBJEXT) $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) $(am__objects_4) \ + $(am__objects_5) $(am__objects_6) $(am__objects_7) \ + $(am__objects_8) +xsystem35_OBJECTS = $(am_xsystem35_OBJECTS) +am__DEPENDENCIES_1 = +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(xsystem35_SOURCES) +DIST_SOURCES = $(xsystem35_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSAMIX_H = @ALSAMIX_H@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ +CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_CFLAGS = @DEBUG_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_JPEG_FALSE = @ENABLE_JPEG_FALSE@ +ENABLE_JPEG_TRUE = @ENABLE_JPEG_TRUE@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_CONFIG = @ESD_CONFIG@ +ESD_LIBS = @ESD_LIBS@ +EXEEXT = @EXEEXT@ +EXTRACFLAGS = @EXTRACFLAGS@ +EXTRALDFLAGS = @EXTRALDFLAGS@ +EXTRALIBS = @EXTRALIBS@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_INCLUDES = @FREETYPE_INCLUDES@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FT2_CFLAGS = @FT2_CFLAGS@ +FT2_CONFIG = @FT2_CONFIG@ +FT2_LIBS = @FT2_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_GTK_FALSE = @HAVE_GTK_FALSE@ +HAVE_GTK_TRUE = @HAVE_GTK_TRUE@ +HAVE_NASM = @HAVE_NASM@ +HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@ +HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@ +INSIDE_GNOME_COMMON_FALSE = @INSIDE_GNOME_COMMON_FALSE@ +INSIDE_GNOME_COMMON_TRUE = @INSIDE_GNOME_COMMON_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ +INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +JOY_S = @JOY_S@ +JPEG_CFLAGS = @JPEG_CFLAGS@ +JPEG_LIBS = @JPEG_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTDLINCL = @LTDLINCL@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +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@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SDL = @SDL@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRC_ABLEND = @SRC_ABLEND@ +SRC_AUDIO = @SRC_AUDIO@ +SRC_CDROM = @SRC_CDROM@ +SRC_FONT = @SRC_FONT@ +SRC_GRAPHDEV = @SRC_GRAPHDEV@ +SRC_MENU = @SRC_MENU@ +SRC_MIDI = @SRC_MIDI@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VERSION_MA = @VERSION_MA@ +VERSION_MI = @VERSION_MI@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBISFILE_LIBS = @VORBISFILE_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +XGETTEXT = @XGETTEXT@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +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@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +INCLUDES = $(LTDLINCL) +xsystem35_LDFLAGS = @EXTRALDFLAGS@ +AM_CFLAGS = @DEBUG_CFLAGS@ @X_CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@ @ESD_CFLAGS@ @SDL_CFLAGS@ @EXTRACFLAGS@ @VORBIS_CFLAGS@ -DMODULE_PATH=\"$(libdir)/@PACKAGE@\" -DLOCALEDIR=\""$(datadir)/locale"\" +SRC_SYS35CMD := cmdb.c cmdc.c cmdd.c cmde.c cmdf.c cmdg.c cmdh.c cmdi.c cmdj.c cmdk.c cmdl.c cmdm.c cmdn.c cmdo.c cmdp.c cmdq.c cmds.c cmdt.c cmdu.c cmdv.c cmdw.c cmdy.c cmdz.c cmd2F.c cmd2F60.c +SRC_CG := pms.c vsp.c bmp.c qnt.c +SRC_MUS := music.c music_client.c music_server.c music_cdrom.c music_midi.c music_pcm.c music_fader.c wavfile.c wavmix.c audio.c midi.c cdrom.c sndcnv.c musstream.c pcmlib.c music_bgm.c musstream_wav.c musstream_ogg.c musstream_wav_ima.c +SRC_MISC := LittleEndian.c counter.c imput.c profile.c mt19937-1.c @JOY_S@.c eucsjis.c filecheck.c tempname.c +SRC_SCO := cali.c scenario.c variable.c cmd_check.c hankana2sjis.c nact.c selection.c message.c savedata.c hankaku.c s39ain.c s39init.c +SRC_GRAPH := ags.c font.c flood.c cg.c ecopy.c antialiase.c alpha_plane.c cursor.c +SRC_NET := network.c +SRC_DLL := +xsystem35_SOURCES = \ + xsystem35.c \ + dri.c \ + ald_manager.c \ + cache.c \ + $(SRC_SYS35CMD) \ + $(SRC_CG) \ + $(SRC_SCO) \ + $(SRC_MUS) \ + $(SRC_GRAPH) \ + $(SRC_MISC) \ + $(SRC_NET) \ + $(SRC_DLL) + +xsystem35_DEPENDENCIES = \ + $(SRC_AUDIO:.c=.o) \ + $(SRC_CDROM:.c=.o) \ + $(SRC_MIDI:.c=.o) \ + $(SRC_GRAPHDEV:.c=.o) \ + $(SRC_FONT:.c=.o) \ + $(SRC_ABLEND:.s=.o) \ + $(SRC_MENU:.c=.o) + +xsystem35_LDADD = \ + @ZLIB_LIBS@ \ + @X_LIBS@ \ + @GLIB_LIBS@ \ + @GTK_LIBS@ \ + @ALSA_LIBS@ \ + @ESD_LIBS@ \ + @SDL_LIBS@ \ + @EXTRALIBS@ \ + @LIBINTL@ \ + $(LIBLTDL) \ + @VORBIS_LIBS@ \ + @VORBISFILE_LIBS@ \ + $(SRC_ABLEND:.s=.o) \ + $(SRC_AUDIO:.c=.o) \ + $(SRC_CDROM:.c=.o) \ + $(SRC_MIDI:.c=.o) \ + $(SRC_GRAPHDEV:.c=.o) \ + $(SRC_FONT:.c=.o) \ + $(SRC_MENU:.c=.o) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +xsystem35$(EXEEXT): $(xsystem35_OBJECTS) $(xsystem35_DEPENDENCIES) + @rm -f xsystem35$(EXEEXT) + $(LINK) $(xsystem35_LDFLAGS) $(xsystem35_OBJECTS) $(xsystem35_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@JOY_S@.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LittleEndian.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ald_manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_plane.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antialiase.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cali.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd2F.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd2F60.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_check.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmde.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdj.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdn.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmds.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdz.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/counter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cursor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecopy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eucsjis.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filecheck.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flood.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/font.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hankaku.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hankana2sjis.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imput.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt19937-1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music_bgm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music_cdrom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music_client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music_fader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music_midi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music_pcm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/music_server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/musstream.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/musstream_ogg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/musstream_wav.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/musstream_wav_ima.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nact.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcmlib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pms.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qnt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s39ain.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s39init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savedata.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scenario.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sndcnv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wavfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wavmix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsystem35.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +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 + +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; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +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 + +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"; \ + $(mkdir_p) "$(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 $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-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-binPROGRAMS uninstall-info-am + + +audio_oss.o: audio_oss.c audio_oss.h mixer_oss.c + +audio_alsa.o: audio_alsa.c audio_alsa.h mixer_alsa.c + +audio_esd.o: audio_esd.c audio_esd.h mixer_esd.c + +image.o: image.c image15.c image16.c image24.c image24p.c + +sdl_input.c: + perl xsyskey.pl > sdl_input.c + +.s.o: + nasm -f elf $< + +objs: $(system35_OBJECTS) $(xsystem35_DEPENDENCIES) + @: +# 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/src/ablend16_dpd.s b/src/ablend16_dpd.s new file mode 100644 index 0000000..e7442bf --- /dev/null +++ b/src/ablend16_dpd.s @@ -0,0 +1,306 @@ +;;; +;;;void ablend16_dpd(BYTE *write, int src, BYTE *dst, int alpha, int w, int h, int pitchw, int pitchd) +;;; write: write address (Pointer) +;;; src: source pixel (Data) +;;; dst: destination pixel (Pointer) +;;; alpha: alpha pixel (Data) +;;; w: width +;;; h: height +;;; pitchw: scan line of write +;;; pitchd: scan line of dst + +ablend16_dpd: + push ebp + push ebx + push ecx + push edx + push esi + push edi + +%assign _P 4*6 +%define write [esp + _P + 4] +%define src [esp + _P + 8] +%define dst [esp + _P + 12] +%define alpha [esp + _P + 16] +%define width [esp + _P + 20] +%define height [esp + _P + 24] +%define pitchw [esp + _P + 28] +%define pitchd [esp + _P + 32] + + mov esi, src ;esi=src + mov edi, dst ;edi=dst + mov ebp, write + mov eax, alpha ;eax=alpha + mov ebx, width ;ecx=w + mov ecx, height ;ecx=h + + mov [alpharate], si ; copy to data segment + mov [alpharate + 2], si ; + mov [alpharate + 4], si ; + mov [alpharate + 6], si ; + + align 16 +.primeloop: + movd mm1, eax ; mm1=00 00 00 00 a a a a + pxor mm2, mm2 ; mm2=0 + + movq mm4, [alpharate]; g1: mm4=src0 src0 src0 src0 + punpcklbw mm1, mm2 ; mm1=00a3 00a2 00a1 00a0 + + align 16 +.loopqword: + mov edx, eax + test ebx, 0xfffffffc ; check if only 3 pixel left + jnz .lp1 + jmp .checkback ; 3 or less pixel left +.lp1: + cmp edx, 0xffffffff ; test for alpha value of 0 + jne .lp2 + jmp .copyback ; if 1's copy the source pixel to destination +.lp2 + + test edx, 0xffffffff ; test for alpha value of 1 + jnz .lp3 + jmp .leavefront ; if so go to the next 4 pixel +.lp3 + +; green +; i+a*src+(63-a)*dst +; i=(i+32)+((i+32)>>6>>6 +; red/blue +; i+a*src+(31-a)*dst +; i=(i+32)+((i+32)>>5>>5 + + movq mm5, [edi] ; g2: mm5=dst3 dst2 dst1 dst0 + psrlw mm1, 2 ; mm1=a? >>2 nule out lower 2bit + + movq mm7, [maskshiftg]; g3: mm7=1 bit shifted gree mask + psrlw mm4, 1 ; g3a: move src green down by 1 so that we dont overflow + + movq mm0, mm1 ; mm0=00a3 00a2 00a1 00a0 + psrlw mm5, 1 ; g3a: move dst green down by 1 so that we dont overflow + + psrlw mm1, 1 ; mm1=a? >>1 nuke out lowe 1 bit + pand mm4, mm7 ; g5: mm4=sg3 sg2 sg1 sg0 + + movq mm2, [sixones] ; g4 mm2 = 63 + pand mm5, mm7 ; g7: mm5=dg3 dg2 dg1 dg0 + + movq mm3, [alpharate]; b1: mm3=src0 src0 src0 src0 + psubsb mm2, mm0 ; g6: mm2=63-a3 63-a2 63-a1 63-a0 + + movq mm7, [maskb16] ; b2: mm7=blue mask + pmullw mm4, mm0 ; g8: mm4=sg * a? + + movq mm0, [edi] ; b3: mm0=dst3 dst2 dst1 dst0 + pmullw mm5, mm2 ; g9: mm5=dg? * (1-a?) + + movq mm2, mm7 ; b4: mm2=finevones + pand mm3, mm7 ; b4: mm3=sb3 sb2 sb1 sb0 + + pmullw mm3, mm1 ; b6: mm3=sb? * a? + pand mm0, mm7 ; b5: mm0=db3 sb2 db1 db0 + + movq mm7, [alpharate]; r1: mm7=src0 src0 src0 src0 + paddw mm4, mm5 ; g10: mm4=sg? * a? + dg? * (1-a?) + + pand mm7, [maskr16] ; r2: mm7=sr3 sr2 sr1 sr0 + psubsb mm2, mm1 ; b5a mm2=31-a3 31-a2 31-a1 31-a0 + + paddw mm4, [fivetwelve]; g11: mm4=(mm4+512) green + pmullw mm0, mm2 ; b7: mm0=db? * (1-a?) + + movq mm5, mm4 ; g12: mm5=mm4 green + psrlw mm7, 11 ; r4: shift src red down to position 0 + + psrlw mm4, 6 ; g13: mm4=mm4 >> 6 + + paddw mm4, mm5 ; g14: mm4=mm4+mm5 green + + paddw mm0, mm3 ; b8: mm0=sb? * a? + db? * (1-a?) + + movq mm5, [edi] ; r3: mm5 = dst3 dst2 dst1 dst0 + + paddw mm0, [sixteen] ; b9: mm0=(mm0+16) blue + + pand mm5, [maskr16] ; r5: mm5=dr3 dr2 dr1 dr0 + psrlw mm4, 5 ; g15: mm4=0?g0 0?g0 0?g0 0?g0 green + + movq mm3, mm0 ; b10: mm3=mm0 blue + psrlw mm0, 5 ; b11: mm0=mm0 >> 5 blue + + psrlw mm5, 11 ; r6: shift dst red down to position 0 + paddw mm0, mm3 ; b12: mm0=mm3+mm0 blue + + psrlw mm0, 5 ; b13: mm0=000b 000b 000b 000b blue + pmullw mm7, mm1 ; mm7=sr? * a? + + pand mm4, [maskg16] ; g16: mm4=00g0 00g0 00g0 00g0 green + pmullw mm5, mm2 ; r7: mm5=dr? * (31-a?) + + por mm0, mm4 ; mm0=00gb 00gb 00gb 00gb + add edi, 8 ; move to next 4 pixel in dst + add ebp, 8 ; move to next 4 pixel in write + + movd mm1, eax ; mm1=00 00 00 00 a a a a + paddw mm5, mm7 ; r8: mm5=sr? * a? + dr? * (31-a?) + + paddw mm5, [sixteen] ; r9: mm5=(mm5+16) red + pxor mm2, mm2 ; mm2=0 + + movq mm7, mm5 ; r10: mm7=mm5 + psrlw mm5, 5 ; r11: mm5=mm5>>5 red + + movq mm4, [alpharate]; g1: mm4=src0 src0 src0 src0 + paddw mm5, mm7 ; r12: mm5=mm7+mm5 + + punpcklbw mm1, mm2 ; mm1=00a3 00a2 00a1 00a0 + psrlw mm5, 5 ; r13: mm5=mm5>>5 red + + psllw mm5, 11 ; r14: mm5=mm5<10 red + + por mm0, mm5 ; mm0=0rgb 0rgb 0rgb 0rgb + + sub ebx, 4 ; polished off 4 pixels + movq [ebp-8], mm0 ; write = 0rgb 0rgb 0rgb 0rgb + + jmp .loopqword ; go back to start + +.copyback: + movq [ebp], mm4 ; copy souce to write + +.leavefront: + add edi, 8 ; advance destination 4 pixels + add ebp, 8 ; advance write 4 pixels + sub ebx, 4 ; decrease pixel count by 4 + jmp .primeloop + +.checkback: + test ebx, 0xff ; check if 0 pixel left + jnz .lp6 + jmp .nextline +.lp6: + movq mm5, [edi] ; g2: mm5=dst3 dst2 dst1 dst0 + psrlw mm1, 2 ; mm1=a? >>2 nule out lower 2bit + + movq mm7, [maskshiftg]; g3: mm7=1 bit shifted gree mask + psrlw mm4, 1 ; g3a: move src green down by 1 so that we dont overflow + + movq mm0,mm1 ; mm0=00a3 00a2 00a1 00a0 + psrlw mm5, 1 ; g3a: move dst green down by 1 so that we dont overflow + + psrlw mm1, 1 ; mm1=a? >>1 nuke out lowe 1 bit + pand mm4, mm7 ; g5: mm4=sg3 sg2 sg1 sg0 + + movq mm2, [sixones] ; g4 mm2 = 63 + pand mm5, mm7 ; g7: mm5=dg3 dg2 dg1 dg0 + + movd mm3, [alpharate]; b1: mm3=src3 src2 src1 src0 + psubsb mm2, mm0 ; g6: mm2=63-a3 63-a2 63-a1 63-a0 + + movq mm7, [maskb16] ; b2: mm7=blue mask + pmullw mm4, mm0 ; g8: mm4=sg * a? + + movq mm0, [edi] ; b3: mm0=dst3 dst2 dst1 dst0 + pmullw mm5, mm2 ; g9: mm5=dg? * (1-a?) + + movq mm2, mm7 ; b4: mm2=finevones + pand mm3, mm7 ; b4: mm3=sb3 sb2 sb1 sb0 + + pmullw mm3, mm1 ; b6: mm3=sb? * a? + pand mm0, mm7 ; b5: mm0=db3 sb2 db1 db0 + + movq mm7, [alpharate]; r1: mm7=src3 src2 src1 src0 + paddw mm4, mm5 ; g10: mm4=sg? * a? + dg? * (1-a?) + + pand mm7, [maskr16] ; r2: mm7=sr3 sr2 sr1 sr0 + psubsb mm2, mm1 ; b5a mm2=31-a3 31-a2 31-a1 31-a0 + + paddw mm4, [fivetwelve]; g11: mm4=(mm4+512) green + pmullw mm0, mm2 ; b7: mm0=db? * (1-a?) + + movq mm5, mm4 ; g12: mm5=mm4 green + psrlw mm7, 11 ; r4: shift src red down to position 0 + + psrlw mm4, 6 ; g13: mm4=mm4 >> 6 + + paddw mm4, mm5 ; g14: mm4=mm4+mm5 green + + paddw mm0, mm3 ; b8: mm0=sb? * a? + db? * (1-a?) + + movq mm5, [edi] ; r3: mm5 = dst3 dst2 dst1 dst0 + + paddw mm0, [sixteen] ; b9: mm0=(mm0+16) blue + + pand mm5, [maskr16] ; r5: mm5=dr3 dr2 dr1 dr0 + psrlw mm4, 5 ; g15: mm4=0?g0 0?g0 0?g0 0?g0 green + + movq mm3, mm0 ; b10: mm3=mm0 blue + psrlw mm0, 5 ; b11: mm0=mm0 >> 5 blue + + psrlw mm5, 11 ; r6: shift dst red down to position 0 + paddw mm0, mm3 ; b12: mm0=mm3+mm0 blue + + psrlw mm0, 5 ; b13: mm0=000b 000b 000b 000b blue + pmullw mm7, mm1 ; mm7=sr? * a? + + pand mm4, [maskg16] ; g16: mm4=00g0 00g0 00g0 00g0 green + pmullw mm5, mm2 ; r7: mm5=dr? * (31-a?) + + por mm0, mm4 ; mm0=00gb 00gb 00gb 00gb + + paddw mm5, mm7 ; r8: mm5=sr? * a? + dr? * (31-a?) + + paddw mm5, [sixteen] ; r9: mm5=(mm5+16) red + + movq mm7, mm5 ; r10: mm7=mm5 + psrlw mm5, 5 ; r11: mm5=mm5>>5 red + + paddw mm5, mm7 ; r12: mm5=mm7+mm5 + + psrlw mm5, 5 ; r13: mm5=mm5>>5 red + + psllw mm5, 11 ; r14: mm5=mm5<10 red + + por mm0, mm5 ; mm0=0rgb 0rgb 0rgb 0rgb + test ebx, 2 ; check if there are 2 pixel + + jz .oneendpixel ; goto one pixel if thats it + movd [ebp], mm0 ; dst = 0000 000 0rgb 0rgb + psrlq mm0, 32 ; mm0 >> 32 + + add edi, 4 ; edi=edi+4 + add ebp, 4 ; ebp=ebp+4 + sub ebx, 2 ; save 2 pixels + jz .nextline ; all done goto next line + +.oneendpixel: + movd edx, mm0 ; edx=0rgb + + mov [ebp], dx ; dst=0rgb + +.nextline: + dec ecx ; nuke one line + jz .done ; all done + + mov edi, dst ;edi=dst + mov ebp, write ;ebp=write + + add edi, pitchd ;pitch dst + add ebp, pitchw ;pitch write + + mov ebx, width + mov dst, edi + mov write, ebp + + jmp .primeloop + +.done: + emms + pop edi + pop esi + pop edx + pop ecx + pop ebx + pop ebp + ret diff --git a/src/ablend16_ppd.s b/src/ablend16_ppd.s new file mode 100644 index 0000000..6c328b5 --- /dev/null +++ b/src/ablend16_ppd.s @@ -0,0 +1,310 @@ +;;; +;;; void ablend16_ppd(BYTE *write, BYTE *src, BYTE *dst, int a, int w, int h, int pitchw, int pitchs, int pitchd) +;;; write: write pixel (Pointer) +;;; src: source pixel (Pointer) +;;; dst: destination pixel (Pointer) +;;; a: alpha pixels (Data) +;;; w: width +;;; h: height +;;; pitchw: scan line of write +;;; pitchs: scan line of source +;;; pitchd: scan line of dst + +ablend16_ppd: + push ebp + push ebx + push ecx + push edx + push esi + push edi + +%assign _P 4*6 +%define write [esp + _P + 4] +%define src [esp + _P + 8] +%define dst [esp + _P + 12] +%define alpha [esp + _P + 16] +%define width [esp + _P + 20] +%define height [esp + _P + 24] +%define pitchw [esp + _P + 28] +%define pitchs [esp + _P + 32] +%define pitchd [esp + _P + 36] + + + mov ebp, write ;ebp=write + mov esi, src ;esi=src + mov edi, dst ;edi=dst + mov eax, alpha ;eax=a + mov ebx, width ;ecx=w + mov ecx, height ;ecx=h + + align 16 +.primeloop: + movd mm1, eax ; mm1=00 00 00 00 a3 a2 a1 00 + pxor mm2, mm2 ; mm2=0 + + movq mm4, [esi] ; g1: mm4=src3 src2 src1 src0 + punpcklbw mm1, mm2 ; mm1=00a3 00a2 00a1 00a0 + + align 16 +.loopqword: + mov edx, eax + test ebx, 0xfffffffc ; check if only 3 pixel left + jnz .lp1 + jmp .checkback ; 3 or less pixel left +.lp1: + cmp edx, 0xffffffff ; test for alpha value of 0 + jne .lp2 + jmp .copyback ; if 1's copy the source pixel to destination +.lp2 + + test edx, 0xffffffff ; test for alpha value of 1 + jnz .lp3 + jmp .leavefront ; if so go to the next 4 pixel +.lp3 + +; green +; i+a*src+(63-a)*dst +; i=(i+32)+((i+32)>>6>>6 +; red/blue +; i+a*src+(31-a)*dst +; i=(i+32)+((i+32)>>5>>5 + + movq mm5, [edi] ; g2: mm5=dst3 dst2 dst1 dst0 + psrlw mm1, 2 ; mm1=a? >>2 nule out lower 2bit + + movq mm7, [maskshiftg]; g3: mm7=1 bit shifted gree mask + psrlw mm4, 1 ; g3a: move src green down by 1 so that we dont overflow + + movq mm0, mm1 ; mm0=00a3 00a2 00a1 00a0 + psrlw mm5, 1 ; g3a: move dst green down by 1 so that we dont overflow + + psrlw mm1, 1 ; mm1=a? >>1 nuke out lowe 1 bit + pand mm4, mm7 ; g5: mm4=sg3 sg2 sg1 sg0 + + movq mm2, [sixones] ; g4 mm2 = 63 + pand mm5, mm7 ; g7: mm5=dg3 dg2 dg1 dg0 + + movq mm3, [esi] ; b1: mm3=src3 src2 src1 src0 + psubsb mm2, mm0 ; g6: mm2=63-a3 63-a2 63-a1 63-a0 + + movq mm7, [maskb16] ; b2: mm7=blue mask + pmullw mm4, mm0 ; g8: mm4=sg * a? + + movq mm0, [edi] ; b3: mm0=dst3 dst2 dst1 dst0 + pmullw mm5, mm2 ; g9: mm5=dg? * (1-a?) + + movq mm2, mm7 ; b4: mm2=finevones + pand mm3, mm7 ; b4: mm3=sb3 sb2 sb1 sb0 + + pmullw mm3, mm1 ; b6: mm3=sb? * a? + pand mm0, mm7 ; b5: mm0=db3 sb2 db1 db0 + + movq mm7, [esi] ; r1: mm7=src3 src2 src1 src0 + paddw mm4, mm5 ; g10: mm4=sg? * a? + dg? * (1-a?) + + pand mm7, [maskr16] ; r2: mm7=sr3 sr2 sr1 sr0 + psubsb mm2, mm1 ; b5a mm2=31-a3 31-a2 31-a1 31-a0 + + paddw mm4, [fivetwelve]; g11: mm4=(mm4+512) green + pmullw mm0, mm2 ; b7: mm0=db? * (1-a?) + + movq mm5, mm4 ; g12: mm5=mm4 green + psrlw mm7, 11 ; r4: shift src red down to position 0 + + psrlw mm4, 6 ; g13: mm4=mm4 >> 6 + + paddw mm4, mm5 ; g14: mm4=mm4+mm5 green + + paddw mm0, mm3 ; b8: mm0=sb? * a? + db? * (1-a?) + + movq mm5, [edi] ; r3: mm5 = dst3 dst2 dst1 dst0 + + paddw mm0, [sixteen] ; b9: mm0=(mm0+16) blue + + pand mm5, [maskr16] ; r5: mm5=dr3 dr2 dr1 dr0 + psrlw mm4, 5 ; g15: mm4=0?g0 0?g0 0?g0 0?g0 green + + movq mm3, mm0 ; b10: mm3=mm0 blue + psrlw mm0, 5 ; b11: mm0=mm0 >> 5 blue + + psrlw mm5, 11 ; r6: shift dst red down to position 0 + paddw mm0, mm3 ; b12: mm0=mm3+mm0 blue + + psrlw mm0, 5 ; b13: mm0=000b 000b 000b 000b blue + pmullw mm7, mm1 ; mm7=sr? * a? + + pand mm4, [maskg16] ; g16: mm4=00g0 00g0 00g0 00g0 green + pmullw mm5, mm2 ; r7: mm5=dr? * (31-a?) + + por mm0, mm4 ; mm0=00gb 00gb 00gb 00gb + + add esi, 8 ; move to next 4 pixel in src + add edi, 8 ; move to next 4 pixel in dst + add ebp, 8 ; move to next 4 pixel in write + + movd mm1, eax ; mm1=00 00 00 00 a a a a + paddw mm5, mm7 ; r8: mm5=sr? * a? + dr? * (31-a?) + + paddw mm5, [sixteen] ; r9: mm5=(mm5+16) red + pxor mm2, mm2 ; mm2=0 + + movq mm7, mm5 ; r10: mm7=mm5 + psrlw mm5, 5 ; r11: mm5=mm5>>5 red + + movq mm4, [esi] + paddw mm5, mm7 ; r12: mm5=mm7+mm5 + + punpcklbw mm1, mm2 ; mm1=00a3 00a2 00a1 00a0 + + psrlw mm5, 5 ; r13: mm5=mm5>>5 red + + psllw mm5, 11 ; r14: mm5=mm5<10 red + + por mm0, mm5 ; mm0=0rgb 0rgb 0rgb 0rgb + + sub ebx, 4 ; polished off 4 pixels + + movq [ebp-8], mm0 ; dst = 0rgb 0rgb 0rgb 0rgb + jmp .loopqword ; go back to start + +.copyback: + movq [ebp], mm4 ; copy souce to write + +.leavefront: + add ebp, 8 ; advance write 4 pixels + add edi, 8 ; advance destination 4 pixels + add esi, 8 ; advance source by 4 pixel + sub ebx, 4 ; decrease pixel count by 4 + jmp .primeloop + +.checkback: + test ebx, 0xff ; check if 0 pixel left + jnz .lp6 + jmp .nextline +.lp6: + movq mm5, [edi] ; g2: mm5=dst3 dst2 dst1 dst0 + psrlw mm1, 2 ; mm1=a? >>2 nule out lower 2bit + + movq mm7, [maskshiftg]; g3: mm7=1 bit shifted gree mask + psrlw mm4, 1 ; g3a: move src green down by 1 so that we dont overflow + + movq mm0,mm1 ; mm0=00a3 00a2 00a1 00a0 + psrlw mm5, 1 ; g3a: move dst green down by 1 so that we dont overflow + + psrlw mm1, 1 ; mm1=a? >>1 nuke out lowe 1 bit + pand mm4, mm7 ; g5: mm4=sg3 sg2 sg1 sg0 + + movq mm2, [sixones] ; g4 mm2 = 63 + pand mm5, mm7 ; g7: mm5=dg3 dg2 dg1 dg0 + + movq mm3, [esi] ; b1: mm3=src3 src2 src1 src0 + psubsb mm2, mm0 ; g6: mm2=63-a3 63-a2 63-a1 63-a0 + + movq mm7, [maskb16] ; b2: mm7=blue mask + pmullw mm4, mm0 ; g8: mm4=sg * a? + + movq mm0, [edi] ; b3: mm0=dst3 dst2 dst1 dst0 + pmullw mm5, mm2 ; g9: mm5=dg? * (1-a?) + + movq mm2, mm7 ; b4: mm2=finevones + pand mm3, mm7 ; b4: mm3=sb3 sb2 sb1 sb0 + + pmullw mm3, mm1 ; b6: mm3=sb? * a? + pand mm0, mm7 ; b5: mm0=db3 sb2 db1 db0 + + movq mm7, [esi] ; r1: mm7=src3 src2 src1 src0 + paddw mm4, mm5 ; g10: mm4=sg? * a? + dg? * (1-a?) + + pand mm7, [maskr16] ; r2: mm7=sr3 sr2 sr1 sr0 + psubsb mm2, mm1 ; b5a mm2=31-a3 31-a2 31-a1 31-a0 + + paddw mm4, [fivetwelve]; g11: mm4=(mm4+512) green + pmullw mm0, mm2 ; b7: mm0=db? * (1-a?) + + movq mm5, mm4 ; g12: mm5=mm4 green + psrlw mm7, 11 ; r4: shift src red down to position 0 + + psrlw mm4, 6 ; g13: mm4=mm4 >> 6 + + paddw mm4, mm5 ; g14: mm4=mm4+mm5 green + + paddw mm0, mm3 ; b8: mm0=sb? * a? + db? * (1-a?) + + movq mm5, [edi] ; r3: mm5 = dst3 dst2 dst1 dst0 + + paddw mm0, [sixteen] ; b9: mm0=(mm0+16) blue + + pand mm5, [maskr16] ; r5: mm5=dr3 dr2 dr1 dr0 + psrlw mm4, 5 ; g15: mm4=0?g0 0?g0 0?g0 0?g0 green + + movq mm3, mm0 ; b10: mm3=mm0 blue + psrlw mm0, 5 ; b11: mm0=mm0 >> 5 blue + + psrlw mm5, 11 ; r6: shift dst red down to position 0 + paddw mm0, mm3 ; b12: mm0=mm3+mm0 blue + + psrlw mm0, 5 ; b13: mm0=000b 000b 000b 000b blue + pmullw mm7, mm1 ; mm7=sr? * a? + + pand mm4, [maskg16] ; g16: mm4=00g0 00g0 00g0 00g0 green + pmullw mm5, mm2 ; r7: mm5=dr? * (31-a?) + + por mm0, mm4 ; mm0=00gb 00gb 00gb 00gb + + paddw mm5, mm7 ; r8: mm5=sr? * a? + dr? * (31-a?) + + paddw mm5, [sixteen] ; r9: mm5=(mm5+16) red + + movq mm7, mm5 ; r10: mm7=mm5 + psrlw mm5, 5 ; r11: mm5=mm5>>5 red + + paddw mm5, mm7 ; r12: mm5=mm7+mm5 + + psrlw mm5, 5 ; r13: mm5=mm5>>5 red + + psllw mm5, 11 ; r14: mm5=mm5<10 red + + por mm0, mm5 ; mm0=0rgb 0rgb 0rgb 0rgb + test ebx, 2 ; check if there are 2 pixel + + jz .oneendpixel ; goto one pixel if thats it + movd [ebp], mm0 ; write = 0000 000 0rgb 0rgb + psrlq mm0, 32 ; mm0 >> 32 + + add edi, 4 ; edi=edi+4 + add ebp, 4 ; ebp=ebp+4 + sub ebx, 2 ; save 2 pixels + jz .nextline ; all done goto next line + +.oneendpixel: + movd edx, mm0 ; edx=0rgb + + mov [ebp], dx ; dst=0rgb + +.nextline: + dec ecx ; nuke one line + jz .done ; all done + + mov esi, src ;esi=src + mov edi, dst ;edi=dst + mov ebp, write ;ebp=write + + add esi, pitchs ;pitch + add edi, pitchd ;pitch + add ebp, pitchw ;pitch + + mov ebx, width + mov src, esi + mov dst, edi + mov write, ebp + + jmp .primeloop +.done: + emms + pop edi + pop esi + pop edx + pop ecx + pop ebx + pop ebp + ret diff --git a/src/ablend16_ppp.s b/src/ablend16_ppp.s new file mode 100644 index 0000000..3c24655 --- /dev/null +++ b/src/ablend16_ppp.s @@ -0,0 +1,338 @@ +;void ablend16_ppp(BYTE *write, BYTE *src, BYTE *dst, BYTE *alpha, int w, int h, int pitchw, int pitchs, int pitchd, int pitcha, int rate); +;;; src: wirte pixel (Pointer) +;;; src: source pixel (Pointer) +;;; dst: destination pixel (Pointer) +;;; alpha: alpha pixels (Pointer) +;;; w: width +;;; h: height +;;; pitchw: scan line of write +;;; pitchs: scan line of source +;;; pitchd: scan line of destinate +;;; ptica: scan line of alpha +;;; rate: alpha rate + +ablend16_ppp: + push ebp + push ebx + push ecx + push edx + push esi + push edi + +;;; pushed register +%assign _P 4*6 +%define write [esp + _P + 4] +%define src [esp + _P + 8] +%define dst [esp + _P + 12] +%define alpha [esp + _P + 16] +%define width [esp + _P + 20] +%define height [esp + _P + 24] +%define pitchw [esp + _P + 28] +%define pitchs [esp + _P + 32] +%define pitchd [esp + _P + 36] +%define pitcha [esp + _P + 40] +%define rate [esp + _P + 44] + + mov esi, src ; esi=src + mov edi, dst ; edi=dst + mov ebp, write ; ebp=write + mov eax, alpha ; eax=alpha + mov ebx, width ; ecx=w + mov ecx, height ; ecx=h + mov edx, rate ; alpha rate + + mov [alpharate], dx + mov [alpharate+2], dx + mov [alpharate+4], dx + mov [alpharate+6], dx + + align 16 +.primeloop: + movd mm1, [eax] ; mm1=00 00 00 00 a3 a2 a1 a0 + pxor mm2, mm2 ; mm2=0 + + movq mm4, [esi] ; g1: mm4=src3 src2 src1 src0 + punpcklbw mm1, mm2 ; mm1=00a3 00a2 00a1 00a0 + + cmp word [alpharate], 255 + jz .loopqword ; + +.calcamask: + movq mm0, [alpharate]; + pmullw mm1, mm0; mm1=mm1 * rate + psrlw mm1, 8 ; mm1=mm1 / 256 + pand mm1, [alphamask]; + + align 16 +.loopqword: + mov edx, [eax] + + test ebx, 0xfffffffc ; check if only 3 pixel left + jnz .lp1 + jmp .checkback ; 3 or less pixel left +.lp1: + cmp edx, 0xffffffff ; test for alpha value of 0 + jne .lp2 + cmp word rate,255 + jne .lp2 + jmp .copyback ; if 1's copy the source pixel to destination +.lp2: + test edx, 0xffffffff ; test for alpha value of 1 + jnz .lp3 ; + jmp .leavefront ; if so go to the next 4 pixel +.lp3: + por mm1, mm1 ; + jnz .lp4 + jmp .leavefront +.lp4: +; green +; i+a*src+(63-a)*dst +; i=(i+32)+((i+32)>>6>>6 +; red/blue +; i+a*src+(31-a)*dst +; i=(i+32)+((i+32)>>5>>5 + + movq mm5, [edi] ; g2: mm5=dst3 dst2 dst1 dst0 + psrlw mm1, 2 ; mm1=a? >>2 nule out lower 2bit + + movq mm7, [maskshiftg]; g3: mm7=1 bit shifted gree mask + psrlw mm4, 1 ; g3a: move src green down by 1 so that we dont overflow + + movq mm0, mm1 ; mm0=00a3 00a2 00a1 00a0 + psrlw mm5, 1 ; g3a: move dst green down by 1 so that we dont overflow + + psrlw mm1, 1 ; mm1=a? >>1 nuke out lowe 1 bit + pand mm4, mm7 ; g5: mm4=sg3 sg2 sg1 sg0 + + movq mm2, [sixones] ; g4 mm2 = 63 + pand mm5, mm7 ; g7: mm5=dg3 dg2 dg1 dg0 + + movq mm3, [esi] ; b1: mm3=src3 src2 src1 src0 + psubsb mm2, mm0 ; g6: mm2=63-a3 63-a2 63-a1 63-a0 + + movq mm7, [maskb16] ; b2: mm7=blue mask + pmullw mm4, mm0 ; g8: mm4=sg * a? + + movq mm0, [edi] ; b3: mm0=dst3 dst2 dst1 dst0 + pmullw mm5, mm2 ; g9: mm5=dg? * (1-a?) + + movq mm2, mm7 ; b4: mm2=finevones + pand mm3, mm7 ; b4: mm3=sb3 sb2 sb1 sb0 + + pmullw mm3, mm1 ; b6: mm3=sb? * a? + pand mm0, mm7 ; b5: mm0=db3 sb2 db1 db0 + + movq mm7, [esi] ; r1: mm7=src3 src2 src1 src0 + paddw mm4, mm5 ; g10: mm4=sg? * a? + dg? * (1-a?) + + pand mm7, [maskr16] ; r2: mm7=sr3 sr2 sr1 sr0 + psubsb mm2, mm1 ; b5a mm2=31-a3 31-a2 31-a1 31-a0 + + paddw mm4, [fivetwelve]; g11: mm4=(mm4+512) green + pmullw mm0, mm2 ; b7: mm0=db? * (1-a?) + + movq mm5, mm4 ; g12: mm5=mm4 green + psrlw mm7, 11 ; r4: shift src red down to position 0 + + psrlw mm4, 6 ; g13: mm4=mm4 >> 6 + + paddw mm4, mm5 ; g14: mm4=mm4+mm5 green + + paddw mm0, mm3 ; b8: mm0=sb? * a? + db? * (1-a?) + + movq mm5, [edi] ; r3: mm5 = dst3 dst2 dst1 dst0 + + paddw mm0, [sixteen] ; b9: mm0=(mm0+16) blue + + pand mm5, [maskr16] ; r5: mm5=dr3 dr2 dr1 dr0 + psrlw mm4, 5 ; g15: mm4=0?g0 0?g0 0?g0 0?g0 green + + movq mm3, mm0 ; b10: mm3=mm0 blue + psrlw mm0, 5 ; b11: mm0=mm0 >> 5 blue + + psrlw mm5, 11 ; r6: shift dst red down to position 0 + paddw mm0, mm3 ; b12: mm0=mm3+mm0 blue + + psrlw mm0, 5 ; b13: mm0=000b 000b 000b 000b blue + pmullw mm7, mm1 ; mm7=sr? * a? + + pand mm4, [maskg16] ; g16: mm4=00g0 00g0 00g0 00g0 green + pmullw mm5, mm2 ; r7: mm5=dr? * (31-a?) + + por mm0, mm4 ; mm0=00gb 00gb 00gb 00gb + + add eax, 4 ; move to bext 4 alphas + add esi, 8 ; move to next 4 pixel in src + add edi, 8 ; move to next 4 pixel in dst + add ebp, 8 ; move to next 4 pixel in write + + + paddw mm5, mm7 ; r8: mm5=sr? * a? + dr? * (31-a?) + + paddw mm5, [sixteen] ; r9: mm5=(mm5+16) red + + movq mm7, mm5 ; r10: mm7=mm5 + psrlw mm5, 5 ; r11: mm5=mm5>>5 red + + paddw mm5, mm7 ; r12: mm5=mm7+mm5 + + psrlw mm5, 5 ; r13: mm5=mm5>>5 red + + psllw mm5, 11 ; r14: mm5=mm5<10 red + + por mm0, mm5 ; mm0=0rgb 0rgb 0rgb 0rgb + + sub ebx, 4 ; polished off 4 pixels + + movq [ebp-8], mm0 ; write = 0rgb 0rgb 0rgb 0rgb + jmp .primeloop ; go back to start + +.copyback: + movq [ebp], mm4 ; copy souce to write + +.leavefront: + add esi, 8 ; advance source by 4 pixel + add edi, 8 ; advance destination 4 pixels + add ebp, 8 ; advance write 4 pixels + add eax, 4 ; advance alpha by 4 pixels + sub ebx, 4 ; decrease pixel count by 4 + jmp .primeloop + +.checkback: + test ebx, 0xff ; check if 0 pixel left + jnz .lp6 + jmp .nextline +.lp6 + movq mm5, [edi] ; g2: mm5=dst3 dst2 dst1 dst0 + psrlw mm1, 2 ; mm1=a? >>2 nule out lower 2bit + + movq mm7, [maskshiftg]; g3: mm7=1 bit shifted gree mask + psrlw mm4, 1 ; g3a: move src green down by 1 so that we dont overflow + + movq mm0, mm1 ; mm0=00a3 00a2 00a1 00a0 + psrlw mm5, 1 ; g3a: move dst green down by 1 so that we dont overflow + + psrlw mm1, 1 ; mm1=a? >>1 nuke out lowe 1 bit + pand mm4, mm7 ; g5: mm4=sg3 sg2 sg1 sg0 + + movq mm2, [sixones] ; g4 mm2 = 63 + pand mm5, mm7 ; g7: mm5=dg3 dg2 dg1 dg0 + + movq mm3, [esi] ; b1: mm3=src3 src2 src1 src0 + psubsb mm2, mm0 ; g6: mm2=63-a3 63-a2 63-a1 63-a0 + + movq mm7, [maskb16] ; b2: mm7=blue mask + pmullw mm4, mm0 ; g8: mm4=sg * a? + + movq mm0, [edi] ; b3: mm0=dst3 dst2 dst1 dst0 + pmullw mm5, mm2 ; g9: mm5=dg? * (1-a?) + + movq mm2, mm7 ; b4: mm2=finevones + pand mm3, mm7 ; b4: mm3=sb3 sb2 sb1 sb0 + + pmullw mm3, mm1 ; b6: mm3=sb? * a? + pand mm0, mm7 ; b5: mm0=db3 sb2 db1 db0 + + movq mm7, [esi] ; r1: mm7=src3 src2 src1 src0 + paddw mm4, mm5 ; g10: mm4=sg? * a? + dg? * (1-a?) + + pand mm7, [maskr16] ; r2: mm7=sr3 sr2 sr1 sr0 + psubsb mm2, mm1 ; b5a mm2=31-a3 31-a2 31-a1 31-a0 + + paddw mm4, [fivetwelve]; g11: mm4=(mm4+512) green + pmullw mm0, mm2 ; b7: mm0=db? * (1-a?) + + movq mm5, mm4 ; g12: mm5=mm4 green + psrlw mm7, 11 ; r4: shift src red down to position 0 + + psrlw mm4, 6 ; g13: mm4=mm4 >> 6 + + paddw mm4, mm5 ; g14: mm4=mm4+mm5 green + + paddw mm0, mm3 ; b8: mm0=sb? * a? + db? * (1-a?) + + movq mm5, [edi] ; r3: mm5 = dst3 dst2 dst1 dst0 + + paddw mm0, [sixteen] ; b9: mm0=(mm0+16) blue + + pand mm5, [maskr16] ; r5: mm5=dr3 dr2 dr1 dr0 + psrlw mm4, 5 ; g15: mm4=0?g0 0?g0 0?g0 0?g0 green + + movq mm3, mm0 ; b10: mm3=mm0 blue + psrlw mm0, 5 ; b11: mm0=mm0 >> 5 blue + + psrlw mm5, 11 ; r6: shift dst red down to position 0 + paddw mm0, mm3 ; b12: mm0=mm3+mm0 blue + + psrlw mm0, 5 ; b13: mm0=000b 000b 000b 000b blue + pmullw mm7, mm1 ; mm7=sr? * a? + + pand mm4, [maskg16] ; g16: mm4=00g0 00g0 00g0 00g0 green + pmullw mm5, mm2 ; r7: mm5=dr? * (31-a?) + + por mm0, mm4 ; mm0=00gb 00gb 00gb 00gb + add eax, 4 + + paddw mm5, mm7 ; r8: mm5=sr? * a? + dr? * (31-a?) + + paddw mm5, [sixteen] ; r9: mm5=(mm5+16) red + + movq mm7, mm5 ; r10: mm7=mm5 + psrlw mm5, 5 ; r11: mm5=mm5>>5 red + + paddw mm5, mm7 ; r12: mm5=mm7+mm5 + + psrlw mm5, 5 ; r13: mm5=mm5>>5 red + + psllw mm5, 11 ; r14: mm5=mm5<10 red + + por mm0, mm5 ; mm0=0rgb 0rgb 0rgb 0rgb + test ebx, 2 ; check if there are 2 pixel + jz .oneendpixel ; goto one pixel if thats it + + ;movd [edi], mm0 ; dst = 0000 000 0rgb 0rgb + movd [ebp], mm0 ; dst = 0000 000 0rgb 0rgb + psrlq mm0, 32 ; mm0 >> 32 + + add edi, 4 ; edi=edi+4 + add ebp, 4 ; ebp=ebp+4 + sub ebx, 2 ; save 2 pixels + jz .nextline ; all done goto next line + +.oneendpixel: + movd edx, mm0 ; edx=0rgb + + ;mov [edi], dx ; dst=0rgb + mov [ebp], dx ; dst=0rgb + +.nextline: + dec ecx ; nuke one line + jz .done ; all done + + mov eax, alpha ;eax=a + mov esi, src ;esi=src + mov edi, dst ;edi=dst + mov ebp, write ;ebp=write + + add eax, pitcha ;pitch alpha + add esi, pitchs ;pitch sorce + add edi, pitchd ;pitch destinate + add ebp, pitchw ;pitch write + + mov alpha, eax + mov ebx, width + mov src, esi + mov dst, edi + mov write, ebp + + jmp .primeloop +.done: + emms + + pop edi + pop esi + pop edx + pop ecx + pop ebx + pop ebp + ret diff --git a/src/ags.c b/src/ags.c new file mode 100644 index 0000000..23c873c --- /dev/null +++ b/src/ags.c @@ -0,0 +1,881 @@ +/* + * ags.c system35のグラフィックブリッジ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ags.c,v 1.34 2004/10/31 04:18:05 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" +#include "graphicsdevice.h" +#include "alpha_plane.h" +#include "counter.h" +#include "eucsjis.h" +#include "imput.h" +#include "flood.h" +#include "font.h" +#include "cursor.h" + +#define check_param ags_check_param +#define check_param_xy ags_check_param_xy +#define intersection ags_intersection + +static void initPal(Pallet256 *sys_pal); +static boolean intersects(MyRectangle *r1, MyRectangle *r2); + +static Pallet256 pal_256; +static boolean need_update = TRUE; +static boolean fade_outed = FALSE; +static int cursor_move_time = 50; /* カーソル移動にかかる時間(ms) */ + +static void initPal(Pallet256 *pal) { + int i; + for (i = 0; i < 256; i++) { + pal->red[i] = 0; pal->green[i] = 0; pal->blue[i] = 0; + } + pal->red[0] = 0; pal->green[0] = 0; pal->blue[0] = 0; + pal->red[7] = 255; pal->green[7] = 255; pal->blue[7] = 255; + pal->red[15] = 255; pal->green[15] = 255; pal->blue[15] = 255; + pal->red[255] = 255; pal->green[255] = 255; pal->blue[255] = 255; + SetPallet(pal, 0, 256); + nact->sys_pal_changed = TRUE; +} + +boolean ags_regionContains(MyRectangle *r, int x, int y) { + return x >= r->x && x < r->x + r->width && y >= r->y && y < r->y + r->height; +} + +static boolean intersects(MyRectangle *r1, MyRectangle *r2) { + return !((r2->x + r2->width <= r1->x) || + (r2->y + r2->height <= r1->y) || + (r2->x >= r1->x + r1->width) || + (r2->y >= r1->y + r1->height)); +} + +void ags_intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst) { + int x1 = max(r1->x, r2->x); + int x2 = min(r1->x + r1->width, r2->x + r2->width); + int y1 = max(r1->y, r2->y); + int y2 = min(r1->y + r1->height, r2->y + r2->height); + rst->x = x1; + rst->y = y1; + rst->width = x2 - x1; + rst->height = y2 - y1; +} + +boolean ags_check_param(int *x, int *y, int *w, int *h) { + if (*x >= nact->sys_world_size.width) { + WARNING("Illegal Param x = %d (max=%d)(@%03x:%05x)\n", *x, nact->sys_world_size.width, sl_getPage(), sl_getIndex()); + return FALSE; + } + if (*y >= nact->sys_world_size.height) { + WARNING("Illegal Param y = %d (max=%d)\n", *y, nact->sys_world_size.height); + return FALSE; + } + + if (*x < 0) { *w += *x; *x = 0; } + if (*y < 0) { *h += *y; *y = 0; } + + if ((*x + *w) > nact->sys_world_size.width) { *w = nact->sys_world_size.width - *x;} + if ((*y + *h) > nact->sys_world_size.height) { *h = nact->sys_world_size.height - *y;} + + if (*w <= 0) return FALSE; + if (*h <= 0) return FALSE; + + return TRUE; +} + +boolean ags_check_param_xy(int *x, int *y) { + if (*x >= nact->sys_world_size.width) { + WARNING("Illegal Param x = %d\n", *x); + return FALSE; + } + if (*y >= nact->sys_world_size.height) { + WARNING("Illegal Param y = %d\n", *y); + return FALSE; + } + + if (*x < 0) { *x = 0; } + if (*y < 0) { *y = 0; } + + return TRUE; +} + +void ags_init() { + nact->sys_mouse_movesw = 2; /* 0:IZを無視, 1: 直接指定場所へ, 2: スムーズに指定場所に */ + nact->sys_pal = &pal_256; + nact->sys_world_size.width = SYS35_DEFAULT_WIDTH; + nact->sys_world_size.height = SYS35_DEFAULT_HEIGHT; + nact->sys_world_depth = SYS35_DEFAULT_DEPTH; + nact->sys_view_area.x = 0; + nact->sys_view_area.y = 0; + nact->sys_view_area.width = SYS35_DEFAULT_WIDTH; + nact->sys_view_area.height = SYS35_DEFAULT_HEIGHT; + + GraphicsInitilize(); + + font_init(nact->fontdev); + SetFontDevice(nact->ags.font); + + initPal(&pal_256); + cg_init(); +} + +void ags_remove() { + ags_autorepeat(TRUE); + GraphicsRemove(); +} + +void ags_setWorldSize(int width, int height, int depth) { + nact->sys_world_size.width = width; + nact->sys_world_size.height = height; + nact->sys_world_depth = depth; + SetWorldSize(width, height, depth); + + nact->ags.dib = GetDIB(); + nact->ags.dib->has_alpha = FALSE; + nact->ags.dib->has_pixel = TRUE; + + /* DIBが8以上の場合は、alpha plane を用意 */ + if (depth > 8) { + if (nact->ags.dib->alpha != NULL) { + g_free(nact->ags.dib->alpha); + } + nact->ags.dib->alpha = g_new0(BYTE, width * height); + nact->ags.dib->has_alpha = TRUE; + } + + fade_outed = FALSE; /* thanx tajiri@wizard */ + + nact->sys_pal_changed = TRUE; +} + +void ags_setViewArea(int x, int y, int width, int height) { + nact->sys_view_area.x = x; + nact->sys_view_area.y = y; + + nact->sys_view_area.width = width; + nact->sys_view_area.height = height; + SetWindowSize(x, y, width, height); +} + +void ags_setWindowTitle(char *src) { +#define TITLEHEAD "XSystem35 Version "VERSION":" + BYTE *dst, *d; + + dst = sjis2lang(src); + if (NULL == (d = malloc(strlen(dst) + strlen(TITLEHEAD) + 1))) { + NOMEMERR(); + } + strcpy(d, TITLEHEAD); + strcat(d, dst); + SetWindowTitle(d); + free(dst); + free(d); +} + +void ags_getDIBInfo(DispInfo *info) { + info->width = nact->sys_world_size.width; + info->height = nact->sys_world_size.height; + info->depth = nact->sys_world_depth; +} + +void ags_getViewAreaInfo(DispInfo *info) { + GetWindowInfo(info); + info->width = nact->sys_view_area.width; + info->height = nact->sys_view_area.height; +} + +void ags_getWindowInfo(DispInfo *info) { + GetWindowInfo(info); +} + +void ags_setExposeSwitch(boolean bool) { + need_update = bool; +} + +void ags_updateArea(int x, int y, int w, int h) { + MyRectangle r, update; + MyPoint p; + + if (fade_outed) return; + + if (need_update) { + r.x = x; r.y = y; r.width = w; r.height = h; + if (intersects(&nact->sys_view_area, &r)) { + intersection(&nact->sys_view_area, &r, &update); + p.x = update.x - nact->sys_view_area.x; + p.y = update.y - nact->sys_view_area.y; + UpdateArea(&update, &p); + } + } +} + +void ags_updateFull() { + MyPoint p = {0, 0}; + MyRectangle r; + + if (fade_outed) return; + + if (need_update) { + r.x = nact->sys_view_area.x; + r.y = nact->sys_view_area.y; + r.width = min(nact->sys_view_area.width, nact->sys_world_size.width); + r.height = min(nact->sys_view_area.height, nact->sys_world_size.height); + UpdateArea(&r, &p); + } +} + +void ags_setPallets(Pallet256 *src_pal, int src, int dst, int cnt) { + int i; + for (i = 0; i < cnt; i++) { + nact->sys_pal->red [dst + i] = src_pal->red [src + i]; + nact->sys_pal->green[dst + i] = src_pal->green[src + i]; + nact->sys_pal->blue [dst + i] = src_pal->blue [src + i]; + } + nact->sys_pal_changed = TRUE; +} + +void ags_setPallet(int no, int red, int green, int blue) { + nact->sys_pal->red[no] = red; + nact->sys_pal->green[no] = green; + nact->sys_pal->blue[no] = blue; + nact->sys_pal_changed = TRUE; +} + +void ags_setPalletToSystem(int src, int cnt) { + if (!fade_outed) + SetPallet(nact->sys_pal, src, cnt); +} + +void ags_drawRectangle(int x, int y, int w, int h, int col) { + if (!check_param(&x, &y, &w, &h)) return; + + DrawRectangle(x, y, w, h, col); +} + +void ags_fillRectangle(int x, int y, int w, int h, int col) { + if (!check_param(&x, &y, &w, &h)) return; + + FillRectangle(x, y, w, h, col); +} + +void ags_drawLine(int x0, int y0, int x1, int y1, int col) { + if (!check_param_xy(&x0, &y0)) return; + if (!check_param_xy(&x1, &y1)) return; + + DrawLine(x0, y0, x1, y1, col); +} + +void ags_copyArea(int sx, int sy, int w, int h, int dx, int dy) { + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + CopyArea(sx, sy, w, h, dx, dy); +} + +void ags_scaledCopyArea(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int mirror_sw) { + if (!check_param(&sx, &sy, &sw, &sh)) return; + if (!check_param(&dx, &dy, &dw, &dh)) return; + + DspDeviceSync(); /* Device依存の sync (ex. XSync()) */ + ScaledCopyArea(sx, sy, sw, sh, dx, dy, dw, dh, mirror_sw); +} + +void ags_copyAreaSP(int sx, int sy, int w, int h, int dx, int dy, int col) { + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyAreaSP(sx, sy, w, h, dx, dy, col); +} + +void ags_wrapColor(int x, int y, int w, int h, int p1, int p2) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&x, &y, &w, &h)) return; + + DspDeviceSync(); + WrapColor(x, y, w, h, p1, p2); +} + +void ags_getPixel(int x, int y, Pallet *cell) { + if (!check_param_xy(&x, &y)) return; + + DspDeviceSync(); + GetPixel(x, y, cell); +} + +void ags_changeColorArea(int sx, int sy, int w, int h, int dst, int src, int cnt) { + if (nact->sys_world_depth != 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + + DspDeviceSync(); + { + agsurface_t *dib = nact->ags.dib; + int x, y; + int src_last = src + cnt,dif = dst - src; + BYTE *yl; + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + + for (y = 0; y < h; y++) { + yl = sdata + y * dib->bytes_per_line; + for (x = 0; x < w; x++) { + if (*yl >= src && *yl < src_last) *yl += dif; + yl++; + } + } + } +} + +void* ags_saveRegion(int x, int y, int w, int h) { + if (!check_param(&x, &y, &w, &h)) return NULL; + + DspDeviceSync(); + return (void *)SaveRegion(x, y, w, h); +} + +void ags_restoreRegion(void *region, int x, int y) { + if (region == NULL) return; + + if (!check_param_xy(&x, &y)) return; + + DspDeviceSync(); + RestoreRegion(region, x, y); +} + +void ags_putRegion(void *region, int x, int y) { + if (region == NULL) return; + + if (!check_param_xy(&x, &y)) return; + + DspDeviceSync(); + PutRegion(region, x, y); +} + +void ags_copyRegion(void *region, int sx, int sy , int w, int h, int dx, int dy) { + if (region == NULL) return; + + if (!check_param_xy(&dx, &dy)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyRegion(region, sx, sy, w, h, dx, dy); +} + +void ags_delRegion(void *region) { + if (region == NULL) return; + + DspDeviceSync(); + DelRegion(region); +} + +int ags_drawString(int x, int y, char *src, int col) { + int w; + + if (!check_param_xy(&x, &y)) return 0; + + DspDeviceSync(); + w = DrawString(x, y, src, col); + + return w; +} + +void ags_drawCg8bit(cgdata *cg, int x, int y) { + int sx, sy, w, h; + + sx = x; + sy = y; + w = cg->width; + h = cg->height; + + if (!check_param(&x, &y, &w, &h)) return; + + cg->data_offset = abs(sy - y) * cg->width + abs(sx - x); + DspDeviceSync(); + DrawImage8_fromData(cg, x, y, w, h); +} + +void ags_drawCg16bit(cgdata *cg, int x, int y) { + int sx, sy, w, h; + + sx = x; + sy = y; + w = cg->width; + h = cg->height; + + if (!check_param(&x, &y, &w, &h)) return; + + cg->data_offset = abs(sy - y) * cg->width + abs(sx - x); + DspDeviceSync(); + DrawImage16_fromData(cg, x, y, w, h); +} + +void ags_copyArea_shadow(int sx, int sy, int w, int h, int dx, int dy) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyAreaSP16_shadow(sx, sy, w, h, dx, dy); +} + +void ags_copyArea_transparent(int sx, int sy, int w, int h, int dx, int dy, int col) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyAreaSP(sx, sy, w, h, dx, dy, col); +} + +void ags_copyArea_alphaLevel(int sx, int sy, int w, int h, int dx, int dy, int lv) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyAreaSP16_alphaLevel(sx, sy, w, h, dx, dy, lv); +} + +void ags_copyArea_alphaBlend(int sx, int sy, int w, int h, int dx, int dy, int lv) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyAreaSP16_alphaBlend(sx, sy, w, h, dx, dy, lv); +} + +void ags_copyArea_whiteLevel(int sx, int sy, int w, int h, int dx, int dy, int lv) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyAreaSP16_whiteLevel(sx, sy, w, h, dx, dy, lv); +} + + +/******************************************************* + * + * special thanks to tajiri@wizard.elec.waseda.ac.jpさん + * + *******************************************************/ +/* CP コマンドの実装用. 同じ色で出来た領域を指定された + 色で塗り変える。 +*/ +static int floodColor; +static int changeColor; +static agsurface_t *__img; +/*この操作のあとにアップデートする領域 + (updatePointTop と updatePointEndで囲まれた長方形) + */ +static MyPoint updatePointTop, updatePointEnd; + +static int pixcel(int x, int y) { + int pixval; + + if ((y >= 0) && (y <= __img->height) && (x >= 0) && (x <= __img->width)) { + BYTE *dst = (BYTE *)(__img->pixel + y * __img->bytes_per_line + x); + pixval = *dst; + + if (pixval == floodColor){ + /* if(pixval <= floodColor+2 && pixval >= floodColor-2){ */ + *dst = changeColor; + if (x < updatePointTop.x) updatePointTop.x = x; + if (x > updatePointEnd.x) updatePointEnd.x = x; + if (y < updatePointTop.y) updatePointTop.y = y; + if (y > updatePointEnd.y) updatePointEnd.y = y; + return TRUE; + } + } + return FALSE; +} + +MyRectangle* ags_imageFlood(int x, int y, int c) { + if (nact->sys_world_depth != 8) return NULL; + + if (!check_param_xy(&x, &y)) return NULL; + + DspDeviceSync(); + +{ + agsurface_t *dib = nact->ags.dib; + BYTE *dst = GETOFFSET_PIXEL(dib, x, y); + static MyRectangle rec; + __img = dib; + updatePointTop.x = x; + updatePointTop.y = y; + updatePointEnd.x = x; + updatePointEnd.y = y; + /*直線はぬりなおしたりしない!!*/ + if ((x <= 0 || (*(dst - 1) != *(dst))) && ((x >= dib->width) || (*(dst + 1) != *dst))) + return NULL; + if ((y <= 0 || (*(dst - dib->bytes_per_line) != *(dst))) + && ((y >= dib->height) || (*(dst + dib->bytes_per_line) != *dst))) + return NULL; + floodColor = *dst; + + changeColor = c; + flood(x, y, pixcel); + rec.x = updatePointTop.x; + rec.y = updatePointTop.y; + rec.width = updatePointEnd.x - updatePointTop.x + 1; + rec.height = updatePointEnd.y - updatePointTop.y + 1; + return &rec; +} +} + +void ags_copyFromAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flg) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + Copy_from_alpha(sx, sy, w, h, dx, dy, flg); +} + +void ags_copyToAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flg) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + Copy_to_alpha(sx, sy, w, h, dx, dy, flg); +} + +void ags_alpha_uppercut(int sx, int sy, int w, int h, int s, int d) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + + alpha_uppercut(nact->ags.dib, sx, sy, w, h, s, d); +} + +void ags_alpha_lowercut(int sx, int sy, int w, int h, int s, int d) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + + alpha_lowercut(nact->ags.dib, sx, sy, w, h, s, d); +} + +void ags_alpha_setLevel(int x, int y, int w, int h, int lv) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&x, &y, &w, &h)) return; + + alpha_set_level(nact->ags.dib, x, y, w, h, lv); +} + +void ags_alpha_copyArea(int sx, int sy, int w, int h, int dx, int dy) { + if (nact->sys_world_depth == 8) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + alpha_copy_area(nact->ags.dib, sx, sy, w, h, dx, dy); +} + +void ags_alpha_getPixel(int x, int y, int *pic) { + if (nact->sys_world_depth == 8) return; + + if (!check_param_xy(&x, &y)) { + *pic = 0; + } else { + alpha_get_pixel(nact->ags.dib, x, y, (BYTE *)pic); + } +} + +void ags_alpha_setPixel(int x, int y, int w, int h, BYTE *b) { + int savex, savey, savew, saveh, offset; + + savex = x; + savey = y; + savew = w; + saveh = h; + + if (!check_param(&x, &y, &w, &h)) return; + + offset = abs(savey - y) * savew + abs(savex - x); + + alpha_set_pixels(nact->ags.dib, x, y, w, h, b + offset, savew); +} + +/* + * fade in/out の wait 制御 + */ +void ags_fader(ags_faderinfo_t *i) { + int cnt_st, step, key = 0, canceled_key = 0; + cnt_st = get_high_counter(SYSTEMCOUNTER_MSEC); + + i->callback(0); + + if (i->effect_time == 0) goto out; + + step = 1; + while(step < i->step_max) { + int lefttime, leftstep, mstime, cnt1, cnt2; + + cnt1 = get_high_counter(SYSTEMCOUNTER_MSEC); + i->callback(step); + key = sys_getInputInfo(); + /* 実際の fade にかかった時間 */ + usleep(0); /* It's a magic !!! */ + cnt2 = get_high_counter(SYSTEMCOUNTER_MSEC) - cnt1; + + lefttime = i->effect_time - (cnt1 + cnt2 - cnt_st); /* fade 残り時間 */ + leftstep = i->step_max - step; /* fade 残りステップ数 */ + + if (lefttime <= 0) break; /* 時間切れ */ + if (leftstep <= 0) break; + + mstime = lefttime / leftstep; /* 1stepに許される時間 */ + if (mstime > cnt2) { + /* wait をいれる余裕がある場合 */ + key = sys_keywait(mstime - cnt2, i->cancel); + step++; + } else if (mstime > 0) { + /* wait をいれる余裕が無い場合 */ + step += ((cnt2+1) * leftstep / lefttime); + nact->callback(); + } else { + break; + } + /* wait cancel が有効の場合 */ + if (i->cancel) { + if (key != 0) { + canceled_key = key; + break; + } + } + } + out: + /* fader last step */ + i->callback(i->step_max); + + /* store canceled key */ + nact->waitcancel_key = canceled_key; +} + +void ags_fadeIn(int rate, boolean flag) { + ags_faderinfo_t i; + + if (need_update) { + i.effect_time = (rate * 16 * 1000) / 60; + i.cancel = flag; + } else { + i.effect_time = 0; + } + fade_outed = FALSE; + + nact->waitcancel_key = 0; + + i.callback = FadeIn; + i.step_max = 255; + ags_fader(&i); +} + +void ags_fadeOut(int rate, boolean flag) { + ags_faderinfo_t i; + + if (need_update && !fade_outed) { + i.effect_time = (rate * 16 * 1000) / 60; + i.cancel = flag; + } else { + i.effect_time = 0; + } + fade_outed = TRUE; + + nact->waitcancel_key = 0; + + i.callback = FadeOut; + i.step_max = 255; + ags_fader(&i); +} + +void ags_whiteIn(int rate, boolean flag) { + ags_faderinfo_t i; + if (need_update) { + i.effect_time = (rate * 16 * 1000) / 60; + i.cancel = flag; + } else { + i.effect_time = 0; + } + fade_outed = FALSE; + + nact->waitcancel_key = 0; + + i.callback = WhiteIn; + i.step_max = 255; + ags_fader(&i); +} + +void ags_whiteOut(int rate, boolean flag) { + ags_faderinfo_t i; + if (need_update && !fade_outed) { + i.effect_time = (rate * 16 * 1000) / 60; + i.cancel = flag; + } else { + i.effect_time = 0; + } + fade_outed = TRUE; + + nact->waitcancel_key = 0; + + i.callback = WhiteOut; + i.step_max = 255; + ags_fader(&i); +} + +void ags_setFont(int type, int size) { + nact->ags.font->sel_font(type, size); +} + +void ags_setCursorType(int type) { + if (nact->noimagecursor && type >= 100) return; + SetCursorType(type); +} + +void ags_loadCursor(int p1,int p2) { + if (!nact->noimagecursor) { + cursor_load(p1, p2); + } +} + +void ags_setCursorLocation(int x, int y, boolean is_dibgeo) { + int dx[8], dy[8]; + int i, delx, dely; + MyPoint p; + if (!check_param_xy(&x, &y)) return; + + /* DIB 座表系か Window 座表系か */ + if (is_dibgeo) { + x -= nact->sys_view_area.x; + y -= nact->sys_view_area.y; + } + + switch(nact->sys_mouse_movesw) { + case 0: + return; + case 1: + SetCursorLocation(x, y); break; + case 2: + sys_getMouseInfo(&p, is_dibgeo); + delx = x - p.x; + dely = y - p.y; + + for (i = 1; i < 8; i++) { + dx[i-1] = ((delx*i*i*i) >> 9) - ((3*delx*i*i)>> 6) + ((3*delx*i) >> 3) + p.x; + dy[i-1] = ((dely*i*i*i) >> 9) - ((3*dely*i*i)>> 6) + ((3*dely*i) >> 3) + p.y; + } + dx[7] = x; dy[7] = y; + + for (i = 0; i < 8; i++) { + SetCursorLocation(dx[i], dy[i]); + usleep(cursor_move_time * 1000 / 8); + } + break; + default: + return; + } +} + +void ags_setAntialiasedStringMode(boolean on) { + if (!nact->noantialias) { + nact->ags.font->antialiase_on = on; + } +} + +boolean ags_getAntialiasedStringMode() { + return nact->ags.font->antialiase_on; +} + +void ags_fullscreen(boolean on) { + nact->sys_fullscreen_on = on; + FullScreen(on); +} + +void ags_copyArea_shadow_withrate(int sx, int sy, int w, int h, int dx, int dy, int lv) { + if (nact->sys_world_depth == 8) return; + + if (lv == 0) return; + + if (!check_param(&sx, &sy, &w, &h)) return; + if (!check_param(&dx, &dy, &w, &h)) return; + + DspDeviceSync(); + CopyAreaSP16_shadow_withRate(sx, sy, w, h, dx, dy, lv); +} + +void ags_setCursorMoveTime(int msec) { + cursor_move_time = msec; +} + +int ags_getCursorMoveTime() { + return cursor_move_time; +} + +/* + * 指定の領域に全画面をZoom + * + */ +void ags_zoom(int x, int y, int w, int h) { + if (!check_param(&x, &y, &w, &h)) return; + + DspDeviceSync(); + Zoom(x, y, w, h); +} + +agsurface_t *ags_getDIB() { + return nact->ags.dib; +} + +void ags_sync() { + DspDeviceSync(); +} + +void ags_fillRectangleNeg(int x, int y, int w, int h, int col) { + if (!check_param(&x, &y, &w, &h)) return; + + DspDeviceSync(); + image_fillRectangleNeg(nact->ags.dib, x, y, w, h, col); +} + +void ags_autorepeat(boolean bool) { + SetAutoRepeat(bool); +} diff --git a/src/ags.h b/src/ags.h new file mode 100644 index 0000000..908cf01 --- /dev/null +++ b/src/ags.h @@ -0,0 +1,362 @@ +/* + * ags.h Alice Graphic System + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ags.h,v 1.25 2004/10/31 04:18:06 chikama Exp $ */ + +#ifndef __AGS_H__ +#define __AGS_H__ + +#include "config.h" + +#include "portab.h" +#include "cg.h" +#include "graphics.h" +#include "font.h" + + +/* マウスカーソルの種類 */ +#define IDC_ARROW 1 +#define IDC_CROSS 2 +#define IDC_IBEAM 3 +#define IDC_ICON 4 +#define IDC_NO 5 +#define IDC_SIZE 6 +#define IDC_SIZEALL 7 +#define IDC_SIZENESW 8 +#define IDC_SIZENS 9 +#define IDC_SIZENWSE 10 +#define IDC_SIZEWE 11 +#define IDC_UPARROW 12 +#define IDC_WAIT 13 + +/* RGB <-> alpha plane copy type */ +typedef enum { + FROM_16H, + FROM_16L, + FROM_24R, + FROM_24G, + FROM_24B, + TO_16H, + TO_16L, + TO_24R, + TO_24G, + TO_24B +} ALPHA_DIB_COPY_TYPE; + +struct __surface { + int no; /* surface number, primary DIB is 0 */ + + int width; /* width of surface */ + int height; /* height of surface */ + int depth; /* depth of surface, 8/15/16/24/32 is available */ + + int bytes_per_line; /* bytes per line */ + int bytes_per_pixel; /* bytes per pixel */ + + BYTE *pixel; /* pointer to pixel data */ + BYTE *alpha; /* pointer to alpha pixel data */ + + boolean has_alpha; + boolean has_pixel; + +}; +typedef struct __surface agsurface_t; + +#define GETOFFSET_PIXEL(suf, x, y) ((suf)->pixel + (y) * (suf)->bytes_per_line + (x) * (suf)->bytes_per_pixel) +#define GETOFFSET_ALPHA(suf, x, y) ((suf)->alpha + (y) * (suf)->width + (x)) + +struct _agsevent { + int type; + int d1, d2, d3; +}; +typedef struct _agsevent agsevent_t; + + +#define AGSEVENT_MOUSE_MOTION 1 +#define AGSEVENT_BUTTON_PRESS 2 +#define AGSEVENT_BUTTON_RELEASE 3 +#define AGSEVENT_KEY_PRESS 4 +#define AGSEVENT_KEY_RELEASE 5 +#define AGSEVENT_TIMER 6 + +#define AGSEVENT_BUTTON_LEFT 1 +#define AGSEVENT_BUTTON_MID 2 +#define AGSEVENT_BUTTON_RIGHT 3 +#define AGSEVENT_WHEEL_UP 4 +#define AGSEVENT_WHEEL_DN 5 + + +/* + * fader 管理情報 + */ +struct ags_faderinfo { + int step_max; /* 最大 step 数 */ + int effect_time; /* 全体の処理にかける時間 */ + + boolean cancel; /* 途中で key 抜けをうけつけるか */ + void (*callback)(int); /* callback 関数 */ +}; +typedef struct ags_faderinfo ags_faderinfo_t; + + +struct _ags { + Pallet256 pal; /* system pallet */ + boolean pal_changed; /* system pallet has changed */ + + MyDimension world_size; /* size of off-screen */ + + MyRectangle view_area; /* view region in off-screen */ + + int world_depth; /* depth of off-screen (bits per pixel) */ + + int mouse_movesw; /* mouse cursor move mode + 0: ignore IZ + 1: move to the geometory direcly + 2: move to the geometory smoothly + */ + + boolean fullscree_is_on; /* if full-screen mode then true */ + + + FONT *font; /* font device */ + agsurface_t *dib; /* main surface */ + void (*eventcb)(agsevent_t *e); /* deliver event */ +}; +typedef struct _ags ags_t; + + + +/* 初期化関係 */ +extern void ags_init(); +extern void ags_remove(); + +/* ウィンド関係 */ +extern void ags_setWorldSize(int width, int height, int depth); +extern void ags_setViewArea(int x, int y, int width, int height); +extern void ags_setWindowTitle(char *str); +extern void ags_getDIBInfo(DispInfo *info); +extern void ags_getWindowInfo(DispInfo *info); +extern void ags_getViewAreaInfo(DispInfo *info); +extern boolean ags_regionContains(MyRectangle *r, int x, int y); +extern void ags_fullscreen(boolean on); +extern boolean ags_check_param(int *x, int *y, int *w, int *h); +extern boolean ags_check_param_xy(int *x, int *y); +extern void ags_intersection(MyRectangle *r1, MyRectangle *r2, MyRectangle *rst); +extern agsurface_t *ags_getDIB(); +extern void ags_sync(); + +/* 画面更新 */ +extern void ags_setExposeSwitch(boolean bool); +extern void ags_updateFull(void); +extern void ags_updateArea(int x, int y, int width, int height); + +/* パレット関係 */ +extern void ags_setPallets(Pallet256 *src_pal, int src, int dst, int cnt); +extern void ags_setPallet(int no, int red, int green, int blue); +extern void ags_setPalletToSystem(int src, int cnt); + +/* 描画関係 */ +extern void ags_drawRectangle(int x, int y, int w, int h, int col); +extern void ags_fillRectangle(int x, int y, int w, int h, int col); +extern void ags_fillRectangleNeg(int x, int y, int w, int h, int col); +extern void ags_drawLine(int x0, int y0, int x1, int y1, int col); +extern void ags_copyArea(int sx, int sy, int w, int h, int dx, int dy); +extern void ags_scaledCopyArea(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int mirror_sw); +extern void ags_zoom(int x, int y, int w, int h); +extern void ags_copyAreaSP(int sx, int sy, int w, int h, int dx, int dy, int col); +extern void ags_copyArea_shadow_withrate(int sx, int sy, int w, int h, int dx, int dy, int lv); + +extern void ags_wrapColor(int x, int y, int w, int h, int p1, int p2); +extern void ags_getPixel(int x, int y, Pallet *cell); +extern void ags_changeColorArea(int x, int y, int w, int h, int dst, int src, int cnt); + +extern void* ags_saveRegion(int x, int y, int w, int h); +extern void ags_restoreRegion(void *region, int x, int y); +extern void ags_putRegion(void *region, int x, int y); +extern void ags_copyRegion(void *region, int sx, int sy, int w,int h,int dx,int dy); +extern void ags_delRegion(void *region); + +extern int ags_drawString(int x, int y, char *src, int col); +extern void ags_drawCg8bit(cgdata *cg, int x, int y); +extern void ags_drawCg16bit(cgdata *cg, int x, int y); + +extern void ags_copyArea_shadow(int sx, int sy, int w, int h, int dx, int dy); +extern void ags_copyArea_transparent(int sx, int sy, int w, int h, int dx, int dy, int col); +extern void ags_copyArea_alphaLevel(int sx, int sy, int w, int h, int dx, int dy, int lv); +extern void ags_copyArea_alphaBlend(int sx, int sy, int w, int h, int dx, int dy, int lv); +extern void ags_copyArea_whiteLevel(int sx, int sy, int w, int h, int dx, int dy, int lv); +extern MyRectangle* ags_imageFlood(int x, int y, int c); +extern void ags_eCopyArea(int sx, int sy, int w, int h, int dx, int dy, int type, int opt, boolean flg, int spCol); + +/* alpha channel 操作 */ +extern void ags_copyFromAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flg); +extern void ags_copyToAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flg); +extern void ags_alpha_uppercut(int sx, int sy, int w, int h, int s, int d); +extern void ags_alpha_lowercut(int sx, int sy, int w, int h, int s, int d); +extern void ags_alpha_setLevel(int x, int y, int w, int h, int lv); +extern void ags_alpha_copyArea(int sx, int sy, int w, int h, int dx, int dy); +extern void ags_alpha_getPixel(int x, int y, int *pic); +extern void ags_alpha_setPixel(int x, int y, int w, int h, BYTE *b); + +/* fader */ +extern void ags_fadeIn(int rate, boolean flg); +extern void ags_fadeOut(int rate, boolean flg); +extern void ags_whiteIn(int rate, boolean flg); +extern void ags_whiteOut(int rate, boolean flg); +extern void ags_fader_callback(); + +/* フォント関連 */ +extern void ags_setFont(int type, int size); + +/* カーソル関係 */ +extern void ags_setCursorType(int type); +extern void ags_loadCursor(int ,int); +extern void ags_setCursorLocation(int x, int y, boolean dibgeo); +extern void ags_setCursorMoveTime(int msec); +extern int ags_getCursorMoveTime(); + +/* misc */ +extern void ags_setAntialiasedStringMode(boolean mode); +extern boolean ags_getAntialiasedStringMode(); +extern void ags_fader(ags_faderinfo_t *); +extern void ags_autorepeat(boolean bool); + +#define RGB_RMASK15 0x7c00 +#define RGB_GMASK15 0x03e0 +#define RGB_BMASK15 0x001f +#define RGB_RMASK16 0xf800 +#define RGB_GMASK16 0x07e0 +#define RGB_BMASK16 0x001f +#define RGB_RMASK24 0x00ff0000 +#define RGB_GMASK24 0x0000ff00 +#define RGB_BMASK24 0x000000ff + +#define BGR_RMASK15 0x001f +#define BGR_GMASK15 0x03e0 +#define BGR_BMASK15 0x7c00 +#define BGR_RMASK16 0x001f +#define BGR_GMASK16 0x07e0 +#define BGR_BMASK16 0xf800 +#define BGR_RMASK24 0x000000ff +#define BGR_GMASK24 0x0000ff00 +#define BGR_BMASK24 0x00ff0000 + +#define RGB_PIXR15(pic) (BYTE)(((pic) & RGB_RMASK15) >> 7) +#define RGB_PIXG15(pic) (BYTE)(((pic) & RGB_GMASK15) >> 2) +#define RGB_PIXB15(pic) (BYTE)(((pic) & RGB_BMASK15) << 3) +#define BGR_PIXR15(pic) (BYTE)(((pic) & BGR_RMASK15) << 3) +#define BGR_PIXG15(pic) (BYTE)(((pic) & BGR_GMASK15) >> 2) +#define BGR_PIXB15(pic) (BYTE)(((pic) & BGR_BMASK15) >> 7) +#define RGB_PIX15(r,g,b) (WORD)((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | ((b ) >> 3)) +#define BGR_PIX15(r,g,b) (WORD)((((r) ) >> 3) | (((g) & 0xf8) << 2) | ((b & 0xf8) << 7)) + +#define RGB_PIXR16(pic) (BYTE)(((pic) & RGB_RMASK16) >> 8) +#define RGB_PIXG16(pic) (BYTE)(((pic) & RGB_GMASK16) >> 3) +#define RGB_PIXB16(pic) (BYTE)(((pic) & RGB_BMASK16) << 3) +#define BGR_PIXR16(pic) (BYTE)(((pic) & BGR_RMASK16) << 3) +#define BGR_PIXG16(pic) (BYTE)(((pic) & BGR_GMASK16) >> 3) +#define BGR_PIXB16(pic) (BYTE)(((pic) & BGR_BMASK16) >> 8) +#define RGB_PIX16(r,g,b) (WORD)((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | ((b ) >> 3)) +#define BGR_PIX16(r,g,b) (WORD)((((r) ) >> 3) | (((g) & 0xfc) << 3) | ((b & 0xf8) << 8)) + +#define RGB_PIXR24(pic) (BYTE)(((pic) & RGB_RMASK24) >> 16) +#define RGB_PIXG24(pic) (BYTE)(((pic) & RGB_GMASK24) >> 8) +#define RGB_PIXB24(pic) (BYTE)(((pic) & RGB_BMASK24) ) +#define BGR_PIXR24(pic) (BYTE)(((pic) & BGR_RMASK24) ) +#define BGR_PIXG24(pic) (BYTE)(((pic) & BGR_GMASK24) >> 8) +#define BGR_PIXB24(pic) (BYTE)(((pic) & BGR_BMASK24) >> 16) +#define RGB_PIX24(r,g,b) (DWORD)((((r) << 16) | ((g) << 8) | (b) )) +#define BGR_PIX24(r,g,b) (DWORD)((((r) ) | ((g) << 8) | (b) << 16)) + +#ifdef RGB_ORDER +#define PIXR15 RGB_PIXR15 +#define PIXG15 RGB_PIXG15 +#define PIXB15 RGB_PIXB15 +#define PIXR16 RGB_PIXR16 +#define PIXG16 RGB_PIXG16 +#define PIXB16 RGB_PIXB16 +#define PIXR24 RGB_PIXR24 +#define PIXG24 RGB_PIXG24 +#define PIXB24 RGB_PIXB24 +#define PIX15 RGB_PIX15 +#define PIX16 RGB_PIX16 +#define PIX24 RGB_PIX24 +#else +#define PIXR15 BGR_PIXR15 +#define PIXG15 BGR_PIXG15 +#define PIXB15 BGR_PIXB15 +#define PIXR16 BGR_PIXR16 +#define PIXG16 BGR_PIXG16 +#define PIXB16 BGR_PIXB16 +#define PIXR24 BGR_PIXR24 +#define PIXG24 BGR_PIXG24 +#define PIXB24 BGR_PIXB24 +#define PIX15 BGR_PIX15 +#define PIX16 BGR_PIX16 +#define PIX24 BGR_PIX24 +#endif + +#define ALPHABLEND15(f, b, a) (PIX15((((PIXR15((f)) - PIXR15((b))) * (a)) >> 8) + PIXR15((b)),\ + (((PIXG15((f)) - PIXG15((b))) * (a)) >> 8) + PIXG15((b)),\ + (((PIXB15((f)) - PIXB15((b))) * (a)) >> 8) + PIXB15((b)))) + +#define ALPHALEVEL15(p, lv) (PIX15(((PIXR15(p) * (lv)) >> 8),\ + ((PIXG15(p) * (lv)) >> 8),\ + ((PIXB15(p) * (lv)) >> 8))) + +#define WHITELEVEL15(p, lv) ALPHABLEND15(0x7fff, p, lv) + +#define ALPHABLEND16(f, b, a) (PIX16((((PIXR16((f)) - PIXR16((b))) * (a)) >> 8)+ PIXR16((b)),\ + (((PIXG16((f)) - PIXG16((b))) * (a)) >> 8)+ PIXG16((b)),\ + (((PIXB16((f)) - PIXB16((b))) * (a)) >> 8)+ PIXB16((b)))) + +#define ALPHALEVEL16(p, lv) PIX16(((PIXR16(p) * (lv)) >> 8),\ + ((PIXG16(p) * (lv)) >> 8),\ + ((PIXB16(p) * (lv)) >> 8)) + +#define RGB_ALPHALEVEL16(p, lv) PIX16(((RGB_PIXR16(p) * (lv)) >> 8),\ + ((RGB_PIXG16(p) * (lv)) >> 8),\ + ((RGB_PIXB16(p) * (lv)) >> 8)) + +#define WHITELEVEL16(p, lv) ALPHABLEND16(0xffff,p,lv) + +#define ALPHABLEND24(f, b, a) (PIX24((((PIXR24((f)) - PIXR24((b))) * (a)) >> 8) + PIXR24((b)),\ + (((PIXG24((f)) - PIXG24((b))) * (a)) >> 8) + PIXG24((b)),\ + (((PIXB24((f)) - PIXB24((b))) * (a)) >> 8) + PIXB24((b)))) + +#define ALPHALEVEL24(p, lv) (PIX24(((PIXR24(p) * (lv)) >> 8),\ + ((PIXG24(p) * (lv)) >> 8),\ + ((PIXB24(p) * (lv)) >> 8))) + +#define WHITELEVEL24(p, lv) ALPHABLEND24(0xffffffff, p, lv) + +#define SUTURADD15(pa, pb) PIX15(MIN(255,PIXR15(pa)+PIXR15(pb)), MIN(255, PIXG15(pa)+PIXG15(pb)), MIN(255, PIXB15(pa)+PIXB15(pb))); +#define SUTURADD16(pa, pb) PIX16(MIN(255,PIXR16(pa)+PIXR16(pb)), MIN(255, PIXG16(pa)+PIXG16(pb)), MIN(255, PIXB16(pa)+PIXB16(pb))); +//#define SUTURADD16(pa, pb) PIX16(MIN(255,(int)(PIXR16(pa))+(int)(PIXR16(pb))), MIN(255, (int)(PIXG16(pa))+(int)(PIXG16(pb))), MIN(255, (int)(PIXB16(pa))+(int)(PIXB16(pb)))); +#define SUTURADD24(pa, pb) PIX24(MIN(255,PIXR24(pa)+PIXR24(pb)), MIN(255, PIXG24(pa)+PIXG24(pb)), MIN(255, PIXB24(pa)+PIXB24(pb))); + + +/* exter methods */ +extern void ablend16_dpd(BYTE *, int, BYTE *, int, int, int, int, int); +extern void ablend16_ppd(BYTE *, BYTE *, BYTE *, int, int, int, int, int, int); +extern void ablend16_ppp(BYTE *, BYTE *, BYTE *, BYTE *, int, int, int, int, int, int, int); + +#endif /* !__AGS_H__ */ diff --git a/src/ald_manager.c b/src/ald_manager.c new file mode 100644 index 0000000..89e7cfe --- /dev/null +++ b/src/ald_manager.c @@ -0,0 +1,112 @@ +/* + * ald_manager.c dri file manager + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ald_manager.c,v 1.3 2001/05/08 05:36:07 chikama Exp $ */ + +#include +#include "portab.h" +#include "dri.h" +#include "cache.h" +#include "ald_manager.h" + +/* drifiles object */ +static drifiles *dri[DRIFILETYPEMAX]; + +/* cache handler for dri file */ +static cacher *cacheid; + +/* + * static maethods +*/ +static void ald_free(dridata *dfile); + +/* + * free dridata + * dfile: dridata to be free +*/ +static void ald_free(dridata *dfile) { + g_free(dfile->data_raw); + g_free(dfile); +} + +/* + * load dri data + * type: data type + * no : file no ( >= 0 ) + * return: loaded dridata object +*/ +dridata *ald_getdata(DRIFILETYPE type, int no) { + dridata *ddata; + + /* check wrong request number */ + if (no < 0) return NULL; + + /* check wrong type */ + if (type >= DRIFILETYPEMAX) return NULL; + + /* check uninitilized data */ + if (dri[type] == NULL) return NULL; + + /* if mmapped */ + if (dri[type]->mmapped) return dri_getdata(dri[type], no); + + /* not mmapped */ + if (NULL == (ddata = (dridata *)cache_foreach(cacheid, (type << 16) + no))) { + ddata = dri_getdata(dri[type], no); + if (ddata != NULL) { + cache_insert(cacheid, (type << 16) + no, (void *)ddata, ddata->size, &(ddata->in_use)); + ddata->in_use = TRUE; + } + } + + return ddata; +} + +/* + * free dri object + * data: object to be free + */ +void ald_freedata(dridata *data) { + if (data == NULL) return; + + if (data->a->mmapped) { + g_free(data); + } else { + data->in_use = FALSE; + } +} + +/* + * Initilize ald manager + * type: data type + * file: file name array + * cnt : number in file name array + * mmap: mmap file or not +*/ +void ald_init(int type, char **file, int cnt, boolean mmap) { + /* check wrong type */ + if (type < DRIFILETYPEMAX) { + dri[type] = dri_init(file, cnt, mmap); + if (!dri[type]->mmapped) { + cacheid = cache_new(ald_free); + } + } +} diff --git a/src/ald_manager.h b/src/ald_manager.h new file mode 100644 index 0000000..f087343 --- /dev/null +++ b/src/ald_manager.h @@ -0,0 +1,46 @@ +/* + * ald_manager.h dri file manager + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ald_manager.h,v 1.3 2003/04/22 16:34:28 chikama Exp $ */ + +#ifndef __ALD_MANAGER__ +#define __ALD_MANAGER__ + +#include "portab.h" +#include "dri.h" + +#define DRIFILETYPEMAX 7 +typedef enum { + DRIFILE_SCO =0, /* scenario data */ + DRIFILE_CG =1, /* graphics data */ + DRIFILE_WAVE=2, /* wave data */ + DRIFILE_MIDI=3, /* midi data */ + DRIFILE_DATA=4, /* misc data */ + DRIFILE_RSC =5, /* resource data */ + DRIFILE_BGM =6 /* stream music data */ +} DRIFILETYPE; + +extern void ald_init(int type, char **file, int cnt, boolean mmap); +extern dridata *ald_getdata(DRIFILETYPE type, int no); +extern void ald_freedata(dridata *data); + +#endif /* !__ALD_MANAGER__ */ + diff --git a/src/alpha_blend16.s b/src/alpha_blend16.s new file mode 100644 index 0000000..ddf1d1c --- /dev/null +++ b/src/alpha_blend16.s @@ -0,0 +1,26 @@ +g;;; from Intel application notes + +%include "nasm.h" + global ablend16_dpd + global ablend16_ppd + global ablend16_ppp + + segment_data + + align 16 + +maskb16 dd 0x001f001f, 0x001f001f +maskg16 dd 0x07e007e0, 0x07e007e0 +maskr16 dd 0xf800f800, 0xf800f800 +maskshiftg dd 0x03f003f0, 0x03f003f0 +sixteen dd 0x00100010, 0x00100010 +fivetwelve dd 0x02000200, 0x02000200 +sixones dd 0x003f003f, 0x003f003f +alpharate dd 0, 0 +alphamask dd 0x00ff00ff, 0x00ff00ff + + segment_code + +%include "ablend16_dpd.s" +%include "ablend16_ppd.s" +%include "ablend16_ppp.s" diff --git a/src/alpha_plane.c b/src/alpha_plane.c new file mode 100644 index 0000000..11b46f9 --- /dev/null +++ b/src/alpha_plane.c @@ -0,0 +1,157 @@ +/* + * alpha_plane.c alpha plane + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: alpha_plane.c,v 1.4 2001/12/16 17:12:55 chikama Exp $ */ + +#include + +#include "portab.h" +#include "ags.h" +#include "alpha_plane.h" + +/* + * Copy alpha pixel from other alpha plane + * dst : destination surface + * dx : location x to be copied + * dy : location y to be copied + * dw : width to be copied + * dh : height to be copied + * src : source alpha plane pixel + * src_pitch: soruce alpha plane pitch +*/ +void alpha_set_pixels(agsurface_t *dst, int dx, int dy, int w, int h, BYTE *src, int src_pitch) { + BYTE *ad = GETOFFSET_ALPHA(dst, dx, dy); + BYTE *as = src; + int i; + + for (i = 0; i < h; i++) { + memcpy(ad, as, w); + ad += dst->width; + as += src_pitch; + } +} + +/* + * Get pixel from alpha plane + * suf: target surface + * x : location x + * y : location y + * pic: acired alpha pixel +*/ +void alpha_get_pixel(agsurface_t *suf, int x, int y, BYTE *pic) { + *pic = *GETOFFSET_ALPHA(suf, x, y); +} + +/* + * Set pixel level to 'd' which lower than 's' + * suf: target surface + * sx : location x + * sy : location y + * w : width + * h : height + * s : top level to be cut + * d : setteled level +*/ +void alpha_lowercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d) { + BYTE *a = GETOFFSET_ALPHA(suf, sx, sy), *b; + int x, y; + + for (y = 0; y < h; y++) { + b = a + y * suf->width; + for (x = 0; x < w; x++) { + if (*b <= (BYTE)s) *b = (BYTE)d; + b++; + } + } +} + +/* + * Set pixel level to 'd' which lower than 's' + * suf: target surface + * sx : location x + * sy : location y + * w : width + * h : height + * s : bottom level to be cut + * d : setteled level +*/ +void alpha_uppercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d) { + BYTE *dp = GETOFFSET_ALPHA(suf, sx, sy); + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + if (*(dp + x) >= (BYTE)s) { + *(dp + x) = (BYTE)d; + } + } + dp += suf->width; + } +} + +/* + * Set alpha level in region + * suf: target surface + * sx : region x + * sy : region y + * w : region width + * h : region height + * lv : level to be set +*/ +void alpha_set_level(agsurface_t *suf, int sx, int sy, int w, int h, int lv) { + BYTE *a = GETOFFSET_ALPHA(suf, sx, sy); + + while(h--){ + memset(a, lv, w); + a += suf->width; + } +} + +/* + * Copy alpha plane + * suf: target surface + * sx : source x + * sy : source y + * w : source width + * h : source height + * dx : destination x + * dy : destination y +*/ +void alpha_copy_area(agsurface_t *suf, int sx, int sy, int w, int h, int dx, int dy) { + BYTE *src = GETOFFSET_ALPHA(suf, sx, sy); + BYTE *dst = GETOFFSET_ALPHA(suf, dx, dy); + + if (sy <= dy && dy < (sy + h)) { + src += (h-1) * suf->width; + dst += (h-1) * suf->width; + while (h--) { + memmove(dst, src, w); + src -= suf->width; + dst -= suf->width; + } + } else { + while(h--) { + memmove(dst, src, w); + src += suf->width; + dst += suf->width; + } + } +} diff --git a/src/alpha_plane.h b/src/alpha_plane.h new file mode 100644 index 0000000..0a6a8b2 --- /dev/null +++ b/src/alpha_plane.h @@ -0,0 +1,37 @@ +/* + * alpha_plane.c alpha plane + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: alpha_plane.h,v 1.2 2001/12/07 15:03:01 chikama Exp $ */ + +#ifndef __ALPHA_PLANE__ +#define __ALPHA_PLANE__ + +#include "portab.h" +#include "ags.h" + +extern void alpha_set_pixels(agsurface_t *dst, int dx, int dy, int w, int h, BYTE *src, int src_pitch); +extern void alpha_get_pixel(agsurface_t *suf, int x, int y, BYTE *pic); +extern void alpha_lowercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d); +extern void alpha_uppercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d); +extern void alpha_set_level(agsurface_t *suf, int sx, int sy, int w, int h, int lv); +extern void alpha_copy_area(agsurface_t *suf, int sx, int sy, int w, int h, int dx, int dy); + +#endif /* !__ALPHA_PLANE__ */ diff --git a/src/antialiase.c b/src/antialiase.c new file mode 100644 index 0000000..e29608f --- /dev/null +++ b/src/antialiase.c @@ -0,0 +1,80 @@ +/* + * antialiase.c make antialiased pattern + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: antialiase.c,v 1.3 2001/03/19 12:18:39 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" + +static void memadd(BYTE *s, BYTE *d, int w, int h) { + int x, y; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + *d += *s; + *(d+1) += *s; + *(d+2) += *s; + *(d+w+2) += *s; + *(d+w+1+2) += (*s * 16); + *(d+w+1+2) += *s; + *(d+w+w+4) += *s; + *(d+w+w+1+4) += *s; + *(d+w+w+2+4) += *s; + d++; s++; + } + d+=2; + } +} + +static void memmul(BYTE *s, int mul, int pixel) { + while(pixel--) { + *s = min(255, (*s) * mul); s++; + } +} + +void aa_make(BYTE *data, int w, int h, int bytes_per_line) { + int y; + BYTE *b, *_b, *__b; + BYTE *d = data; + + b = g_new0(BYTE, w*h); + _b = g_new0(BYTE, (w+2)*(h+2)); + + __b = b; + for (y = 0; y < h; y++) { + memcpy(__b, d, w); + __b+=w; d+=bytes_per_line; + } + memadd(b, _b, w, h); + memmul(_b, 16, (w+2)*(h+2)); + + d = data; + __b = _b; + for (y = 0; y < h+2; y++) { + memcpy(d, __b, w+2); + __b += (w+2); d+=bytes_per_line; + } + g_free(b); + g_free(_b); +} diff --git a/src/antialiase.h b/src/antialiase.h new file mode 100644 index 0000000..ea97cbd --- /dev/null +++ b/src/antialiase.h @@ -0,0 +1,31 @@ +/* + * antialiase.h make antialiased pattern + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: antialiase.h,v 1.2 2000/09/10 10:39:46 chikama Exp $ */ + +#ifndef __ANTIALIASE__ +#define __ANTIALIASE__ + +#include "portab.h" + +extern void aa_make(BYTE *b, int w, int h, int bytes_per_line); + +#endif /* !__ANTIALIASE__ */ diff --git a/src/audio.c b/src/audio.c new file mode 100644 index 0000000..d9fc882 --- /dev/null +++ b/src/audio.c @@ -0,0 +1,175 @@ +/* + * audio.c audio acesss wrapper + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: audio.c,v 1.17 2003/01/25 01:34:50 chikama Exp $ */ + + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "audio.h" + +#ifndef AUDIODEV_OSS +#define AUDIODEV_OSS "/dev/dsp" +#endif +#ifndef MIXERDEV_OSS +#define MIXERDEV_OSS "/dev/mixer" +#endif + + +/* extern variable */ +static char* audio_dev_dsp; +static char* audio_dev_mixer; + +/* static variable */ +static boolean mode_onlyone = FALSE; /* if true, only probe selected device */ + +#ifdef DEFAULT_AUDIO_MODE +static int mode = DEFAULT_AUDIO_MODE; +#else +static int mode = AUDIO_PCM_ANY; +#endif + +#ifdef ENABLE_OSS +extern int oss_init(audiodevice_t *dev, char *devdsp, char *devmix); +#endif /* ENABLE_OSS */ + +#ifdef ENABLE_ALSA +#ifdef ENABLE_ALSA05 +extern int alsa_init(audiodevice_t *dev, int cardno, int pcmdev, int mixdev, boolean automix); +#endif /* ENABLE_ALSA05 */ + +#ifdef ENABLE_ALSA09 +extern int alsa_init(audiodevice_t *dev, char *hw, boolean automix); +#endif /* ENABLE_ALSA09 */ +#endif + +#ifdef ENABLE_ESD +extern int esd_init(audiodevice_t *, char *); +#endif /* ENABLE_ESD */ + +#ifdef ENABLE_SUNAUDIO +extern int sunaudio_init(audiodevice_t *dev, char *devaudio, char *devaudioctl); +#endif /* ENABLE_SUNAUDIO */ + +int audio_init(audiodevice_t *a) { + switch(mode) { + case AUDIO_PCM_ANY: +#ifdef ENABLE_OSS + case AUDIO_PCM_OSS: + if (audio_dev_dsp == NULL) { + audio_dev_dsp = AUDIODEV_OSS; + } + if (audio_dev_mixer == NULL) { + audio_dev_mixer = MIXERDEV_OSS; + } + if (oss_init(a, audio_dev_dsp, audio_dev_mixer) == 0) break; + if (mode_onlyone) break; +#endif +#ifdef ENABLE_SUNAUDIO + case AUDIO_PCM_SUN: + if (sunaudio_init(a, audio_dev_dsp, audio_dev_mixer) == 0) break; + if (mode_onlyone) break; +#endif +#ifdef ENABLE_ALSA +#ifdef ENABLE_ALSA05 + case AUDIO_PCM_ALSA: + { + int card = -1, pcm = -1; + if (audio_dev_dsp) { + sscanf(audio_dev_dsp, "%d:%d\n", &card, &pcm); + } + if (alsa_init(a, card, pcm, -1, FALSE) == 0) break; + if (mode_onlyone) break; + } +#endif +#ifdef ENABLE_ALSA09 + case AUDIO_PCM_ALSA: + if (audio_dev_dsp == NULL) { + audio_dev_dsp = "hw:0"; + } + if (alsa_init(a, audio_dev_dsp, FALSE) == 0) break; + if (mode_onlyone) break; +#endif +#endif +#ifdef ENABLE_ESD + case AUDIO_PCM_ESD: + if (esd_init(a, NULL) == 0) break; + if (mode_onlyone) break; +#endif +#ifdef ENABLE_SDL + case AUDIO_PCM_SDL: + // if (sdlaudio_initilize(a) == 0) break; + // if (audiomode_strict) break; +#endif +#ifdef ENABLE_ARTS + case AUDIO_PCM_ARTS: + // if (arts_initilize(a) == 0) break; + // if (audiomode_strict) break; +#endif + default: + return -1; + } + return OK; +} + +void audio_set_output_device(char c) { + switch(c) { + case 'o': + /* OSS */ + mode = AUDIO_PCM_OSS; + break; + case 'e': + /* ESD */ + mode = AUDIO_PCM_ESD; + break; + case 's': + /* ALSA */ + mode = AUDIO_PCM_ALSA; + break; + case '0': + /* no audio */ + mode = AUDIO_PCM_DMY; + break; + default: + mode = AUDIO_PCM_ANY; + } + + mode_onlyone = TRUE; +} + +void audio_set_pcm_devicename(char *name) { + if (0 == strcmp("none", name)) { + mode = AUDIO_PCM_DMY; + } else { + audio_dev_dsp = strdup(name); + } +} + +void audio_set_mixer_devicename(char *name) { + audio_dev_mixer = strdup(name); +} diff --git a/src/audio.h b/src/audio.h new file mode 100644 index 0000000..53538c7 --- /dev/null +++ b/src/audio.h @@ -0,0 +1,100 @@ +/* + * audio.h audiodevice control + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: audio.h,v 1.13 2003/01/04 17:01:02 chikama Exp $ */ + +#ifndef __AUDIO_H__ +#define __AUDIO_H__ + +#include "portab.h" + +#define MIX_NRDEVICES 4 +#define MIX_MASTER 0 +#define MIX_CD 1 +#define MIX_MIDI 2 +#define MIX_PCM 3 + + +struct _chanfmt { + int rate; /* Hz */ + int bit; /* 1 or 2 */ + int ch; /* 1 or 2 */ +}; +typedef struct _chanfmt chanfmt_t; + + +struct _audiodevbuf { + int len; // buffere length + BYTE *cur; // current filling buffer adderss + BYTE *end; // current buffer end + + int sw; // cur is b[sw] + + BYTE *b[2]; // buffer + boolean ready[2]; // buffer is ready to send device + + int lenmax; // work +}; +typedef struct _audiodevbuf audiodevbuf_t; + + +struct _audiodevice { + int id; // audio type id + + int fd; // discpriter for write + + void *data_pcm; + void *data_mix; + + audiodevbuf_t buf; + + boolean opened; + + int (*open)(struct _audiodevice *dev, chanfmt_t fmt); + int (*close)(struct _audiodevice *dev); + int (*write)(struct _audiodevice *dev, BYTE *buf, int cnt); + void (*mix_set)(struct _audiodevice *dev, int ch, int val); + int (*mix_get)(struct _audiodevice *dev, int ch); + int (*exit)(struct _audiodevice *dev); +}; +typedef struct _audiodevice audiodevice_t; + + +enum { + AUDIO_PCM_OSS, + AUDIO_PCM_ALSA, + AUDIO_PCM_ALSA09, + AUDIO_PCM_ESD, + AUDIO_PCM_SDL, + AUDIO_PCM_ARTS, + AUDIO_PCM_SUN, + AUDIO_PCM_ANY, + AUDIO_PCM_DMY +}; + +extern int audio_init(audiodevice_t *dev); +extern void audio_set_output_device(char c); +extern void audio_set_pcm_devicename(char *name); +extern void audio_set_mixer_devicename(char *name); +extern void audio_set_alsa_mixser_element(char *fn); + + +#endif /* __AUDIO_H__ */ diff --git a/src/audio_alsa.c b/src/audio_alsa.c new file mode 100644 index 0000000..c0217fe --- /dev/null +++ b/src/audio_alsa.c @@ -0,0 +1,264 @@ +/* + * audio_alsa.c alsa lowlevel acess (for 0.5.x) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_alsa.c,v 1.19 2003/04/22 16:34:28 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "system.h" +#include "audio.h" +#include "audio_alsa.h" +#include "mixer_alsa.c" + +static int audio_open(audiodevice_t *audio, chanfmt_t fmt); +static int audio_close(audiodevice_t *audio); +static int audio_write(audiodevice_t *audio, unsigned char *buf,int cnt); + +static int audio_open(audiodevice_t *dev, chanfmt_t fmt) { + audio_alsa05_t *alsa = (audio_alsa05_t *)dev->data_pcm; + + snd_pcm_channel_params_t p; + snd_pcm_channel_setup_t s; + + if (0 > snd_pcm_open(&alsa->pcm_handle, alsa->card, alsa->pcm_dev, SND_PCM_OPEN_PLAYBACK)) { + WARNING("Opening audio device %d failed\n", alsa->pcm_dev); + goto _err_exit; + } + + memset(&alsa->info, 0, sizeof(snd_pcm_channel_info_t)); + + if (0 > snd_pcm_channel_info(alsa->pcm_handle, &alsa->info)) { + WARNING("param get failed\n"); + goto _err_exit; + } + + memset(&p, 0, sizeof(p)); + p.mode = SND_PCM_MODE_BLOCK; + p.start_mode = SND_PCM_START_DATA; + p.channel = SND_PCM_CHANNEL_PLAYBACK; + p.stop_mode = SND_PCM_STOP_STOP; + p.buf.block.frag_size = 1536; + p.buf.block.frags_max = 6; + p.buf.block.frags_min = 1; + p.format.rate = fmt.rate; + p.format.format = fmt.bit == 8 ? SND_PCM_SFMT_U8 : SND_PCM_SFMT_S16; + p.format.voices = fmt.ch; + p.format.interleave = 1; + alsa->silence = fmt.bit == 8 ? 0x80 : 0; + + if (0 > snd_pcm_channel_params(alsa->pcm_handle, &p)) { + WARNING("Unable to set channel params\n"); + goto _err_exit; + } + + if (0 > snd_pcm_channel_prepare(alsa->pcm_handle, SND_PCM_CHANNEL_PLAYBACK)) { + WARNING("Unable to prepare channel\n"); + goto _err_exit; + } + + memset(&s, 0, sizeof(s)); + s.mode = SND_PCM_MODE_BLOCK; + s.channel = SND_PCM_CHANNEL_PLAYBACK; + + if (0 > snd_pcm_channel_setup(alsa->pcm_handle, &s)) { + WARNING("Unable to obtain setup\n"); + goto _err_exit; + } + + dev->buf.len = s.buf.block.frag_size; + dev->fd = snd_pcm_file_descriptor(alsa->pcm_handle, SND_PCM_CHANNEL_PLAYBACK); + return OK; + + _err_exit: + dev->fd = -1; + return NG; +} + +static int audio_close(audiodevice_t *dev) { + audio_alsa05_t *alsa = (audio_alsa05_t *)dev->data_pcm; + snd_pcm_channel_status_t st; + int err, bc; + + dev->fd = -1; + if (alsa->pcm_handle) { + memset(&st, 0, sizeof(st)); + if (0 > (err = snd_pcm_channel_status(alsa->pcm_handle, &st))) { + WARNING("playback status err(%s)\n", snd_strerror(err)); + return snd_pcm_close(alsa->pcm_handle); + } + while (st.status == SND_PCM_STATUS_RUNNING) { + memset(&st, 0, sizeof(st)); + bc = st.count; + snd_pcm_channel_status(alsa->pcm_handle, &st); + if (bc == st.count) { + snd_pcm_channel_flush(alsa->pcm_handle, SND_PCM_CHANNEL_PLAYBACK); + } + usleep(1000); + } + err = snd_pcm_close(alsa->pcm_handle); + alsa->pcm_handle = NULL; + return err; + } else { + return OK; + } +} + +static int audio_write(audiodevice_t *dev, unsigned char *buf, int cnt) { + audio_alsa05_t *alsa = (audio_alsa05_t *)dev->data_pcm; + snd_pcm_channel_status_t st; + int ret; + + if (alsa->pcm_handle == NULL) return NG; + + if (cnt == 0) return 0; + + if (cnt < dev->buf.len) { + memset(buf + cnt, alsa->silence, dev->buf.len - cnt); + } + + memset(&st, 0, sizeof(st)); + if (0 > (ret = snd_pcm_channel_status(alsa->pcm_handle, &st))) { + WARNING("cannot get status %s\n", snd_strerror(ret)); + return 0; + } + + if (st.status != SND_PCM_STATUS_RUNNING && + st.status != SND_PCM_STATUS_PREPARED) { + snd_pcm_channel_prepare(alsa->pcm_handle, SND_PCM_CHANNEL_PLAYBACK); + } + + ret = snd_pcm_write(alsa->pcm_handle, buf, dev->buf.len); + if (ret < 0) { + WARNING("write %s\n", snd_strerror(ret)); + } + + return dev->buf.len; +} + +static int alsa_exit(audiodevice_t *dev) { + if (dev == NULL) return OK; + + mixer_exit(dev); + g_free(dev->data_pcm); + g_free(dev->data_mix); + + return OK; +} + +int alsa_init(audiodevice_t *dev, int cardno, int pcmdev, int mixdev, boolean automix) { + snd_ctl_t *ctl_handle; + snd_ctl_hw_info_t *hwinfo; + audio_alsa05_t *alsa; + int i, j, ncards; + snd_pcm_t *pcm_handle; + + /* サウンドカードが存在するかチェック */ + ncards = snd_cards(); + if (ncards < 1) { + WARNING("No ALSA device found\n"); + return NG; + } + + if (cardno == -1 && pcmdev == -1) { + /* 最初に見つかった使用可能なカード */ + if (NULL == (hwinfo = (snd_ctl_hw_info_t *)malloc(sizeof(*hwinfo) * ncards))) { + NOMEMERR(); + return NG; + } + for (i = 0; i < ncards; i++) { + if (0 > snd_ctl_open(&ctl_handle, i)) { + WARNING("Can't Open Card %d\n", i); + free(hwinfo); + return NG; + } + if (0 > snd_ctl_hw_info(ctl_handle, hwinfo + i)) { + WARNING("Can't Get Card(%d) info\n", i); + free(hwinfo); + return NG; + } + snd_ctl_close(ctl_handle); + for (j = 0; j < hwinfo[i].pcmdevs; j++) { + //open してチェック OK なら outへ + if (0 > snd_pcm_open(&pcm_handle, i, j, SND_PCM_OPEN_PLAYBACK)) continue; + cardno = i; pcmdev = j; + snd_pcm_close(pcm_handle); + NOTICE("ALSA Use(%d:%d) device\n", i, j); + goto out; + } + } + // 使用可能なデバイスが1つもない場合 + WARNING("Can't Get Card(%d) info\n", i); + return NG; + out: + free(hwinfo); + } else { + /* 指定のカード */ + if (0 > snd_ctl_open(&ctl_handle, cardno)) { + WARNING("Can't Open Card %d\n", cardno); + return NG; + } + snd_ctl_close(ctl_handle); + + /* 指定の pcmdevice がカードの中にあるかどうか */ + if (pcmdev >= 0 && pcmdev < hwinfo[cardno].pcmdevs) { + //opne してチェック + if (0 > snd_pcm_open(&pcm_handle, cardno, pcmdev, SND_PCM_OPEN_PLAYBACK)) { + WARNING("Can't Open (%d:%d)\n", cardno, pcmdev); + return NG; + } + snd_pcm_close(pcm_handle); + NOTICE("ALSA Use(%d:%d) device\n", cardno, pcmdev); + } else { + WARNING("Can't Open (%d:%d)\n", cardno, pcmdev); + return NG; + } + } + + if (mixer_init(dev, cardno, mixdev, &hwinfo) < 0) { + return NG; + } + + alsa = g_new0(audio_alsa05_t, 1); + + alsa->card = cardno; + alsa->pcm_dev = pcmdev; + alsa->automixer = automix; + + dev->data_pcm = alsa; + + dev->id = AUDIO_PCM_ALSA; + dev->fd = -1; + dev->open = audio_open; + dev->close = audio_close; + dev->write = audio_write; + dev->mix_set = mixer_set_level; + dev->mix_get = mixer_get_level; + dev->exit = alsa_exit; + + NOTICE("ALSA Initilize OK\n"); + return 0; +} diff --git a/src/audio_alsa.h b/src/audio_alsa.h new file mode 100644 index 0000000..4979545 --- /dev/null +++ b/src/audio_alsa.h @@ -0,0 +1,63 @@ +/* + * audio_alsa.h alsa lowlevel acess + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 1999- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_alsa.h,v 1.6 2002/08/23 14:56:41 chikama Exp $ */ + +#ifndef __AUDIO_ALSA__ +#define __AUDIO_ALSA__ + +#include + +typedef struct { + snd_pcm_t *pcm_handle; + boolean automixer; // 自動的に pcmdevice に接続されている mixer を探すか? + + int card; + int pcm_dev; + + snd_pcm_channel_info_t info; + + int silence; + + + int frag,frags; + struct { + int mix_dev; + snd_mixer_eid_t eid; + } mixer; + + int mm_flag; + snd_pcm_mmap_control_t *mm_ctl; + char *mm_data; +} audio_alsa05_t; + + +typedef struct { + int card; + int mix_dev; + int connect[MIX_NRDEVICES]; + + snd_mixer_element_t e[MIX_NRDEVICES]; + snd_mixer_element_info_t ei[MIX_NRDEVICES]; +} mixer_alsa05_t; + +#endif /* __AUDIO_ALSA__ */ diff --git a/src/audio_alsa09.c b/src/audio_alsa09.c new file mode 100644 index 0000000..bac32f6 --- /dev/null +++ b/src/audio_alsa09.c @@ -0,0 +1,215 @@ +/* + * audio_alsa09.c alsa lowlevel acess (for 0.9.x) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_alsa09.c,v 1.7 2004/10/31 04:18:06 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "system.h" +#include "audio.h" +#include "audio_alsa09.h" +#include "mixer_alsa09.c" +#include "music_pcm.h" + +#ifndef SND_PROTOCOL_VERSION +#define SND_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor)) +#endif + +#define BUFFERSIZE 1536 + +static int audio_open(audiodevice_t *audio, chanfmt_t fmt); +static int audio_close(audiodevice_t *audio); +static int audio_write(audiodevice_t *audio, unsigned char *buf,int cnt); + +static int audio_open(audiodevice_t *dev, chanfmt_t fmt) { + audio_alsa09_t *alsa = (audio_alsa09_t *)dev->data_pcm; + struct pollfd pfds; + snd_pcm_hw_params_t *hwparams; +#if SND_LIB_VERSION >= SND_PROTOCOL_VERSION(1,0,0) + snd_pcm_uframes_t len; +#else + snd_pcm_sframes_t len; +#endif + int err, periods; + + if (0 > snd_pcm_open(&alsa->handle, alsa->dev, SND_PCM_STREAM_PLAYBACK, SND_PCM_ASYNC)) { + WARNING("Opening audio device %d failed\n", alsa->dev); + goto _err_exit; + } + snd_pcm_hw_params_alloca(&hwparams); + + if (0 > snd_pcm_hw_params_any(alsa->handle, hwparams)) { + WARNING("param get failed\n"); + goto _err_exit; + } + + if (0 > snd_pcm_hw_params_set_access(alsa->handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) { + WARNING("set access fail\n"); + goto _err_exit; + } + + if (0 > snd_pcm_hw_params_set_format(alsa->handle, hwparams, fmt.bit == 16 ? SND_PCM_FORMAT_S16 : SND_PCM_FORMAT_U8)) { + WARNING("set format fail\n"); + goto _err_exit; + } + + if (0 > snd_pcm_hw_params_set_channels(alsa->handle, hwparams, fmt.ch)) { + WARNING("set channel fail\n"); + goto _err_exit; + } + +#if SND_LIB_VERSION >= SND_PROTOCOL_VERSION(1,0,0) + int tmp = fmt.rate; + err = snd_pcm_hw_params_set_rate_near(alsa->handle, hwparams, &tmp, 0); +#else + err = snd_pcm_hw_params_set_rate_near(alsa->handle, hwparams, fmt.rate, 0); +#endif + if (err < 0) { + WARNING("set rate fail\n"); + goto _err_exit; + } + + if (tmp != fmt.rate) { + WARNING("set rate fail\n"); + goto _err_exit; + } + + if (0 > snd_pcm_hw_params_set_periods_integer(alsa->handle, hwparams)) { + WARNING("set periods fail\n"); + goto _err_exit; + } + + periods = 2; + if (0 > snd_pcm_hw_params_set_periods_min(alsa->handle, hwparams, &periods, 0)) { + WARNING("set priods min fail\n"); + goto _err_exit; + } + + if (0 > snd_pcm_hw_params_set_buffer_size(alsa->handle, hwparams, BUFFERSIZE)) { + WARNING("set buffer fail\n"); + goto _err_exit; + } + + if (0 > snd_pcm_hw_params(alsa->handle, hwparams)) { + WARNING("set hw parmas fail\n"); + goto _err_exit; + } +#if SND_LIB_VERSION >= SND_PROTOCOL_VERSION(1,0,0) + + snd_pcm_hw_params_get_buffer_size(hwparams, &len); +#else + len = snd_pcm_hw_params_get_buffer_size(hwparams); +#endif + dev->buf.len = (int)len; + snd_pcm_poll_descriptors(alsa->handle, &pfds, 1); + dev->fd = pfds.fd; + return OK; + + _err_exit: + if (alsa->handle) { + snd_pcm_close(alsa->handle); + } + dev->fd = -1; + return NG; +} + +static int audio_close(audiodevice_t *dev) { + audio_alsa09_t *alsa = (audio_alsa09_t *)dev->data_pcm; + + dev->fd = -1; + if (alsa->handle) { + snd_pcm_close(alsa->handle); + } + return OK; +} + +static int audio_write(audiodevice_t *dev, unsigned char *buf, int cnt) { + audio_alsa09_t *alsa = (audio_alsa09_t *)dev->data_pcm; + int len, err; + + if (NULL == alsa->handle) return NG; + + if (cnt == 0) return 0; + + len = snd_pcm_bytes_to_frames(alsa->handle, cnt); + while(0 > (err = snd_pcm_writei(alsa->handle, buf, len))) { + if (err == -EPIPE) { + if (0 > snd_pcm_prepare(alsa->handle)) { + return -1; + } + continue; + } else if (err == -ESTRPIPE) { + while(-EAGAIN == (err = snd_pcm_resume(alsa->handle))) { + sleep(1); + } + if (err < 0) { + if (0 > snd_pcm_prepare(alsa->handle)) { + return -1; + } + } + continue; + } + if (0 > snd_pcm_prepare(alsa->handle)) { + return -1; + } + } + + return (snd_pcm_frames_to_bytes(alsa->handle, err)); +} + +static int alsa_exit(audiodevice_t *dev) { + if (dev == NULL) return OK; + + mixer_exit(dev); + g_free(dev->data_pcm); + g_free(dev->data_mix); + + return OK; +} + +int alsa_init(audiodevice_t *dev, char *devname, boolean automix) { + audio_alsa09_t *alsa; + + alsa = g_new0(audio_alsa09_t, 1); + alsa->dev = devname; + dev->data_pcm = alsa; + + mixer_init(dev); + + dev->id = AUDIO_PCM_ALSA09; + dev->fd = -1; + dev->open = audio_open; + dev->close = audio_close; + dev->write = audio_write; + dev->mix_set = mixer_set_level; + dev->mix_get = mixer_get_level; + dev->exit = alsa_exit; + + NOTICE("ALSA Initilize OK\n"); + return OK; +} diff --git a/src/audio_alsa09.h b/src/audio_alsa09.h new file mode 100644 index 0000000..9cbed4b --- /dev/null +++ b/src/audio_alsa09.h @@ -0,0 +1,54 @@ +/* + * audio_alsa09.h alsa lowlevel acess + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 1999- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_alsa09.h,v 1.4 2002/09/04 13:20:13 chikama Exp $ */ + +#ifndef __AUDIO_ALSA__ +#define __AUDIO_ALSA__ + +#include + +typedef struct { + snd_pcm_t *handle; + snd_async_handler_t *async_handler; + char *dev; + + boolean automixer; // 自動的に pcmdevice に接続されている mixer を探すか? + + int silence; + + int frag,frags; + struct { + int mix_dev; + } mixer; + + int mm_flag; + char *mm_data; +} audio_alsa09_t; + +typedef struct { + int card; + int mix_dev; + int connect[MIX_NRDEVICES]; +} mixer_alsa09_t; + +#endif /* __AUDIO_ALSA__ */ diff --git a/src/audio_dmy.c b/src/audio_dmy.c new file mode 100644 index 0000000..517e57a --- /dev/null +++ b/src/audio_dmy.c @@ -0,0 +1,41 @@ +/* + * audio_dmy.c dummy lowlevel acess + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: audio_dmy.c,v 1.3 2000/07/27 14:55:06 chikama Exp $ */ + +#include "config.h" +#include "audio.h" + +audio_init_t dmy_initilizer = { + 'd', + audio_dmy_new, + audio_dmy_free, + mixer_dmy_new, + mixer_dmy_free +}; + +audio_pcm_t *audio_dmy_new(audio_t *audio) { + return NULL; +} + +void audio_dmy_free(audio_pcm_t *pcm) { +} + diff --git a/src/audio_esd.c b/src/audio_esd.c new file mode 100644 index 0000000..53e8c49 --- /dev/null +++ b/src/audio_esd.c @@ -0,0 +1,196 @@ +/* + * audio_esd.c esd lowlevel acess + * + * Copyright (C) 1999-2000 + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_esd.c,v 1.11 2003/04/22 16:34:28 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "system.h" +#include "audio.h" +#include "audio_esd.h" +#include "mixer_esd.c" + +static int audio_open(audiodevice_t *audio, chanfmt_t fmt); +static int audio_close(audiodevice_t *audio); +static int audio_write(audiodevice_t *audio, unsigned char *buf, int cnt); +static int esd_exit(audiodevice_t *dev); + +/* + * Get stream source id with name 'sig' + * + * Argument + * fd: esd socket to host + * sig: stream name + * + * Return + * stream source_id +*/ +static int get_stream_id(int fd, char *sig) { + esd_info_t *all_info = NULL; + esd_player_info_t *p_list; + int id = -1; + + all_info = esd_get_all_info(fd); + p_list = all_info->player_list; + + while(p_list) { + if (strcmp(p_list->name, sig) == 0) { + id = p_list->source_id; + break; + } + p_list = p_list->next; + } + esd_free_all_info(all_info); + + return id; +} + +/* + * select settled format stream + * + * Argument + * audio: audio control object + * bit : bits of esd stream + * rate : rate of esd stream + * ch : channel of esd stream + * + * Return + * 0: OK + * -1: Error +*/ +static int audio_open(audiodevice_t *audio, chanfmt_t fmt) { + audio_esd_t *esd = (audio_esd_t *)audio->data_pcm; + esd_format_t efmt = ESD_STREAM; + + efmt |= fmt.bit == 8 ? ESD_BITS8 : ESD_BITS16; + efmt |= fmt.ch == 1 ? ESD_MONO : ESD_STEREO; + + esd->fds = esd_play_stream(efmt, fmt.rate, NULL, ESDNAME_BASE); + + if (esd->fds < 0) { + WARNING("Opening audio server failed\n"); + return NG; + } + + esd->sid = get_stream_id(esd->fdh, ESDNAME_BASE); + + audio->fd = esd->fds; + + return OK; +} + +/* + * close stream (dont close, keep opened) + * + * Argument + * audio: audio control object + * + * Return + * 0: OK +*/ +static int audio_close(audiodevice_t *audio) { + audio_esd_t *esd = (audio_esd_t *)audio->data_pcm; + int ret = OK; + + if (esd->fds > -1) { + ret = close(esd->fds); + } + + audio->fd = esd->fds = -1; + return ret; +} + +/* + * write stream data + * + * Argument + * audio: audio control object + * buf : stream data + * cnt : data length + * + * Return + * 0: OK + * -1: NG +*/ +static int audio_write(audiodevice_t *audio, unsigned char *buf, int cnt) { + audio_esd_t *esd = (audio_esd_t *)audio->data_pcm; + int rt = 0; + + if (cnt == 0) return 0; + + if (esd->fds > -1) { + rt = write(esd->fds, buf, cnt); + if (rt < 0) { + perror("write"); + } + } + return rt; +} + +int esd_exit(audiodevice_t *dev) { + audio_esd_t *esd; + + if (dev == NULL) return OK; + + esd = (audio_esd_t *)dev->data_pcm; + + esd_close(esd->fdh); + + g_free(dev->data_pcm); + g_free(dev->data_mix); + return OK; +} + +int esd_init(audiodevice_t *dev, char *host) { + audio_esd_t *esd; + int fd; + + if (0 > (fd = esd_open_sound(host))) { + return NG; + } + + esd = g_new0(audio_esd_t, 1); + esd->fdh = fd; /* socket to host */ + dev->data_pcm = esd; + + mixer_init(dev); + + dev->id = AUDIO_PCM_ESD; + dev->fd = -1; + dev->open = audio_open; + dev->close = audio_close; + dev->write = audio_write; + dev->mix_set = mixer_set_level; + dev->mix_get = mixer_get_level; + dev->exit = esd_exit; + dev->buf.len = ESD_BUF_SIZE; + + NOTICE("ESD Initilize OK\n"); + return OK; +} diff --git a/src/audio_esd.h b/src/audio_esd.h new file mode 100644 index 0000000..bf74d4b --- /dev/null +++ b/src/audio_esd.h @@ -0,0 +1,38 @@ +/* + * audio_esd.h esd lowlevel acess + * + * Copyright (C) 1999-2000 + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_esd.h,v 1.4 2002/08/18 09:35:29 chikama Exp $ */ + +#ifndef __AUDIO_ESD__ +#define __AUDIO_ESD__ + +#include + +typedef struct { + int fdh; /* socket to host */ + int fds; /* stream socket discpriter */ + int sid; /* stream source id */ + int curvol; /* current volume setting */ +} audio_esd_t; + +#define ESDNAME_BASE "xsystem35" + +#endif /* !__AUDIO_ESD__ */ diff --git a/src/audio_oss.c b/src/audio_oss.c new file mode 100644 index 0000000..657fc32 --- /dev/null +++ b/src/audio_oss.c @@ -0,0 +1,238 @@ +/* + * audio_oss.c oss lowlevel acess + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_oss.c,v 1.20 2003/04/22 16:34:28 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__FreeBSD__) +# if __FreeBSD__ < 4 +# include +# else +# include +# endif +#elif defined(__OpenBSD__) || defined(__NetBSD__) +# include +#else +# include +#endif +#include + +#include "system.h" +#include "audio.h" +#include "audio_oss.h" +#include "mixer_oss.c" + +#ifndef AFMT_S16_NE +# ifdef WORDS_BIGENDIAN +# define AFMT_S16_NE AFMT_S16_BE +# else +# define AFMT_S16_NE AFMT_S16_LE +# endif +#endif + + +#ifndef AUDIODEV_OSS +#define AUDIODEV_OSS "/dev/dsp" +#endif + + +static int audio_open(audiodevice_t *audio, chanfmt_t fmt); +static int audio_close(audiodevice_t *audio); +static int audio_wait_for_finish(audio_oss_t *oss); +static int audio_write(audiodevice_t *audio, unsigned char *buf, int cnt); +static void audio_flush(audiodevice_t *audio); + +static int audio_open(audiodevice_t *audio, chanfmt_t fmt) { + audio_oss_t *oss = (audio_oss_t *)audio->data_pcm; + int frag, blk_size; + int tmp; + + if (oss->fd > -1) audio_close(audio); + + if ((oss->fd = open(oss->dev, O_WRONLY, 0)) < 0) { + perror("open"); + WARNING("Opening audio device %s failed\n", oss->dev); + return -1; + } + + ioctl(oss->fd, SNDCTL_DSP_RESET, 0); + + tmp = (fmt.bit == 16 ? AFMT_S16_NE : AFMT_U8); + if (ioctl(oss->fd, SNDCTL_DSP_SAMPLESIZE, &tmp) < 0) { + WARNING("Setting DSP to %d bits\n", tmp); + goto _err_exit; + } + + tmp = fmt.ch - 1; + if (ioctl(oss->fd, SNDCTL_DSP_STEREO, &tmp) < 0) { + WARNING("Unable to set DSP to %s mode\n", fmt.ch == 2 ? "Stereo" : "Mono"); + goto _err_exit; + } + + tmp = fmt.rate; + if (ioctl(oss->fd, SNDCTL_DSP_SPEED, &tmp) < 0) { + WARNING("Unable to set audio sampling rate\n"); + goto _err_exit; + } +#if !defined(__powerpc__) /* does not exist(work well?) on powerpc */ +#ifdef SNDCTL_DSP_SETFRAGMENT + // for (frag = 0; (0x01 << frag) < audio_pcm->Bps; frag++); + // frag = ( 0x0100 << 16 ) + 0x0008; + frag = 0x0002000d; /* two fragments, for low latency */ + if ( ioctl(oss->fd, SNDCTL_DSP_SETFRAGMENT, &frag) < 0 ) { + WARNING("Unable to set fragsize\n"); + } +#endif +#endif + if (ioctl(oss->fd, SNDCTL_DSP_GETBLKSIZE, &blk_size) < 0) { + WARNING("Optaining DSP's block size\n"); + goto _err_exit; + } + //printf("block size = %d\n", blk_size); + audio->buf.len = blk_size; + // audio_pcm->writed_bytes = 0; + + audio->fd = oss->fd; + + return OK; + + _err_exit: + close(oss->fd); + oss->fd = -1; + return NG; +} + +static int audio_close(audiodevice_t *audio) { + audio_oss_t *oss = (audio_oss_t *)audio->data_pcm; + int ret = OK; + + if (oss->fd > -1) { + audio_wait_for_finish(oss); + audio_flush(audio); + ret = close(oss->fd); + } + + audio->fd = oss->fd = -1; + + return ret; +} + +static int audio_wait_for_finish(audio_oss_t *oss) { + char limit; + audio_buf_info buf_info; + + for (limit = 0; limit < CHAR_MAX; limit++) { + if (ioctl(oss->fd, SNDCTL_DSP_GETOSPACE, &buf_info) < 0) { + perror("ioctl(SNDCTL_DSP_GETOSPACE"); + break; + } +#if 0 + printf("GETOSPACE:fragments = %d, " + "fragstotal = %d, " + "fragsize = %d, " + "bytes = %d\n", + buf_info.fragments, + buf_info.fragstotal, + buf_info.fragsize, + buf_info.bytes); +#endif + if (buf_info.fragments == buf_info.fragstotal + || buf_info.fragsize == 0) { + break; + } + } + + return (limit == CHAR_MAX); +} + +static int audio_write(audiodevice_t *dev, unsigned char *buf, int cnt) { + audio_oss_t *oss = (audio_oss_t *)dev->data_pcm; + int rt = 0; + + if (cnt == 0) return 0; + + if (oss->fd > -1) { + rt = write(oss->fd, buf, cnt); + if (rt < 0) { + perror("write"); + } + // audio_pcm->writed_bytes += cnt; + } + return rt; +} + +static void audio_flush(audiodevice_t *dev) { + audio_oss_t *oss = (audio_oss_t *)dev->data_pcm; + + if (oss->fd > -1) { +#if 1 + if (ioctl(oss->fd, SNDCTL_DSP_SYNC) < 0) { + perror("ioctl(SNDCTL_DSP_SYNC)"); + } +#endif + } +} + +int oss_exit(audiodevice_t *dev) { + if (dev == NULL) return OK; + + mixer_exit(dev); + + g_free(dev->data_pcm); + g_free(dev->data_mix); + return OK; +} + +int oss_init(audiodevice_t *dev, char *devdsp, char *devmix) { + audio_oss_t *oss; + + oss = g_new0(audio_oss_t, 1); + + oss->fd = -1; + oss->dev = devdsp; + mixer_init(dev, devmix); + + dev->data_pcm = oss; + + dev->id = AUDIO_PCM_OSS; + dev->fd = -1; + dev->open = audio_open; + dev->close = audio_close; + dev->write = audio_write; + dev->mix_set = mixer_set_level; + dev->mix_get = mixer_get_level; + dev->exit = oss_exit; + + NOTICE("OSS Initilize OK\n"); + return OK; +} diff --git a/src/audio_oss.h b/src/audio_oss.h new file mode 100644 index 0000000..8c32066 --- /dev/null +++ b/src/audio_oss.h @@ -0,0 +1,49 @@ +/* + * audio_oss.h oss lowlevel acess + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: audio_oss.h,v 1.3 2002/08/18 09:35:29 chikama Exp $ */ + +#ifndef __AUDIO_OSS__ +#define __AUDIO_OSS__ + +typedef struct { + int fd; + char *dev; +} audio_oss_t; + +typedef struct { + char *mdev; + int vols_org[SOUND_MIXER_NRDEVICES]; + int connect[MIX_NRDEVICES]; + int mid; +} mixer_oss_t; + +#if 0 +typedef struct { + int mdev; + int mmask; +} mixer_item_data_oss_t; +#endif + +extern int oss_init(audiodevice_t *dev, char *devdsp, char *devmix); + +#endif /* !__AUDIO_OSS__ */ diff --git a/src/audio_sun.c b/src/audio_sun.c new file mode 100644 index 0000000..ff31638 --- /dev/null +++ b/src/audio_sun.c @@ -0,0 +1,118 @@ +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "system.h" +#include "audio.h" +#include "audio_sun.h" +#include "mixer_sun.c" + + +static int audio_open(audiodevice_t *audio, chanfmt_t fmt); +static int audio_close(audiodevice_t *audio); +static int audio_write(audiodevice_t *audio, unsigned char *buf, int cnt); + +static int audio_open(audiodevice_t *audio, chanfmt_t fmt) { + audio_sun_t *asun = (audio_sun_t *)audio->data_pcm; + audio_info_t info; + + if (0 > (asun->fd = open(asun->dev, O_WRONLY, 0))) { + perror("open"); + WARNING("Opening audio device %s failed\n", asun->dev); + return -1; + } + + AUDIO_INITINFO(&info); + info.play.sample_rate = fmt.rate; + info.play.channels = fmt.ch; + info.play.precision = fmt.bit; + info.play.encoding = AUDIO_ENCODING_LINEAR; + info.play.samples = 0; + + if (0 > ioctl(asun->fd, AUDIO_SETINFO, &info)) { + WARNING("Unable to set AUDIO_SETINFO\n"); + goto _err_exit; + } + + audio->buf.len = 4096; + audio->fd = asun->fd; + + return OK; + + _err_exit: + audio->fd = -1; + return NG; +} + +static int audio_close(audiodevice_t *audio) { + audio_sun_t *asun = (audio_sun_t *)audio->data_pcm; + int ret = OK; + + if (asun->fd > -1) { + ret = close(asun->fd); + } + + audio->fd = asun->fd = -1; + + return ret; +} + +static int audio_write(audiodevice_t *audio, unsigned char *buf, int cnt) { + audio_sun_t *asun = (audio_sun_t *)audio->data_pcm; + int ret = 0; + + if (cnt == 0) return 0; + + if (asun->fd > -1) { + ret = write(asun->fd, buf, cnt); + if (ret < 0) { + perror("write"); + } + } + return ret; +} + +int sunaudio_exit(audiodevice_t *dev) { + if (dev == NULL) return OK; + + mixer_exit(dev); + + g_free(dev->data_pcm); + g_free(dev->data_mix); + return OK; +} + +int sunaudio_init(audiodevice_t *dev, char *devaudio, char *devaudioctl) { + audio_sun_t *asun; + + asun = g_new0(audio_sun_t, 1); + + asun->fd = -1; + asun->dev = (devaudio == NULL ? "/dev/audio" : devaudio); + mixer_init(dev, devaudioctl); + + dev->data_pcm = asun; + dev->id = AUDIO_PCM_SUN; + dev->fd = -1; + dev->open = audio_open; + dev->close = audio_close; + dev->write = audio_write; + dev->mix_set = mixer_set_level; + dev->mix_get = mixer_get_level; + dev->exit = sunaudio_exit; + + NOTICE("SUN audio Initilize OK\n"); + + return OK; +} diff --git a/src/audio_sun.h b/src/audio_sun.h new file mode 100644 index 0000000..ebd979f --- /dev/null +++ b/src/audio_sun.h @@ -0,0 +1,16 @@ +#ifndef __AUDIO_SUN_H__ +#define __AUDIO_SUN_H__ + +typedef struct { + int fd; + char *dev; +} audio_sun_t; + + +typedef struct { + char *mdev; +} mixer_sun_t; + +extern int sunaudio_init(audiodevice_t *dev, char *devaudio, char *devaudioctl); + +#endif /* __AUDIO_SUN_H__ */ diff --git a/src/bitmaps/curbm0.xbm b/src/bitmaps/curbm0.xbm new file mode 100644 index 0000000..4d8873d --- /dev/null +++ b/src/bitmaps/curbm0.xbm @@ -0,0 +1,12 @@ +#define curbm0_width 32 +#define curbm0_height 32 +static char curbm0_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x48,0x00,0x00,0x00, + 0x88,0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x08,0x02,0x00,0x00,0x08,0x04,0x00, + 0x00,0x08,0x08,0x00,0x00,0x08,0x10,0x00,0x00,0x08,0x3e,0x00,0x00,0x48,0x02, + 0x00,0x00,0xa8,0x04,0x00,0x00,0x98,0x04,0x00,0x00,0x08,0x09,0x00,0x00,0x00, + 0x09,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0c,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bitmaps/curbm1.xbm b/src/bitmaps/curbm1.xbm new file mode 100644 index 0000000..12f5989 --- /dev/null +++ b/src/bitmaps/curbm1.xbm @@ -0,0 +1,12 @@ +#define curbm1_width 32 +#define curbm1_height 32 +static char curbm1_bits[] = { + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xf3,0x9f,0xff,0xff,0xf5,0x5f,0xff,0xff,0xf6,0xdf,0xfe, + 0x7f,0x07,0xc0,0xfd,0xbf,0xff,0xff,0xfb,0x7f,0x07,0xc0,0xfd,0xff,0xf6,0xdf, + 0xfe,0xff,0xf5,0x5f,0xff,0xff,0xf3,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; diff --git a/src/bitmaps/curbm2.xbm b/src/bitmaps/curbm2.xbm new file mode 100644 index 0000000..ffc6721 --- /dev/null +++ b/src/bitmaps/curbm2.xbm @@ -0,0 +1,12 @@ +#define curbm2_width 32 +#define curbm2_height 32 +static char curbm2_bits[] = { + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, + 0xff,0xff,0xff,0xbf,0xfe,0xff,0xff,0xdf,0xfd,0xff,0xff,0xef,0xfb,0xff,0xff, + 0xf7,0xf7,0xff,0xff,0x87,0xf0,0xff,0xff,0xbf,0xfe,0xff,0xff,0xbf,0xfe,0xff, + 0xff,0xbf,0xfe,0xff,0xff,0xbf,0xfe,0xff,0xff,0xbf,0xfe,0xff,0xff,0xbf,0xfe, + 0xff,0xff,0xbf,0xfe,0xff,0xff,0xbf,0xfe,0xff,0xff,0x87,0xf0,0xff,0xff,0xf7, + 0xf7,0xff,0xff,0xef,0xfb,0xff,0xff,0xdf,0xfd,0xff,0xff,0xbf,0xfe,0xff,0xff, + 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; diff --git a/src/bitmaps/curbm3.xbm b/src/bitmaps/curbm3.xbm new file mode 100644 index 0000000..6aad135 --- /dev/null +++ b/src/bitmaps/curbm3.xbm @@ -0,0 +1,12 @@ +#define curbm3_width 32 +#define curbm3_height 32 +static char curbm3_bits[] = { + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x7d,0xff,0xff,0xff, + 0xbd,0xff,0xff,0xff,0xdd,0xff,0xff,0xff,0xad,0xff,0xff,0xff,0x55,0xff,0xff, + 0xff,0xb9,0xfe,0xff,0xff,0x7f,0xfd,0xff,0xff,0xff,0x3a,0xff,0xff,0xff,0x55, + 0xff,0xff,0xff,0x6b,0xff,0xff,0xff,0x77,0xff,0xff,0xff,0x7b,0xff,0xff,0xff, + 0x7d,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; diff --git a/src/bitmaps/curbm4.xbm b/src/bitmaps/curbm4.xbm new file mode 100644 index 0000000..393a051 --- /dev/null +++ b/src/bitmaps/curbm4.xbm @@ -0,0 +1,12 @@ +#define curbm4_width 32 +#define curbm4_height 32 +static char curbm4_bits[] = { + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xbe,0xff,0xff, + 0xff,0xbd,0xff,0xff,0xff,0xbb,0xff,0xff,0xff,0xb5,0xff,0xff,0xff,0xaa,0xff, + 0xff,0x7f,0x9d,0xff,0xff,0xbf,0xfe,0xff,0xff,0x5c,0xff,0xff,0xff,0xaa,0xff, + 0xff,0xff,0xd6,0xff,0xff,0xff,0xee,0xff,0xff,0xff,0xde,0xff,0xff,0xff,0xbe, + 0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; diff --git a/src/bitmaps/curbm5.xbm b/src/bitmaps/curbm5.xbm new file mode 100644 index 0000000..75153c3 --- /dev/null +++ b/src/bitmaps/curbm5.xbm @@ -0,0 +1,12 @@ +#define curbm5_width 32 +#define curbm5_height 32 +static char curbm5_bits[] = { + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0x00,0x80,0xff,0xff,0xfe,0xbf,0xff,0xff,0x06,0xb0,0xff,0xff,0xfe, + 0xbf,0xff,0xff,0x05,0xd0,0xff,0xff,0x05,0xd0,0xff,0xff,0xa5,0xd2,0xff,0xff, + 0x45,0xd1,0xff,0xff,0x8d,0xd8,0xff,0xff,0x1b,0xec,0xff,0xff,0xb7,0xf6,0xff, + 0xff,0x6f,0xfb,0xff,0xff,0x6f,0xfb,0xff,0xff,0x37,0xf6,0xff,0xff,0x9b,0xec, + 0xff,0xff,0x0d,0xd8,0xff,0xff,0x85,0xd0,0xff,0xff,0x45,0xd1,0xff,0xff,0xa5, + 0xd2,0xff,0xff,0x55,0xd5,0xff,0xff,0xfe,0xbf,0xff,0xff,0x06,0xb0,0xff,0xff, + 0xfe,0xbf,0xff,0xff,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; diff --git a/src/bitmaps/curbm6.xbm b/src/bitmaps/curbm6.xbm new file mode 100644 index 0000000..4436108 --- /dev/null +++ b/src/bitmaps/curbm6.xbm @@ -0,0 +1,12 @@ +#define curbm6_width 32 +#define curbm6_height 32 +static char curbm6_bits[] = { + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xfe,0xff,0xff,0x7f,0xfd,0xff,0xff,0xbf,0xfb,0xff,0xff,0xdf, + 0xf7,0xff,0xff,0xef,0xef,0xff,0xff,0x0f,0xe0,0xff,0xff,0x7f,0xfd,0xff,0xff, + 0x7f,0xfd,0xff,0xff,0x7c,0x7d,0xfe,0x7f,0x7d,0x7d,0xfd,0xbf,0x7d,0x7d,0xfb, + 0xdf,0x01,0x01,0xf7,0xef,0xfd,0x7f,0xef,0xdf,0x01,0x01,0xf7,0xbf,0x7d,0x7d, + 0xfb,0x7f,0x7d,0x7d,0xfd,0xff,0x7c,0x7d,0xfe,0xff,0x7f,0xfd,0xff,0xff,0x7f, + 0xfd,0xff,0xff,0x0f,0xe0,0xff,0xff,0xef,0xef,0xff,0xff,0xdf,0xf7,0xff,0xff, + 0xbf,0xfb,0xff,0xff,0x7f,0xfd,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; diff --git a/src/bitmaps/cursor_arrow.xpm b/src/bitmaps/cursor_arrow.xpm new file mode 100644 index 0000000..4214865 --- /dev/null +++ b/src/bitmaps/cursor_arrow.xpm @@ -0,0 +1,43 @@ +/* XPM */ +static const char *cursor_arrow[] = { + /* width height num_colors chars_per_pixel */ + " 32 32 3 1", + /* colors */ + "X c #000000", + ". c #ffffff", + " c None", + /* pixels */ + "X ", + "XX ", + "X.X ", + "X..X ", + "X...X ", + "X....X ", + "X.....X ", + "X......X ", + "X.......X ", + "X........X ", + "X.....XXXXX ", + "X..X..X ", + "X.X X..X ", + "XX X..X ", + "X X..X ", + " X..X ", + " X..X ", + " X..X ", + " XX ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "0,0" +}; diff --git a/src/bitmaps/cursor_busy.xpm b/src/bitmaps/cursor_busy.xpm new file mode 100644 index 0000000..3d07f58 --- /dev/null +++ b/src/bitmaps/cursor_busy.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static const char *cursor_busy[] = { + /* columns rows colors chars-per-pixel */ + "32 32 3 1", + "X c #ffffff", + ". c #000000", + " c None", + /* pixels */ +" ", +" ", +" ", +" XXXXXXXXXXXXXXXXX ", +" X...............X ", +" X.XXXXXXXXXXXXX.X ", +" X.XX.........XX.X ", +" X.XXXXXXXXXXXXX.X ", +" X.X.........X.X ", +" X.X.........X.X ", +" X.X..X.X.X..X.X ", +" X.X...X.X...X.X ", +" X.XX...X...XX.X ", +" X.XX.....XX.X ", +" X.XX.X.XX.X ", +" X.XX.XX.X ", +" X.XX.XX.X ", +" X.XX...XX.X ", +" X.XX..X..XX.X ", +" X.XX.......XX.X ", +" X.X....X....X.X ", +" X.X...X.X...X.X ", +" X.X..X.X.X..X.X ", +" X.X.X.X.X.X.X.X ", +" X.XXXXXXXXXXXXX.X ", +" X.XX.........XX.X ", +" X.XXXXXXXXXXXXX.X ", +" X...............X ", +" XXXXXXXXXXXXXXXXX ", +" ", +" ", +" ", +"15,15" +}; diff --git a/src/bitmaps/cursor_cross.xpm b/src/bitmaps/cursor_cross.xpm new file mode 100644 index 0000000..c509e1f --- /dev/null +++ b/src/bitmaps/cursor_cross.xpm @@ -0,0 +1,43 @@ +/* XPM */ +static const char *cursor_cross[] = { + /* width height num_colors chars_per_pixel */ + " 32 32 3 1", + /* colors */ + "X c #000000", + ". c #ffffff", + " c None", + /* pixels */ + " ", + " ", + " ", + " ", + " ", + " XXXX ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " XXXXXXXXX..XXXXXXXXX ", + " X..................X ", + " X..................X ", + " XXXXXXXXX..XXXXXXXXX ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " X..X ", + " XXXX ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "15,15" +}; diff --git a/src/bitmaps/cursor_ibeam.xpm b/src/bitmaps/cursor_ibeam.xpm new file mode 100644 index 0000000..191132b --- /dev/null +++ b/src/bitmaps/cursor_ibeam.xpm @@ -0,0 +1,43 @@ +/* XPM */ +static const char *cursor_ibeam[] = { + /* width height num_colors chars_per_pixel */ + " 32 32 3 1", + /* colors */ + ". c #000000", + "X c #ffffff", + " c None", + /* pixels */ + " XXX XXX ", + " XXX ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " XXX ", + " XXX XXX ", + " ", + "15,15" +}; diff --git a/src/bitmaps/cursor_move.xpm b/src/bitmaps/cursor_move.xpm new file mode 100644 index 0000000..ce237e3 --- /dev/null +++ b/src/bitmaps/cursor_move.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static const char *cursor_move[] = { +/* columns rows colors chars-per-pixel */ +"32 32 3 1", +"X c #ffffff", +". c #000000", +" c None", +/* pixels */ +" ", +" ", +" ", +" ", +" X ", +" X.X ", +" X...X ", +" X.....X ", +" X.......X ", +" XXXXXXXXX ", +" X.X ", +" X.X ", +" XX X.X XX ", +" X.X X.X X.X ", +" X..X X.X X..X ", +" X...XXXXXXX.XXXXXXX...X ", +" X....X.............X....X ", +" X...XXXXXXX.XXXXXXX...X ", +" X..X X.X X..X ", +" X.X X.X X.X ", +" XX X.X XX ", +" X.X ", +" X.X ", +" XXXXXXXXX ", +" X.......X ", +" X.....X ", +" X...X ", +" X.X ", +" X ", +" ", +" ", +" ", +"15,15" +}; diff --git a/src/bitmaps/cursor_no.xpm b/src/bitmaps/cursor_no.xpm new file mode 100644 index 0000000..d238340 --- /dev/null +++ b/src/bitmaps/cursor_no.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static const char *cursor_no[] = { +/* columns rows colors chars-per-pixel */ + "32 32 3 1", + "X c #ffffff", + ". c #000000", + " c None", + /* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ...... ", +" ..XXXXXX.. ", +" .XXXXXXXXX . ", +" .XXXX....XXX . ", +" .XXX.. ..XXX. ", +" .XXXXX. .XXX. ", +" .XX.XXX. .XX. ", +" .XXX..XXX. .XXX. ", +" .XX. .XXX. .XX. ", +" .XX. .XXX. .XX. ", +" .XX. .XXX. .XX. ", +" .XX. .XXX. .XX. ", +" .XXX. .XXX..XXX. ", +" .XX . .XX.XX. ", +" .XXX. .XXXXX. ", +" .XXX.. ..XXX. ", +" .XXXX....XXXX. ", +" .XXXXXXXXXX. ", +" ..XXXXXX.. ", +" ...... ", +" ", +" ", +" ", +" ", +" ", +" ", +"16,16" +}; diff --git a/src/bitmaps/cursor_size_h.xpm b/src/bitmaps/cursor_size_h.xpm new file mode 100644 index 0000000..d49a1f8 --- /dev/null +++ b/src/bitmaps/cursor_size_h.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static const char *cursor_size_h[] = { +/* columns rows colors chars-per-pixel */ +"32 32 3 1", +". c #000000", +"X c #ffffff", +" c None", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" XX XX ", +" X.X X.X ", +" X..X X..X ", +" X...XXXXXXXXXXX...X ", +" X...................X ", +" X...XXXXXXXXXXX...X ", +" X..X X..X ", +" X.X X.X ", +" XX XX ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +"15,15" +}; diff --git a/src/bitmaps/cursor_size_l.xpm b/src/bitmaps/cursor_size_l.xpm new file mode 100644 index 0000000..ffcd9e7 --- /dev/null +++ b/src/bitmaps/cursor_size_l.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static const char *cursor_size_l[] = { +/* columns rows colors chars-per-pixel */ +"32 32 3 1", +". c #000000", +"X c #ffffff", +" c None", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" XXXXXXX ", +" X.....X ", +" X....X ", +" X...X ", +" X..X.X ", +" X.X X.X ", +" XX X.X ", +" X.X ", +" X.X XX ", +" X.X X.X ", +" X.X..X ", +" X...X ", +" X....X ", +" X.... X ", +" XXXXXXX ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +"15,15" +}; diff --git a/src/bitmaps/cursor_size_r.xpm b/src/bitmaps/cursor_size_r.xpm new file mode 100644 index 0000000..0757224 --- /dev/null +++ b/src/bitmaps/cursor_size_r.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static const char *cursor_size_r[] = { +/* columns rows colors chars-per-pixel */ +"32 32 3 1", +". c #000000", +"X c #ffffff", +" c None", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" XXXXXXX ", +" X.....X ", +" X....X ", +" X...X ", +" X.X..X ", +" X.X X.X ", +" X.X XX ", +" X.X ", +" XX X.X ", +" X.X X.X ", +" X..X.X ", +" X...X ", +" X....X ", +" X.....X ", +" XXXXXXX ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +"15,15" +}; diff --git a/src/bitmaps/cursor_size_v.xpm b/src/bitmaps/cursor_size_v.xpm new file mode 100644 index 0000000..a68d255 --- /dev/null +++ b/src/bitmaps/cursor_size_v.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static const char *cursor_size_v[] = { +/* columns rows colors chars-per-pixel */ +"32 32 3 1", +". c #000000", +"X c #ffffff", +" c None", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" X ", +" X.X ", +" X...X ", +" X.....X ", +" X.......X ", +" XXXX.XXXX ", +" X.X ", +" X.X ", +" X.X ", +" X.X ", +" X.X ", +" X.X ", +" X.X ", +" X.X ", +" XXXX XXXX ", +" X.......X ", +" X.....X ", +" X...X ", +" X/X ", +" X ", +" ", +" ", +" ", +" ", +" ", +"15,15" +}; diff --git a/src/bitmaps/cursor_uparrow.xpm b/src/bitmaps/cursor_uparrow.xpm new file mode 100644 index 0000000..28f15c2 --- /dev/null +++ b/src/bitmaps/cursor_uparrow.xpm @@ -0,0 +1,43 @@ +/* XPM */ +static const char *cursor_uparrow[] = { + /* width height num_colors chars_per_pixel */ + " 32 32 3 1", + /* colors */ + ". c #000000", + "X c #ffffff", + " c None", + /* pixels */ + " X ", + " XXX ", + " X...X ", + " X.....X ", + " X.......X ", + " X.........X ", + " X...........X ", + " X... .........X ", + " XXXXXXXX.XXXXXXXX ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " X.X ", + " XXX ", + " ", + " ", + "15,0" +}; diff --git a/src/bitmaps/maskbm0.xbm b/src/bitmaps/maskbm0.xbm new file mode 100644 index 0000000..2ac8368 --- /dev/null +++ b/src/bitmaps/maskbm0.xbm @@ -0,0 +1,12 @@ +#define maskbm0_width 32 +#define maskbm0_height 32 +static char maskbm0_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x78,0x00,0x00,0x00, + 0xf8,0x00,0x00,0x00,0xf8,0x01,0x00,0x00,0xf8,0x03,0x00,0x00,0xf8,0x07,0x00, + 0x00,0xf8,0x0f,0x00,0x00,0xf8,0x1f,0x00,0x00,0xf8,0x3f,0x00,0x00,0xf8,0x03, + 0x00,0x00,0xb8,0x07,0x00,0x00,0x98,0x07,0x00,0x00,0x08,0x0f,0x00,0x00,0x00, + 0x0f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x0c,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bitmaps/maskbm1.xbm b/src/bitmaps/maskbm1.xbm new file mode 100644 index 0000000..003d62f --- /dev/null +++ b/src/bitmaps/maskbm1.xbm @@ -0,0 +1,12 @@ +#define maskbm1_width 32 +#define maskbm1_height 32 +static char maskbm1_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x0c,0x60,0x00,0x00,0x0e,0xe0,0x00,0x00,0x0f,0xe0,0x01, + 0x80,0xff,0xff,0x03,0xc0,0xff,0xff,0x07,0x80,0xff,0xff,0x03,0x00,0x0f,0xe0, + 0x01,0x00,0x0e,0xe0,0x00,0x00,0x0c,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bitmaps/maskbm2.xbm b/src/bitmaps/maskbm2.xbm new file mode 100644 index 0000000..7592b14 --- /dev/null +++ b/src/bitmaps/maskbm2.xbm @@ -0,0 +1,12 @@ +#define maskbm2_width 32 +#define maskbm2_height 32 +static char maskbm2_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0xe0,0x03,0x00,0x00,0xf0,0x07,0x00,0x00, + 0xf8,0x0f,0x00,0x00,0xf8,0x0f,0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00, + 0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01, + 0x00,0x00,0xc0,0x01,0x00,0x00,0xc0,0x01,0x00,0x00,0xf8,0x0f,0x00,0x00,0xf8, + 0x0f,0x00,0x00,0xf0,0x07,0x00,0x00,0xe0,0x03,0x00,0x00,0xc0,0x01,0x00,0x00, + 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bitmaps/maskbm3.xbm b/src/bitmaps/maskbm3.xbm new file mode 100644 index 0000000..711c7f4 --- /dev/null +++ b/src/bitmaps/maskbm3.xbm @@ -0,0 +1,12 @@ +#define maskbm3_width 32 +#define maskbm3_height 32 +static char maskbm3_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x00,0x00, + 0x7e,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0xee,0x00,0x00, + 0x00,0xc6,0x01,0x00,0x00,0x80,0x03,0x00,0x00,0x00,0xc7,0x00,0x00,0x00,0xee, + 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0xfc,0x00,0x00,0x00, + 0xfe,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bitmaps/maskbm4.xbm b/src/bitmaps/maskbm4.xbm new file mode 100644 index 0000000..d785afe --- /dev/null +++ b/src/bitmaps/maskbm4.xbm @@ -0,0 +1,12 @@ +#define maskbm4_width 32 +#define maskbm4_height 32 +static char maskbm4_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x7f,0x00,0x00, + 0x00,0x7e,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x77,0x00, + 0x00,0x80,0x63,0x00,0x00,0xc0,0x01,0x00,0x00,0xe3,0x00,0x00,0x00,0x77,0x00, + 0x00,0x00,0x3f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x7f, + 0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bitmaps/maskbm5.xbm b/src/bitmaps/maskbm5.xbm new file mode 100644 index 0000000..6b67ffe --- /dev/null +++ b/src/bitmaps/maskbm5.xbm @@ -0,0 +1,12 @@ +#define maskbm5_width 32 +#define maskbm5_height 32 +static char maskbm5_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0x7f,0x00,0x00,0xff,0x7f,0x00,0x00,0xff,0x7f,0x00,0x00,0xff, + 0x7f,0x00,0x00,0xfe,0x3f,0x00,0x00,0xfe,0x3f,0x00,0x00,0xfe,0x3f,0x00,0x00, + 0xfe,0x3f,0x00,0x00,0xfe,0x3f,0x00,0x00,0xfc,0x1f,0x00,0x00,0xf8,0x0f,0x00, + 0x00,0xf0,0x07,0x00,0x00,0xf0,0x07,0x00,0x00,0xf8,0x0f,0x00,0x00,0xfc,0x1f, + 0x00,0x00,0xfe,0x3f,0x00,0x00,0xfe,0x3f,0x00,0x00,0xfe,0x3f,0x00,0x00,0xfe, + 0x3f,0x00,0x00,0xfe,0x3f,0x00,0x00,0xff,0x7f,0x00,0x00,0xff,0x7f,0x00,0x00, + 0xff,0x7f,0x00,0x00,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bitmaps/maskbm6.xbm b/src/bitmaps/maskbm6.xbm new file mode 100644 index 0000000..c632eb9 --- /dev/null +++ b/src/bitmaps/maskbm6.xbm @@ -0,0 +1,12 @@ +#define maskbm6_width 32 +#define maskbm6_height 32 +static char maskbm6_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x01,0x00,0x00,0x80,0x03,0x00,0x00,0xc0,0x07,0x00,0x00,0xe0, + 0x0f,0x00,0x00,0xf0,0x1f,0x00,0x00,0xf0,0x1f,0x00,0x00,0x80,0x03,0x00,0x00, + 0x80,0x03,0x00,0x00,0x83,0x83,0x01,0x80,0x83,0x83,0x03,0xc0,0x83,0x83,0x07, + 0xe0,0xff,0xff,0x0f,0xf0,0xff,0xff,0x1f,0xe0,0xff,0xff,0x0f,0xc0,0x83,0x83, + 0x07,0x80,0x83,0x83,0x03,0x00,0x83,0x83,0x01,0x00,0x80,0x03,0x00,0x00,0x80, + 0x03,0x00,0x00,0xf0,0x1f,0x00,0x00,0xf0,0x1f,0x00,0x00,0xe0,0x0f,0x00,0x00, + 0xc0,0x07,0x00,0x00,0x80,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/src/bmp.c b/src/bmp.c new file mode 100644 index 0000000..ce081d9 --- /dev/null +++ b/src/bmp.c @@ -0,0 +1,255 @@ +/* + * bmp.c extract 8/24 bit BMP cg + * + * Copyright (C) 1999 TAJIRI,Yasuhiro + * rewrited 2000 CHIKAMA Masaki + * + * 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 + * + * 0.00 99/01/04 初版 + * 0.01 99/01/20 パレットを読み込む際のrgbの並びを直した + * @version 1.1 00/09/17 rewrite for changing interface + * +*/ +/* $Id: bmp.c,v 1.3 2000/11/25 13:08:59 chikama Exp $ */ + +#include +#include "portab.h" +#include "LittleEndian.h" +#include "graphics.h" +#include "cg.h" +#include "bmp.h" + +/* + * static methods +*/ +static bmp_header *extract_header(BYTE *b); +static void getpal(Pallet256 *pal, BYTE *b); +static void extract_8bit(bmp_header *bmp, BYTE *pic, BYTE *b); +static void extract_24bit(bmp_header *bmp, WORD *pic, BYTE *b); + +/* + * Get information from cg header + * b: raw data (pointer to header) + * return: acquired bmp information object +*/ +static bmp_header *extract_header(BYTE *b) { + bmp_header *bmp = g_new(bmp_header, 1); + + bmp->bmpSize = LittleEndian_getDW(b, 2); + /*data[4]-data[7]reserv*/ + bmp->bmpDp = LittleEndian_getDW(b, 10); + bmp->bmpXW = LittleEndian_getDW(b, 18); + bmp->bmpYW = LittleEndian_getDW(b, 22); + bmp->bmpBpp = LittleEndian_getW(b, 28); + bmp->bmpCp = LittleEndian_getDW(b, 30); + bmp->bmpImgSize = LittleEndian_getDW(b, 34); + bmp->bmpPp = (bmp->bmpBpp==24 ? 0 : + 14 + LittleEndian_getDW(b, 14)); + bmp->bmpTp = LittleEndian_getDW(b, 14) == 12 ? BMP_OS2 : BMP_WIN; + + return bmp; +} + +/* + * Get pallet from raw data + * pal: pallet to be stored + * b : raw data (pointer to pallet) +*/ +static void getpal(Pallet256 *pal, BYTE *b) { + int i; + + for (i = 0; i < 256; i++) { + pal->blue[i] = *b++; + pal->red[i] = *b++; + pal->green[i] = *b++; + } +} + +/* + * Do extract 8bit bmp image + * bmps: bmp header information + * pic: pixel to be stored + * b : raw data (pointer to pixel) +*/ +static void extract_8bit(bmp_header *bmp, BYTE *pic, BYTE *b) { + int i, j; + int pos; + int LineNeed = (bmp->bmpXW * bmp->bmpBpp) / 8; + + if (LineNeed % 4) + LineNeed = (((LineNeed / 4) + 1) * 4); /* DWORD整列化 */ + + pos = LineNeed * (bmp->bmpYW); /* 最上行の位置 */ + for (i = 0; i < bmp->bmpYW; i++) { + const BYTE* p; + pos -= LineNeed; + p = b + pos; + for (j = 0; j < bmp->bmpXW; j++) + *pic++ = *p++; + } +} + +/* + * Do extract 24bit bmp image + * pms: pms header information + * pic: pixel to be stored (16 bit converted) + * b : raw data (pointer to pixel) +*/ +static void extract_24bit(bmp_header *bmp, WORD *pic, BYTE *b) { + int i, j; + int pos; + int LineNeed = (bmp->bmpXW * bmp->bmpBpp) / 8; + + if (LineNeed % 4) + LineNeed = (((LineNeed / 4) + 1) * 4); /* DWORD整列化 */ + + pos = LineNeed * (bmp->bmpYW); /* 最上行の位置 */ + for (i = 0; i < bmp->bmpYW; i++) { + const BYTE* p; + pos -= LineNeed; + p = b + pos; + + for (j = 0; j < bmp->bmpXW; j++) { + WORD r,g,b; + b = (*p++); + g = (*p++); + r = (*p++); + r >>= 3; + g >>= 2; + b >>= 3; + *pic = (r << 11 | g << 5 | b); + /* 本当はPIX24なんだろうけど、その後表示する関数ないし、 + とりあえず。 + *pic = PIX16(r,g,b); + */ + pic++; + } + } +} + +/* + * Check data is 8bit bmp format cg or not + * data: raw data (pointer to data top) + * return: TRUE if data is bmp +*/ +boolean bmp256_checkfmt(BYTE *data) { + int w, h, bpp; + if (data[0] != 'B' || data[1] != 'M') return FALSE; + + w = LittleEndian_getDW(data, 18); + h = LittleEndian_getDW(data, 22); + bpp = LittleEndian_getW(data, 28); + + if (bpp != 8) return FALSE; + if (w < 0 || h < 0) return FALSE; + + return TRUE; +} + +/* + * Extract 8bit bmp, header, pallet and pixel + * data: raw data (pointer to data top) + * return: extracted image data and information +*/ +cgdata *bmp256_extract(BYTE *data) { + bmp_header *bmp = extract_header(data); + cgdata *cg = g_new0(cgdata, 1); + + cg->pal = g_new(Pallet256, 1); + getpal(cg->pal, data + bmp->bmpPp); + + /* +10: margin for broken cg */ + cg->pic = g_new(BYTE, (bmp->bmpXW + 10) * (bmp->bmpYW + 10)); + extract_8bit(bmp, cg->pic, data + bmp->bmpDp); + + cg->type = ALCG_BMP8; + cg->x = 0; + cg->y = 0; + cg->width = bmp->bmpXW; + cg->height = bmp->bmpYW; + cg->alpha = NULL; + + g_free(bmp); + + return cg; +} + +/* + * Check data is 24bit bmp format cg or not + * data: raw data (pointer to data top) + * return: TRUE if data is pms +*/ +boolean bmp16m_checkfmt(BYTE *data) { + int w, h, bpp; + + if (data[0] != 'B' || data[1] != 'M') return FALSE; + + w = LittleEndian_getDW(data, 18); + h = LittleEndian_getDW(data, 22); + bpp = LittleEndian_getW(data, 28); + + if (bpp != 24) return FALSE; + if (w < 0 || h < 0) return FALSE; + + return TRUE; +} + +/* + * Extract 24bit bmp, header, pallet and pixel + * data: raw data (pointer to data top) + * return: extracted image data and information +*/ +cgdata *bmp16m_extract(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + bmp_header *bmp = extract_header(data); + + /* +10: margin for broken cg */ + cg->pic = (BYTE *)g_new(WORD, (bmp->bmpXW + 10) * (bmp->bmpYW + 10)); + extract_24bit(bmp, (WORD *)cg->pic, data + bmp->bmpDp); + + cg->type = ALCG_BMP24; + cg->x = 0; + cg->y = 0; + cg->width = bmp->bmpXW; + cg->height = bmp->bmpYW; + cg->alpha = NULL; + cg->pal = NULL; + + g_free(bmp); + + return cg; +} + +/* + * Extract bmp pallet only + * data: raw data (pointer to data top) + * return: extracted pallet data +*/ +cgdata *bmp_getpal(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + bmp_header *bmp = extract_header(data); + + cg->pal = g_new(Pallet256, 1); + getpal(cg->pal, data + bmp->bmpPp); + + cg->type = ALCG_BMP8; + cg->pic = NULL; + cg->alpha = NULL; + + g_free(bmp); + + return cg; +} diff --git a/src/bmp.h b/src/bmp.h new file mode 100644 index 0000000..25a0293 --- /dev/null +++ b/src/bmp.h @@ -0,0 +1,55 @@ +/* + * bmp.h extract 8/24 bit BMP cg + * + * Copyright (C) 1999 TAJIRI,Yasuhiro + * rewrited 2000 Masaki Chikam + * + * 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 + * + * @version 1.1 00/09/17 rewrite for changeing interface + * +*/ +/* $Id: bmp.h,v 1.1 2000/09/20 10:33:14 chikama Exp $ */ + +#ifndef __BMP__ +#define __BMP__ + +#include "portab.h" +#include "cg.h" + +typedef enum { + BMP_OS2 = 1, + BMP_WIN = 2 +} BMP_Type; + +typedef struct { + int bmpSize; /* header + data size? */ + int bmpXW; /* image width */ + int bmpYW; /* image height */ + int bmpBpp; /* image depth */ + int bmpCp; /* pointer to comment ? */ + int bmpImgSize; /* image size */ + int bmpDp; /* pointer to data */ + int bmpPp; /* pointer to pixel */ + BMP_Type bmpTp; /* bmp type */ +} bmp_header; + +extern boolean bmp256_checkfmt(BYTE *data); +extern cgdata *bmp256_extract(BYTE *data); +extern boolean bmp16m_checkfmt(BYTE *data); +extern cgdata *bmp16m_extract(BYTE *data); +extern cgdata *bmp_getpal(BYTE *data); + +#endif /* !__BMP__ */ diff --git a/src/cache.c b/src/cache.c new file mode 100644 index 0000000..df3558f --- /dev/null +++ b/src/cache.c @@ -0,0 +1,142 @@ +/* + * cache.c general cache manager + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cache.c,v 1.5 2003/07/21 23:06:47 chikama Exp $ */ + +#include "config.h" +#include +#include +#include +#include "portab.h" +#include "cache.h" + +/* maximum cache size (in MB) */ +#ifndef CACHE_TOTALSIZE +#define CACHE_TOTALSIZE 20 +#endif + +static int totalsize; /* total size in cache */ +static int id = 0; /* Id of cache object */ +static boolean dummyfalse = FALSE; /* dummy in_use flag */ +static boolean dummytrue = TRUE; /* dummy in_use flag */ + +/* + * static methods +*/ +static void remove_in_cache(cacher *id); + +/* + * Remove data in cache + * id: cache handler +*/ +static void remove_in_cache(cacher *id) { + cacheinfo *ip = id->top; + cacheinfo *ic = ip->next; + + while(ic->next != NULL) { + if (!(boolean)*(ic->in_use)) { + if (ic->refcnt-- == 0) { + totalsize -= ic->size; + if (ic->next != NULL) { + ip->next = ic->next; + } else { + ip->next = NULL; + } + id->free_(ic->data); + } + } else { + ip = ic; + } + g_free(ic); + ic = ip->next; + } + return; +} + +/* + * Create new cache object + * delcallback: callback function for delete cache data object + * return: new cache handler +*/ +cacher *cache_new(void *delcallback) { + cacher *c = g_new0(cacher, 1); + + c->id = id; + c->top = g_new0(cacheinfo, 1); + c->top->next = NULL; + c->top->in_use = &dummytrue; + c->free_ = delcallback; + id++; + return c; +} + +/* + * Insert data to cache + * id : cache handler + * key : data key + * data : data to be cached + * size : data size + * in_use: in_use mark pointer, if in_use is TRUE, dont remove from cache +*/ +void cache_insert(cacher *id, int key, void *data, int size, boolean *in_use) { + cacheinfo *i = id->top; + + if (CACHE_TOTALSIZE <= (totalsize >> 20)) { + remove_in_cache(id); + } + + while(i->next != NULL) { + i = i->next; + } + + i->key = key; + i->data = data; + i->size = size; + i->next = g_new0(cacheinfo, 1); + i->next->next = NULL; + if (in_use) { + i->in_use = in_use; + } else { + i->in_use = &dummyfalse; + } + totalsize += size; +} + +/* + * Search data in cache + * id : cache handler + * key: data search key + * return: pointer to cached data +*/ +void *cache_foreach(cacher *id, int key) { + cacheinfo *i = id->top; + + while(i != NULL) { + if (i->key == key) { + if (INT_MAX < i->refcnt) { + i->refcnt++; + } + return i->data; + } + i = i->next; + } + return NULL; +} diff --git a/src/cache.h b/src/cache.h new file mode 100644 index 0000000..f6d8c5a --- /dev/null +++ b/src/cache.h @@ -0,0 +1,52 @@ +/* + * cache.h general cache manager + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cache.h,v 1.2 2003/07/21 23:06:47 chikama Exp $ */ + +#ifndef __CASHE__ +#define __CASHE__ + +#include "portab.h" + +/* cache controlr infomartion */ +struct _cacheinfo { + int key; /* key of data */ + int refcnt; /* reference count */ + int size; /* data size */ + struct _cacheinfo *next; /* next data */ + boolean *in_use; /* if *in_use is TRUE, dont remove from cache */ + void *data; /* real data */ +}; +typedef struct _cacheinfo cacheinfo; + +/* cache handler */ +struct _cacher { + int id; /* id of cache object */ + void (*free_)(void *); /* free data callback */ + struct _cacheinfo *top; /* pointer to data */ +}; +typedef struct _cacher cacher; + +extern cacher *cache_new(void *delcallback); +extern void cache_insert(cacher *id, int key, void *data, int size, boolean *in_use); +extern void *cache_foreach(cacher *id, int key); + +#endif /* !__CASHE__ */ diff --git a/src/cali.c b/src/cali.c new file mode 100644 index 0000000..a3407aa --- /dev/null +++ b/src/cali.c @@ -0,0 +1,315 @@ +/* + * cali.c 計算式の評価 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * + * 0.00 97/11/27 初版 + * 0.01 97/12/06 計算式の評価順序がおかしかった + * @version 0.01-01 97/12/06 メッセージから日本語を削除 + * +*/ +/* $Id: cali.c,v 1.16 2002/12/31 04:11:19 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "variable.h" +#include "scenario.h" +#include "xsystem35.h" + +#define CALI_TRUE (1) /* comparison is ture */ +#define CALI_FALSE (0) /* comparison is false */ +#define CALI_MAX_VAL (65535) /* maxinum of value */ +#define CALI_MIN_VAL (0) /* mininum of value */ +#define CALI_NaN (CALI_MIN_VAL) /* devied by 0 */ +#define CALI_OF (CALI_MAX_VAL) /* calculate over flow */ +#define CALI_SubNG (CALI_MIN_VAL) /* nagative result */ +#define CALI_TERMINATER (0x7f) /* terminater */ + +#define CALI_DEPTH_MAX (256) + +int getCaliValue(); +int *getCaliVariable(); +int *getVariable(); + +int preVarPage; /* 直前にアクセスした変数のページ */ +int preVarIndex; /* 直前にアクセスした変数のINDEX */ +int preVarNo; /* 直前にアクセスした変数の番号 */ + +static int buf[CALI_DEPTH_MAX]; /* 計算式バッファ */ +static int *cali = buf; /* インデックス */ + +static void undeferr() { + SYSERROR("Undefined Command:@ %03d,%05x\n", sl_getPage(), sl_getIndex()); +} + +/* 配列のオフセットを確定する */ +static int *fixOffset(int base, int offset2) { + int page, offset; + int *index; + + preVarPage = (sysVarAttribute + base) -> page; + preVarNo = base; + if ((sysVarAttribute + base) -> page == 0) { + if (offset2 == -1) { +#ifdef DEBUG_CHECKALING + if (base >= SYSVAR_MAX) { + WARNING("sysVar[no] ArrayIndexOutofException (%d, %d)\n", base, offset2); + return NULL; + } +#endif + preVarIndex = base; + return sysVar + base; + } else { +#ifdef DEBUG_CHECKALING + if ((base + offset2) >= SYSVAR_MAX) { + WARNING("sysVar[no] ArrayIndexOutofException (%d, %d)\n", base, offset2); + return NULL; + } +#endif + preVarIndex = base + offset2; + return sysVar + base + offset2; + } + } else { + if (offset2 == -1) { + index = (sysVarAttribute + base) -> pointvar; + page = (sysVarAttribute + base) -> page; + offset = (sysVarAttribute + base) -> offset; +#ifdef DEBUG_CHECKALING + if ((*index) + offset > (arrayVarBuffer + page - 1)->max) { + WARNING("sysVar[no] ArrayIndexOutofException (%d, %d, %d, %d, %d)\n", base, offset2, *index, page, offset); + return NULL; + } +#endif + preVarIndex = offset + (*index); + return ((arrayVarBuffer + page - 1) -> value) + offset + (*index); + } else { + page = (sysVarAttribute + base) -> page; + offset = (sysVarAttribute + base) -> offset; +#ifdef DEBUG_CHECKALING + if (offset + offset2 > (arrayVarBuffer + page - 1)->max) { + WARNING("sysVar[no] ArrayIndexOutofException (%d, %d, %d, %d)\n", base, offset2, page, offset); + return NULL; + } +#endif + preVarIndex = offset + offset2; + return ((arrayVarBuffer + page - 1) -> value) + offset + offset2; + } + } +} + +/* 変数番号を返す */ +static int *getVar(int c0) { + int c1; + + if ((c0 & 0x40) != 0) { /* 2byte系 */ + c1 = sl_getc(); + if (c0 == 0xc0) { + if (c1 == 0) { + SYSERROR("Unknown Parameter\n"); + } else if (c1 == 1) { + /* SYSTEM35拡張 */ + c0 = (sl_getc() << 8) + sl_getc(); /* varbase */ + c1 = getCaliValue(); /* offset */ + return fixOffset(c0, c1); + } else if (c1 < 0x40) { + WARNING("Unknown Parameter\n"); + undeferr(); + } else { /* 2byte系 40h - ffh */ + return fixOffset(c1, -1); + } + } else { /* 2byte系 100h - 3fffh */ + return fixOffset(((c0 & 0x3f) * 256) + c1, -1); + } + } else { /* 1byte系 */ + return fixOffset(c0 & 0x3f, -1); + } + /* 来ないはず */ + SYSERROR("Something was wrong\n"); + return NULL; +} + +/* 変数番号が返る */ +int *getCaliVariable() { + int *c0 = getVar(sl_getc()); + if (sl_getc() != 0x7f) { + SYSERROR("Something is Wrong @ %03d:%05x\n", sl_getPage(), sl_getIndex()); + } + return c0; +} + +/* 変数代入コマンド用 */ +int *getVariable() { + return getVar(sl_getc()); +} + +/* 計算式の評価後の値が返る */ +int getCaliValue() { + register int ingVal,edVal,rstVal; + int c0,c1; + int *bufc = cali; + + while((c0 = sl_getc()) != CALI_TERMINATER) { + if ((c0 & 0x80) != 0) { /* variable */ + int c1 = sl_getcAt(sl_getIndex()); + int *t; + if (c0 == 0xc0) { + if (c1 == 1 || c1 >= 0x34) goto l_var; + c1 = sl_getc(); + if (c1 == 2) { /* % */ + ingVal = *--cali; + edVal = *--cali; + if (ingVal == 0) { + *cali = CALI_NaN; + } else { + rstVal = edVal % ingVal; + *cali = rstVal; + } + cali++; + continue; + } else if (c1 == 3) { /* <= */ + ingVal = *--cali; + edVal = *--cali; + if (edVal <= ingVal) { *cali = CALI_TRUE; } + else { *cali = CALI_FALSE; } + cali++; + continue; + } else if (c1 == 4) { /* >= */ + ingVal = *--cali; + edVal = *--cali; + if (edVal >= ingVal) { *cali = CALI_TRUE; } + else { *cali = CALI_FALSE; } + cali++; + continue; + } else if (c1 < 0x34) { + SYSERROR("Unknow Parameter @ %03d:%05x\n", sl_getPage(), sl_getIndex()); + } + } + l_var: + t = getVar(c0); + if (t == NULL) continue; + *cali = *t; cali++; + } else { + switch(c0) { + case 0x7e: /* != */ + ingVal = *--cali; + edVal = *--cali; + if (edVal != ingVal) { *cali = CALI_TRUE; } + else { *cali = CALI_FALSE; } + cali++; + break; + case 0x7d: /* > */ + ingVal = *--cali; + edVal = *--cali; + if (edVal > ingVal) { *cali = CALI_TRUE; } + else { *cali = CALI_FALSE; } + cali++; + break; + case 0x7c: /* < */ + ingVal = *--cali; + edVal = *--cali; + if (edVal < ingVal) { *cali = CALI_TRUE; } + else { *cali = CALI_FALSE; } + cali++; + break; + case 0x7b: /* == */ + ingVal = *--cali; + edVal = *--cali; + if (edVal == ingVal) { *cali = CALI_TRUE; } + else { *cali = CALI_FALSE; } + cali++; + break; + case 0x7a: /* - */ + ingVal = *--cali; + edVal = *--cali; + rstVal = edVal - ingVal; + if (rstVal < CALI_MIN_VAL) { *cali = CALI_SubNG; } + else { *cali = rstVal; } + cali++; + break; + case 0x79: /* + */ + ingVal = *--cali; + edVal = *--cali; + rstVal = edVal + ingVal; + if (rstVal > CALI_MAX_VAL) { *cali = CALI_OF; } + else { *cali = rstVal; } + cali++; + break; + case 0x78: /* / */ + ingVal = *--cali; + edVal = *--cali; + if (ingVal == 0) { + *cali = CALI_NaN; + } else { + rstVal = edVal / ingVal; + *cali = rstVal; + } + cali++; + break; + case 0x77: /* * */ + ingVal = *--cali; + edVal = *--cali; + rstVal = edVal * ingVal; + if (rstVal > CALI_MAX_VAL) { *cali = CALI_OF; } + else { *cali = rstVal; } + cali++; + break; + case 0x76: /* XOR */ + ingVal = *--cali; + edVal = *--cali; + *cali = (edVal ^ ingVal); cali++; + break; + case 0x75: /* OR */ + ingVal = *--cali; + edVal = *--cali; + *cali = (edVal | ingVal); cali++; + break; + case 0x74: /* AND */ + ingVal = *--cali; + edVal = *--cali; + *cali = (edVal & ingVal); cali++; + break; + default: + if ((c0 & 0x40) == 0) { /* WORD const */ + c1 = sl_getc(); + if (c0 == 0) { /* 34h-ffh */ + if (c1 <= 0x33) { + SYSERROR("Unknown Parameter @ %03d:%05x\n", sl_getPage(), sl_getIndex()); + } + } else { /* 100h- 3fff */ + c1 += ((c0 & 0x3f) * 256); + } + } else { /* byte const 0-33h */ + c1 = (c0 & 0x3f); + } + // printf("c1 = %d ",c1); + *cali = c1; cali++; + } + } + } + c0 = *--cali; +#ifdef DEBUG_CHECKALING + if (cali != bufc) { + WARNING("Something is wrong @ %03d:%05x\n", sl_getPage(), sl_getIndex()); + cali = bufc; + return 0; + } +#endif + return c0; +} diff --git a/src/cdrom.FreeBSD.c b/src/cdrom.FreeBSD.c new file mode 100644 index 0000000..6ff2698 --- /dev/null +++ b/src/cdrom.FreeBSD.c @@ -0,0 +1,233 @@ +/* + * cdrom.FreeBSD.c CD-ROMアクセス + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cdrom.FreeBSD.c,v 1.17 2002/08/18 09:35:29 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "cdrom.h" +#include "music_server.h" + +static int cdrom_init(char *); +static int cdrom_exit(); +static int cdrom_start(int); +static int cdrom_stop(); +static int cdrom_getPlayingInfo(cd_time *); + +#define cdrom cdrom_bsd +cdromdevice_t cdrom = { + cdrom_init, + cdrom_exit, + cdrom_start, + cdrom_stop, + cdrom_getPlayingInfo, + NULL, + NULL +}; + +static int cd_fd; +static boolean enabled = FALSE; +static struct cd_toc_entry toc_buffer[100]; +static boolean msfmode = TRUE; /* default は MSFPLAY mode */ +static int lastindex; /* 最終トラック */ + +/* ioctlがエラーで帰って来る場合 IOCTL_RETRY_TIME 回リトライする */ +static int do_ioctl(int cmd, void *data) { + int i; + for (i = 0; i < CDROM_IOCTL_RETRY_TIME; i++) { + if (0 <= ioctl(cd_fd, cmd, data)) { + return 0; + } + usleep(CDROM_IOCTL_RETRY_INTERVAL * 100 * 1000); + } + return -1; +} + +/* CD-ROM の目次を読み出しておく */ +static int get_cd_entry() { + int endtrk, i; + struct ioc_toc_header tochdr; + struct ioc_read_toc_entry toc; + struct ioc_play_msf msf; + + /* 最終トラック番号を得る */ + if (do_ioctl(CDIOREADTOCHEADER, &tochdr) < 0) { + perror("CDIOREADTOCHEADER"); + return NG; + } + + lastindex = endtrk = tochdr.ending_track; + i = tochdr.ending_track - tochdr.starting_track + 1; + if (endtrk <= 1) { /* 2トラック以上ないとダメ */ + fprintf(stderr, "No CD-AUDIO in CD-ROM\n"); + return NG; + } + + prv.cd_maxtrk = lastindex; + + /* すべてのトラックの目次を読みだしてキャッシュしておく */ + toc.address_format = CD_MSF_FORMAT; + toc.starting_track = 0; + toc.data_len = (i + 1) * sizeof(struct cd_toc_entry); + toc.data = toc_buffer; + if (do_ioctl(CDIOREADTOCENTRYS, &toc) < 0) { + perror("CDIOREADTOCENTRYS"); + return NG; + } + +#ifdef CDROM_USE_TRKIND_ONLY + msfmode = FALSE; + return OK; +#endif + + /* CDROMPLAYMSF が有効かチェック */ + msf.start_m = toc_buffer[1].addr.msf.minute; + msf.start_s = toc_buffer[1].addr.msf.second; + msf.start_f = toc_buffer[1].addr.msf.frame; + msf.end_m = toc_buffer[2].addr.msf.minute; + msf.end_s = toc_buffer[2].addr.msf.second; + msf.end_f = toc_buffer[2].addr.msf.frame; + if (do_ioctl(CDIOCPLAYMSF, &msf) < 0) { + perror("CDIOPLAYMSF"); + fprintf(stderr, "CD-ROM: change TRKMODE\n"); + msfmode = FALSE; + } + /* stop */ + if (do_ioctl(CDIOCSTOP, NULL) < 0) { + perror("CDIOCSTOP"); + return NG; + } + return OK; +} + +/* デバイスの初期化 */ +int cdrom_init(char *dev_cd) { + if (dev_cd == NULL) return NG; + + if ((cd_fd = open(dev_cd, O_RDONLY, 0)) < 0) { + perror("CDROM_DEVICE OPEN"); + enabled = FALSE; + return NG; + } + if (OK == get_cd_entry()) { + enabled = TRUE; + return OK; + } + enabled = FALSE; + return NG; +} + +/* デバイスの後始末 */ +int cdrom_exit() { + if (enabled) { + cdrom_stop(); + close(cd_fd); + } + return OK; +} + +/* トラック番号 trk の演奏 trk = 1~ */ +int cdrom_start(int trk) { + struct ioc_play_msf msf; + struct ioc_play_track track; + + if (!enabled) return NG; + + /* 曲数よりも多い指定は不可*/ + if (trk > lastindex) { + return NG; + } + /* drive spin up */ + if (do_ioctl(CDIOCSTART, NULL) < 0) { + perror("CDIOCSTART"); + return NG; + } + if (msfmode) { + msf.start_m = toc_buffer[trk - 1].addr.msf.minute; + msf.start_s = toc_buffer[trk - 1].addr.msf.second; + msf.start_f = toc_buffer[trk - 1].addr.msf.frame; + msf.end_m = toc_buffer[trk].addr.msf.minute; + msf.end_s = toc_buffer[trk].addr.msf.second; + msf.end_f = toc_buffer[trk].addr.msf.frame; + if (do_ioctl(CDIOCPLAYMSF, &msf) < 0) { + perror("CDIOPLAYMSF"); + return NG; + } + } else { + track.start_track = track.end_track = trk; + track.start_index = track.end_index = 0; + if (do_ioctl(CDIOCPLAYTRACKS, &track) < 0) { + perror("CDIOCPLAYTRACKS"); + return NG; + } + } + return OK; +} + +/* 演奏停止 */ +int cdrom_stop() { + if (enabled) { + /* if (do_ioctl(CDIOCSTOP, NULL) < 0) { */ + if (do_ioctl(CDIOCPAUSE, NULL) < 0) { + /* perror("CDIOCSTOP"); */ + perror("CDIOCPAUSE"); + } + return OK; + } + return NG; +} + +/* 現在演奏中のトラック情報の取得 */ +int cdrom_getPlayingInfo (cd_time *info) { + struct ioc_read_subchannel s; + struct cd_sub_channel_info data; + + if (!enabled) + goto errexit; + memset(&s, 0, sizeof(s)); + + s.data = &data; + s.data_len = sizeof (data); + s.address_format = CD_MSF_FORMAT; + s.data_format = CD_CURRENT_POSITION; + if (do_ioctl(CDIOCREADSUBCHANNEL, &s) < 0) { + perror("CDIOCREADSUBCHANNEL"); + goto errexit; + } + if (s.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS) { + goto errexit; + } + info->t = s.data->what.position.track_number; + info->m = s.data->what.position.reladdr.msf.minute; + info->s = s.data->what.position.reladdr.msf.second; + info->f = s.data->what.position.reladdr.msf.frame; + return OK; + errexit: + info->t = info->m = info->s = info->f = 999; + return NG; +} diff --git a/src/cdrom.Irix.c b/src/cdrom.Irix.c new file mode 100644 index 0000000..7eb8b84 --- /dev/null +++ b/src/cdrom.Irix.c @@ -0,0 +1,150 @@ +/* + * cdrom.Irix.c CD-ROMアクセス + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cdrom.Irix.c,v 1.10 2006/04/21 16:40:48 chikama Exp $ */ + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "cdrom.h" +#include "music_server.h" + +static int cdrom_init(char *); +static int cdrom_exit(); +static int cdrom_start(int); +static int cdrom_stop(); +static int cdrom_getPlayingInfo(cd_time *); + +#define cdrom cdrom_irix +cdromdevice_t cdrom = { + cdrom_init, + cdrom_exit, + cdrom_start, + cdrom_stop, + cdrom_getPlayingInfo, + NULL, + NULL +}; + +static CDPLAYER* cd_fd; +static boolean enabled = FALSE; +static int lastindex; /* 最終トラック */ + +/* CD-ROM の目次を読み出しておく */ +static int get_cd_entry() { + CDSTATUS st; + + /* 最終トラック番号を得る */ + if (CDgetstatus(cd_fd, &st) < 0) { + perror("CDgetstatus"); + return NG; + } + lastindex = st.last; + if (lastindex <= 1) { /* 2トラック以上ないとダメ */ + fprintf(stderr, "No CD-AUDIO in CD-ROM\n"); + return NG; + } + + prv.cd_maxtrk = lastindex; + + return OK; +} + +/* デバイスの初期化 */ +int cdrom_init(char *dev_cd) { + if (dev_cd == NULL) return NG; + + if ((cd_fd = CDopen(dev_cd, "r")) == NULL) { + perror("CDROM_DEVICE OPEN"); + enabled = FALSE; + return NG; + } + if (OK == get_cd_entry()) { + enabled = TRUE; + return OK; + } + enabled = FALSE; + return NG; +} + +/* デバイスの後始末 */ +int cdrom_exit() { + if (enabled) { + cdrom_stop(); + CDclose(cd_fd); + } + return OK; +} + +/* トラック番号 trk の演奏 trk = 1~ */ +int cdrom_start(int trk) { + if (!enabled) return NG; + + /* 曲数よりも多い指定は不可*/ + if (trk > lastindex) { + return NG; + } + if (CDplaytrack(cd_fd, trk, 1) < 0) { + perror("CDplaytrack"); + return NG; + } + return OK; +} + +/* 演奏停止 */ +int cdrom_stop() { + if (enabled) { + if (CDstop(cd_fd) < 0) { + perror("CDstop"); + return NG; + } + return OK; + } + return NG; +} + +/* 現在演奏中のトラック情報の取得 */ +int cdrom_getPlayingInfo (cd_time *info) { + CDSTATUS st; + + if (!enabled) + goto errexit; + + if (CDgetstatus(cd_fd, &st) < 0) { + perror("CDgetstatus"); + goto errexit; + } + if (st.state != CD_PLAYING) { + goto errexit; + } + info->t = st.track; + info->m = st.min; + info->s = st.sec; + info->f = st.frame; + return OK; + errexit: + info->t = info->m = info->s = info->f = 999; + return NG; +} diff --git a/src/cdrom.Linux.c b/src/cdrom.Linux.c new file mode 100644 index 0000000..aa2f61e --- /dev/null +++ b/src/cdrom.Linux.c @@ -0,0 +1,262 @@ +/* + * cdrom.Linux.c CD-ROMアクセス + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cdrom.Linux.c,v 1.18 2002/08/18 09:35:29 chikama Exp $ */ + +#include +#include +#include +#include +#include + +#if defined(sun) +#include +struct cdrom_msf0 { + unsigned char minute; /* minute */ + unsigned char second; /* second */ + unsigned char frame; /* frame */ +}; +#else +#include +#endif /* sun */ + +#include "portab.h" +#include "cdrom.h" +#include "music_server.h" + +static int cdrom_init(char *); +static int cdrom_exit(); +static int cdrom_start(int); +static int cdrom_stop(); +static int cdrom_getPlayingInfo(cd_time *); + +#define cdrom cdrom_linux +cdromdevice_t cdrom = { + cdrom_init, + cdrom_exit, + cdrom_start, + cdrom_stop, + cdrom_getPlayingInfo, + NULL, + NULL +}; + +static int cd_fd; +static boolean enabled = FALSE; +static struct cdrom_msf0 tocmsf[100]; +static boolean msfmode = TRUE; /* default は MSFPLAY mode */ +static int lastindex; /* 最終トラック */ + + +/* ioctlがエラーで帰って来る場合 IOCTL_RETRY_TIME 回リトライする */ +static int do_ioctl(int cmd, void *data) { + int i; + for (i = 0; i < CDROM_IOCTL_RETRY_TIME; i++) { + if (0 <= ioctl(cd_fd, cmd, data)) { + return 0; + } + usleep(CDROM_IOCTL_RETRY_INTERVAL * 100 * 1000); + } + return -1; +} + +/* CD-ROM の目次を読み出しておく */ +static int get_cd_entry() { + int endtrk, i; + struct cdrom_tochdr tochdr; + struct cdrom_tocentry toc; + struct cdrom_msf msf; + + /* 最終トラック番号を得る */ + if (do_ioctl(CDROMREADTOCHDR, &tochdr) < 0) { + perror("CDROMREADTOCHDR"); + return NG; + } + lastindex = endtrk = tochdr.cdth_trk1; + if (endtrk <= 1) { /* 2トラック以上ないとダメ */ + fprintf(stderr, "No CD-AUDIO in CD-ROM\n"); + return NG; + } + + prv.cd_maxtrk = lastindex; + + /* すべてのトラックの目次を読みだしてキャッシュしておく */ + toc.cdte_format = CDROM_MSF; + for (i = 1; i <= endtrk; i++) { + toc.cdte_track = i; + if (do_ioctl(CDROMREADTOCENTRY, &toc) < 0) { + perror("CDROMREADTOCENTRY"); + return NG; + } + tocmsf[i - 1].minute = toc.cdte_addr.msf.minute; + tocmsf[i - 1].second = toc.cdte_addr.msf.second; + tocmsf[i - 1].frame = toc.cdte_addr.msf.frame; + } + /* リードアウトを読み出す */ + toc.cdte_track = CDROM_LEADOUT; + if (do_ioctl(CDROMREADTOCENTRY, &toc) < 0) { + perror("CDROMREADTOCENTRY"); + return NG; + } + +#ifdef PPC + /* Linux PPC 対策 ;last track -1 frame */ + FRAMES_TO_MSF(MSF_TO_FRAMES(toc.cdte_addr.msf.minute, + toc.cdte_addr.msf.second, + toc.cdte_addr.msf.frame) - 1, + &tocmsf[endtrk].minute, + &tocmsf[endtrk].second, + &tocmsf[endtrk].frame); +#else + tocmsf[endtrk].minute = toc.cdte_addr.msf.minute; + tocmsf[endtrk].second = toc.cdte_addr.msf.second; + tocmsf[endtrk].frame = toc.cdte_addr.msf.frame; +#endif + +#ifdef CDROM_USE_TRKIND_ONLY + msfmode = FALSE; + return OK; +#endif + + /* CDROMPLAYMSF が有効かチェック */ + msf.cdmsf_min0 = tocmsf[1].minute; + msf.cdmsf_sec0 = tocmsf[1].second; + msf.cdmsf_frame0 = tocmsf[1].frame; + msf.cdmsf_min1 = tocmsf[2].minute; + msf.cdmsf_sec1 = tocmsf[2].second; + msf.cdmsf_frame1 = tocmsf[2].frame; + if (do_ioctl(CDROMPLAYMSF, &msf) < 0) { + perror("CDROMPLAYMSF"); + fprintf(stderr, "CD-ROM: change TRKIND mode\n"); + msfmode = FALSE; + } + /* stop */ + if (do_ioctl(CDROMSTOP, NULL) < 0) { + perror("CDROMSTOP"); + return NG; + } + return OK; +} + +/* デバイスの初期化 */ +static int cdrom_init(char *dev_cd) { + if (dev_cd == NULL) return NG; + + if ((cd_fd = open(dev_cd, O_RDONLY, 0)) < 0) { + perror("CDROM_DEVICE OPEN"); + enabled = FALSE; + return NG; + } + if (OK == get_cd_entry()) { + enabled = TRUE; + return OK; + } + enabled = FALSE; + return NG; +} + +/* デバイスの後始末 */ +static int cdrom_exit() { + if (enabled) { + cdrom_stop(); + close(cd_fd); + } + return OK; +} + +/* トラック番号 trk の演奏 trk = 1~ */ +static int cdrom_start(int trk) { + struct cdrom_msf msf; + struct cdrom_ti ti; + + if (!enabled) return NG; + + /* 曲数よりも多い指定は不可*/ + if (trk > lastindex) { + return NG; + } + /* drive spin up */ + if (do_ioctl(CDROMSTART, NULL) < 0) { + perror("CDROMSTART"); + return NG; + } + + if (msfmode) { + msf.cdmsf_min0 = tocmsf[trk - 1].minute; + msf.cdmsf_sec0 = tocmsf[trk - 1].second; + msf.cdmsf_frame0 = tocmsf[trk - 1].frame; + msf.cdmsf_min1 = tocmsf[trk].minute; + msf.cdmsf_sec1 = tocmsf[trk].second; + msf.cdmsf_frame1 = tocmsf[trk].frame; + if (do_ioctl(CDROMPLAYMSF, &msf) < 0) { + perror("CDROMPLAYMSF"); + return NG; + } + return OK; + } else { + ti.cdti_trk0 = ti.cdti_trk1 = trk; + ti.cdti_ind0 = ti.cdti_ind0 = 0; + if (do_ioctl(CDROMPLAYTRKIND, &ti) < 0) { + perror("CDROMPLAYTRKIND"); + return NG; + } + return OK; + } +} + +/* 演奏停止 */ +static int cdrom_stop() { + if (enabled) { + /* if (do_ioctl(CDROMSTOP, NULL) < 0) { */ + if (do_ioctl(CDROMPAUSE, NULL) < 0) { + /* perror("CDROMSTOP"); */ + perror("CDROMPAUSE"); + return NG; + } + return OK; + } + return NG; +} + +/* 現在演奏中のトラック情報の取得 */ +static int cdrom_getPlayingInfo (cd_time *info) { + struct cdrom_subchnl sc; + + if (!enabled) + goto errexit; + + sc.cdsc_format = CDROM_MSF; + if (do_ioctl(CDROMSUBCHNL, &sc) < 0) { + perror("CDROMSUBCHNL"); + goto errexit; + } + if (sc.cdsc_audiostatus != CDROM_AUDIO_PLAY) { + goto errexit; + } + info->t = sc.cdsc_trk; + info->m = sc.cdsc_reladdr.msf.minute; + info->s = sc.cdsc_reladdr.msf.second; + info->f = sc.cdsc_reladdr.msf.frame; + return OK; + errexit: + info->t = info->m = info->s = info->f = 999; + return NG; +} diff --git a/src/cdrom.c b/src/cdrom.c new file mode 100644 index 0000000..eb137a3 --- /dev/null +++ b/src/cdrom.c @@ -0,0 +1,107 @@ +/* + * cdrom.c CD-ROM control wrapper + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: cdrom.c,v 1.20 2002/08/18 09:35:29 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "cdrom.h" +#include "system.h" + +#if defined(ENABLE_CDROM_LINUX) +extern cdromdevice_t cdrom_linux; +#define DEV_PLAY_MODE &cdrom_linux + +#elif defined(ENABLE_CDROM_BSD) +extern cdromdevice_t cdrom_bsd; +#define DEV_PLAY_MODE &cdrom_bsd + +#elif defined(ENALE_CDROM_IRIX) +extern cdromdevice_t cdrom_irix; +#define DEV_PLAY_MODE &cdrom_irix + +#else + +extern cdromdevice_t cdrom_empty; +#define DEV_PLAY_MODE &cdrom_empty +#endif + +#ifdef ENABLE_CDROM_MP3 +extern cdromdevice_t cdrom_mp3; +#endif + + +/* + temporary cdrom device name + + default ... /dev/cdrom + + Irix(O2) ... /dev/scsi/sc1d4l0 + FreeBSD ... /dev/acd0a + etc... +*/ +static char *dev = CDROM_DEVICE; + + +/* + 初期化 + dev: cdromdevice に関する情報を格納する場所 + RET: 成功 0 + 失敗 -1 +*/ +int cd_init(cdromdevice_t *cd) { + struct stat st; + int ret = NG; + + if (dev == NULL) return -1; + + stat(dev, &st); + if (S_ISBLK(st.st_mode) | S_ISCHR(st.st_mode)) { + /* CDROM MODE */ + memcpy(cd, DEV_PLAY_MODE, sizeof(cdromdevice_t)); + ret = cd->init(dev); + } +#ifdef ENABLE_CDROM_MP3 + else if (S_ISREG(st.st_mode)) { + /* MP3 MODE */ + memcpy(cd, &cdrom_mp3, sizeof(cdromdevice_t)); + ret = cd->init(dev); + memcpy(cd, &cdrom_mp3, sizeof(cdromdevice_t)); + } +#endif + else { + /* error */ + WARNING("no cdrom device available\n"); + ret = NG; + } + return ret; +} + +void cd_set_devicename(char *name) { + if (0 == strcmp("none", name)) dev = NULL; + else dev = strdup(name); +} diff --git a/src/cdrom.empty.c b/src/cdrom.empty.c new file mode 100644 index 0000000..6e216c7 --- /dev/null +++ b/src/cdrom.empty.c @@ -0,0 +1,64 @@ +/* + * cdrom.empty.c CD-ROMアクセス + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cdrom.empty.c,v 1.8 2002/08/18 09:35:29 chikama Exp $ */ + +#include +#include "portab.h" +#include "cdrom.h" + +static int cdrom_init(char *); +static int cdrom_exit(); +static int cdrom_start(int); +static int cdrom_stop(); +static int cdrom_getPlayingInfo(cd_time *); + +#define cdrom cdrom_empty +cdromdevice_t cdrom = { + cdrom_init, + cdrom_exit, + cdrom_start, + cdrom_stop, + cdrom_getPlayingInfo, + NULL, + NULL +}; + +int cdrom_init(char *name) { + return NG; +} + +int cdrom_exit() { + return OK; +} + +int cdrom_start(int trk) { + return OK; +} + +int cdrom_stop() { + return OK; +} + +int cdrom_getPlayingInfo (cd_time *info) { + info->t = info->m = info->s = info->f = 999; + return NG; +} diff --git a/src/cdrom.h b/src/cdrom.h new file mode 100644 index 0000000..a54380b --- /dev/null +++ b/src/cdrom.h @@ -0,0 +1,64 @@ +/* + * cdrom.h cdrom control + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cdrom.h,v 1.14 2002/08/18 09:35:29 chikama Exp $ */ + +#ifndef __CDROM_H__ +#define __CDROM_H__ + +/* + * CD-ROM へのアクセスが不安定な場合は次の定数を増やしてみて下さい + */ +/* ioctrole retry times */ +#define CDROM_IOCTL_RETRY_TIME 3 +/* ioctrole retry interval (100ms unit) */ +#define CDROM_IOCTL_RETRY_INTERVAL 1 + +typedef struct { + int t,m,s,f; +} cd_time; + +struct _cdromdevice { + int (* init)(char *); + int (* exit)(void); + int (* start)(int trk); + int (* stop)(void); + int (* getpos)(cd_time *); + int (* setvol)(int); + int (* getvol)(void); +}; +typedef struct _cdromdevice cdromdevice_t; + +extern int cd_init(cdromdevice_t *); +extern void cd_set_devicename(char *); + +#define CD_FPS 75 +#define FRAMES_TO_MSF(f, M,S,F) { \ + int value = f; \ + *(F) = value%CD_FPS; \ + value /= CD_FPS; \ + *(S) = value%60; \ + value /= 60; \ + *(M) = value; \ +} +#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) + +#endif /* __CDROM_H__ */ diff --git a/src/cdrom.mp3.c b/src/cdrom.mp3.c new file mode 100644 index 0000000..d7d877b --- /dev/null +++ b/src/cdrom.mp3.c @@ -0,0 +1,362 @@ +/* + * cdrom.mp3.c CD-ROMのかわりにMP3fileだ! + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cdrom.mp3.c,v 1.24 2003/01/31 12:58:28 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_LIBGEN_H +#include +#else /* for FreeBSD 3.x ? */ +#include "xpg_basename.c" +extern char *__xpg_basename __P ((char *__path)); +#define basename(path) __xpg_basename (path) +#endif + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "cdrom.h" +#include "music_server.h" +#include "music_pcm.h" + +extern void sys_set_signalhandler(int SIG, void (*handler)(int)); + +/* + CPUパワーがあまってあまってどうしようもない人へ :-) + + 使い方 + + 1. とりあえず mpg123 などの プレイヤーを用意する。 + esd を使いたい場合は Ver 0.59q 以降を入れよう。 + プレーヤーにはあらかじめパスを通しておく。 + + 2. % cat ~/game/kichiku.playlist + mpg123 -quite + $(HOME)/game/kichiku/mp3/trk02.mp3 + $(HOME)/game/kichiku/mp3/trk03.mp3 + $(HOME)/game/kichiku/mp3/trk04.mp3 + $(HOME)/game/kichiku/mp3/trk05.mp3 + $(HOME)/game/kichiku/mp3/trk06.mp3 + + ってなファイルを用意する。( $(HOME)は適当にかえてね ) + 1行目はプレーヤーとそのオプション + 2行目以降はトラック2から順にファイルをならべる + + 1行目の最初の文字が - で始まっている場合 xsystem35 の audio device に + 流し込む (piped play mode) (ex. -mpg123 -quite) + player の再生フォーマットは 44kHz,16bit,Stereoのみ + + + 3 configure で --enable-cdrom=mp3 を追加する + + 4 実行時オプションに -devcd ~/game/kichiku.playlist のように上で作成したファイルを指定 + +*/ + +static int cdrom_init(char *); +static int cdrom_exit(); +static int cdrom_start(int); +static int cdrom_stop(); +static int cdrom_getPlayingInfo(cd_time *); +static int cdrom_setVolumePipe(int vol); +static int cdrom_getVolumePipe(); + +#define cdrom cdrom_mp3 +cdromdevice_t cdrom = { + cdrom_init, + cdrom_exit, + cdrom_start, + cdrom_stop, + cdrom_getPlayingInfo, + NULL, + NULL +}; + +#define PLAYLIST_MAX 256 +#define WHITE " \t\n" +#define MAX_ARGS 512 + +static boolean enabled = FALSE; +static char mp3_player[256]; +static int argc; +static char **argv; +static char *playlist[PLAYLIST_MAX]; +static int lastindex; // 最終トラック番号 +static pid_t cdpid; // 外部プレーヤーの pid +static int trackno; // 現在演奏中のトラック +static int counter; // 演奏時間測定用カウンタ +static boolean pipedplay; // pipe play モードかどうか + +/* + 外部プレーヤーの行の解析 + 1. 最初の文字が - であった場合、piped play mode + 2. プログラムと引数の分離 (!pipe) + 3. プログラムからプログラム名(argv[0])を分離 (!piped) +*/ + +static void player_set(char *buf) { + char *b; + int i, j; + + if (buf[0] == '-') { + pipedplay = TRUE; + buf++; + } else { + pipedplay = FALSE; + } + + strncpy(mp3_player, buf, sizeof(mp3_player)); + b = mp3_player; + + if (!pipedplay) { + /* count arguments */ + /* devide argument */ + char *tok_buf = NULL; + char *str_buf[MAX_ARGS]; //MAX_ARGS以上の引数があるとだめ + + memset(str_buf, 0, sizeof(char *) * MAX_ARGS); + + i = 0; + str_buf[i] = strtok_r(b, WHITE, &tok_buf) ; + + if (str_buf[i] == NULL) return; + + while (str_buf[i] != NULL){ + i++; + if (i >= MAX_ARGS){ + return; + } + str_buf[i] = strtok_r(NULL, WHITE, &tok_buf); + } + argv = (char **)malloc(sizeof(char *) * (i + 2)); + + if (argv == NULL) return; + + argc = i; + + for (j = 0; j < i; j++) { + argv[j] = str_buf[j]; + } + argv[i + 1] = NULL; + + /* cut down argv[0] */ + argv[0] = basename(argv[0]); + } else { + /* + pipe 出力するためにファイル名の後に - をつける必要の + あるプレーやのために、ファイル名を %s で指定できるように + するための処理 (by Fumihiko Murata) + */ + int pf = FALSE; + + b = mp3_player; + while (*b > 0x1f) { + if (*b == '%' && *(b + 1) == 's') pf = TRUE; + b++; + } + *b = 0; + if (!pf) strcat(b, " \"%s\""); // space を含むパスの場合 + } +} + +static int cdrom_init(char *config_file) { + FILE *fp; + char lbuf[256]; + int lcnt = 0; + char *s; + + if (NULL == (fp = fopen(config_file, "rt"))) return NG; + fgets(lbuf, sizeof(lbuf), fp); lcnt++; + + player_set(lbuf); + + while (TRUE) { + if (++lcnt >= (PLAYLIST_MAX +2)) { + break; + } + if (!fgets(lbuf, sizeof(lbuf) -1, fp)) { + if (feof(fp)) { + break; + } else { + perror("fgets()"); + fclose(fp); + return NG; + } + } + if (NULL == (playlist[lcnt -2] = malloc(strlen(lbuf) + 1))) { + fclose(fp); + return NG; + } + s = lbuf; + while (*s != '\n' && *s != 0) s++; + if (*s == '\n') *s=0; + strcpy(playlist[lcnt - 2], lbuf); + } + lastindex = lcnt -1; + fclose(fp); + + trackno = 0; + prv.cd_maxtrk = lastindex; + + reset_counter_high(SYSTEMCOUNTER_MP3, 10, 0); + enabled = TRUE; + + if (pipedplay) { + cdrom_mp3.setvol = cdrom_setVolumePipe; + cdrom_mp3.getvol = cdrom_getVolumePipe; + NOTICE("cdrom mp3 piped play mode\n"); + } else { + NOTICE("cdrom mp3 external player mode\n"); + } + + return OK; +} + +static int cdrom_exit() { + if (enabled) { + cdrom_stop(); + } + return OK; +} + +/* トラック番号 trk の演奏 trk = 1~ */ +static int cdrom_start(int trk) { + char cmd_pipe[256]; + pid_t pid; + + if (!enabled) return 0; + + /* 曲数よりも多い指定は不可*/ + if (trk > lastindex) { + return NG; + } + + if (pipedplay) { + g_snprintf(cmd_pipe, sizeof(cmd_pipe) -1, mp3_player, playlist[trk -2]); + if (-1 == muspcm_load_pipe(SLOT_CDROMPIPE, cmd_pipe)) { + return NG; + } + muspcm_start(SLOT_CDROMPIPE, 1); + pid = 1; // dummy + } else { + argv[argc] = playlist[trk -2]; + argv[argc +1] = NULL; + pid = fork(); + if (pid == 0) { + /* child process */ + pid_t mine = getpid(); + setpgid(mine, mine); + sys_set_signalhandler(SIGTERM, SIG_DFL); + execvp(mp3_player, argv); + perror("execvp"); + _exit(-1); + } else if (pid < 0) { + WARNING("fork failed"); + return NG; + } + } + + cdpid = pid; + trackno = trk; + counter = get_high_counter(SYSTEMCOUNTER_MP3); + + return OK; +} + +/* 演奏停止 */ +static int cdrom_stop() { + if (!enabled || cdpid == 0) { + return OK; + } + + if (!pipedplay) { + int status = 0; + kill(cdpid, SIGTERM); + killpg(cdpid, SIGTERM); + while (0 >= waitpid(cdpid, &status, WNOHANG)); + } else { + muspcm_stop(SLOT_CDROMPIPE); + } + + cdpid = 0; + trackno = 0; + + return OK; +} + +/* 現在演奏中のトラック情報の取得 */ +static int cdrom_getPlayingInfo (cd_time *inf) { + int status, cnt, err; + + if (!enabled || cdpid == 0) { + goto errout; + } + + if (pipedplay) { + cnt = muspcm_getpos(SLOT_CDROMPIPE); + if (cnt == 0) { + goto errout; + } + cnt /= 10; + } else { + if (cdpid == (err = waitpid(cdpid, &status, WNOHANG))) { + cdpid = 0; + goto errout; + } + cnt = get_high_counter(SYSTEMCOUNTER_MP3) - counter; + } + + inf->t = trackno; + inf->m = cnt / (60*100); cnt %= (60*100); + inf->s = cnt / 100; cnt %= 100; + inf->f = (cnt * CD_FPS) / 100; + + return OK; + + errout: + inf->t = inf->m = inf->s = inf->f = 999; + return NG; +} + +static int cdrom_setVolumePipe(int vol) { + if (prv.pcm[SLOT_CDROMPIPE] != NULL) { + prv.pcm[SLOT_CDROMPIPE]->vollv = vol; + } + return OK; +} + +static int cdrom_getVolumePipe() { + if (prv.pcm[SLOT_CDROMPIPE] != NULL) { + return prv.pcm[SLOT_CDROMPIPE]->vollv; + } + return 100; +} diff --git a/src/cg.c b/src/cg.c new file mode 100644 index 0000000..31511c1 --- /dev/null +++ b/src/cg.c @@ -0,0 +1,539 @@ +/* + * cg.c load and display cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cg.c,v 1.12 2001/09/16 15:59:11 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "system.h" +#include "graphics.h" +#include "nact.h" +#include "ags.h" +#include "cg.h" +#include "vsp.h" +#include "pms.h" +#include "bmp.h" +#include "qnt.h" +#include "ald_manager.h" +#include "savedata.h" +#include "cache.h" + +/* VSPのパレット展開バンク */ +int cg_vspPB = -1; +/* cg,pallet 展開フラグ (funciotn flag) */ +int cg_fflg = 7; +/* CGをロードした回数を書き込む変数 */ +int *cg_loadCountVar = NULL; +/* CGの明度指定 */ +int cg_alphaLevel = 255; + +#define GCMD_EXTRACTCG(c) ((c) & 0x01) +#define GCMD_SET_PALLET(c) ((c) & 0x02) +#define GCMD_LOAD_PALLET(c) ((c) & 0x04) + +/* CG表示位置に関する情報 */ +static CG_WHERETODISP loc_policy = OFFSET_NOMOVE, loc_policy0; +static MyPoint loc_where, loc_where0; + +/* extracted cg data cache control object */ +static cacher *cacheid; + +/* static methods */ +static CG_TYPE check_cgformat(BYTE *data); +static void set_vspbank(BYTE *pic, int bank, int width, int height); +static void cgdata_free(cgdata *cg); +static MyPoint set_display_loc(cgdata *cg); +static void clear_display_loc(); +static void display_cg(cgdata *cg, int x, int y); +static cgdata *loader(int no); + + +/* + * Identify cg format + * data: pointer to compressed data + * return: cg type +*/ +static CG_TYPE check_cgformat(BYTE *data) { + if (qnt_checkfmt(data)) { + return ALCG_QNT; + } else if (pms256_checkfmt(data)) { + return ALCG_PMS8; + } else if (pms64k_checkfmt(data) && nact->sys_world_depth >= 15) { + return ALCG_PMS16; + } else if (bmp16m_checkfmt(data) && nact->sys_world_depth >= 15) { + return ALCG_BMP24; + } else if (bmp256_checkfmt(data)) { + return ALCG_BMP8; + } else if (vsp_checkfmt(data)) { + return ALCG_VSP; + } + WARNING("Unknown Cg Type\n"); + return ALCG_UNKNOWN; +} + +/* + * Modify pixel accoding to pallet bank (vsp only) + * pic : pixel to be modifyied. + * bank : pallet bank (use only MSB 4bit) + * width : image width + * height: image height +*/ +static void set_vspbank(BYTE *pic, int bank, int width, int height) { + int pixels = width * height; + + while (pixels--) { + *pic = (*pic & 0x0f) | (BYTE)bank; pic++; + } +} + +/* + * Free data + * cg: freeing data object +*/ +static void cgdata_free(cgdata *cg) { + if (cg->pic) g_free(cg->pic); + if (cg->pal) g_free(cg->pal); + if (cg->alpha) g_free(cg->alpha); + g_free(cg); +} + +/* + * Determine the location of display image + * cg: cg information + * return: x and y for display location +*/ +static MyPoint set_display_loc(cgdata *cg) { + MyPoint p; + + switch(loc_policy) { + case OFFSET_ABSOLUTE_GC: + case OFFSET_ABSOLUTE_JC: + p.x = loc_where.x; + p.y = loc_where.y; + break; + case OFFSET_RELATIVE_GC: + case OFFSET_RELATIVE_JC: + p.x = cg->x + loc_where.x; + p.y = cg->y + loc_where.y; + break; + case OFFSET_NOMOVE: + p.x = cg->x; + p.y = cg->y; + break; + } + return p; +} + +/* + * Reset location movement according to loc_policy +*/ +static void clear_display_loc() { + switch(loc_policy) { + case OFFSET_ABSOLUTE_GC: + case OFFSET_RELATIVE_GC: + if (loc_policy0 == OFFSET_ABSOLUTE_JC || + loc_policy0 == OFFSET_RELATIVE_JC ) { + loc_policy = loc_policy0; + loc_where = loc_where0; + loc_policy0 = OFFSET_NOMOVE; + } else { + loc_policy = OFFSET_NOMOVE; + } + break; + default: + break; + } +} + +/* + * Call ags to display cg + * cg: cg to be drawn + * x : display location x + * y : display location y +*/ +static void display_cg(cgdata *cg, int x, int y) { + /* always set cg's alpha level */ + cg->alphalevel = cg_alphaLevel; + + /* draw cg */ + switch(cg->type) { + case ALCG_VSP: + case ALCG_PMS8: + case ALCG_BMP8: + ags_drawCg8bit(cg, x, y); break; + case ALCG_PMS16: + case ALCG_BMP24: + ags_drawCg16bit(cg, x, y); break; + default: + break; + } + + /* update drawn area */ + ags_updateArea(x, y, cg->width, cg->height); +} + +/* + * Load cg data from file or cache + * no: file no ( >= 0) + * return: cg object(extracted) +*/ +static cgdata *loader(int no) { + dridata *dfile; + cgdata *cg = NULL; + int type, size = 0; + + /* search in cache */ + if (NULL != (cg = (cgdata *)cache_foreach(cacheid, no))) return cg; + + /* read from file */ + if (NULL == (dfile = ald_getdata(DRIFILE_CG, no))) return NULL; + + /* update load cg counter */ + if (cg_loadCountVar != NULL) { + (*(cg_loadCountVar + no + 1))++; + } + + /* check loaded cg format */ + type = check_cgformat(dfile->data); + + /* extract cg */ + /* size is only pixel data size */ + if (GCMD_EXTRACTCG(cg_fflg)) { + switch(type) { + case ALCG_VSP: + cg = vsp_extract(dfile->data); + size = cg->width * cg->height; + break; + case ALCG_PMS8: + cg = pms256_extract(dfile->data); + size = cg->width * cg->height; + break; + case ALCG_PMS16: + cg = pms64k_extract(dfile->data); + size = (cg->width * cg->height) * sizeof(WORD); + break; + case ALCG_BMP8: + cg = bmp256_extract(dfile->data); + size = cg->width * cg->height; + break; + case ALCG_BMP24: + cg = bmp16m_extract(dfile->data); + size = (cg->width * cg->height) * sizeof(WORD); + break; + case ALCG_QNT: + cg = qnt_extract(dfile->data); + size = (cg->width * cg->height) * 3; + break; + default: + break; + } + /* insert to cache */ + if (cg) + cache_insert(cacheid, no, cg, size, NULL); + } + + /* load pallet if not extracted */ + if (GCMD_LOAD_PALLET(cg_fflg) && cg == NULL) { + /* XXXX うむ、こいつらどこで解放するんだ */ + switch(type) { + case ALCG_VSP: + cg = vsp_getpal(dfile->data); + break; + case ALCG_PMS8: + cg = pms_getpal(dfile->data); + break; + case ALCG_BMP8: + cg = bmp_getpal(dfile->data); + break; + default: + break; + } + } + + /* ok to free */ + ald_freedata(dfile); + + return cg; +} + +/* + * Initilize cache +*/ +void cg_init() { + cacheid = cache_new(cgdata_free); +} + +/* + * Set cg display location + * x : display location x + * y : display location y + * policy: location offset policy +*/ +void cg_set_display_location(int x, int y, CG_WHERETODISP policy) { + if (policy == OFFSET_ABSOLUTE_GC || policy == OFFSET_RELATIVE_GC) { + if (loc_policy == OFFSET_ABSOLUTE_JC || + loc_policy == OFFSET_RELATIVE_JC) { + loc_policy0 = loc_policy; + loc_where0 = loc_where; + } + } + + loc_policy = policy; + loc_where.x = x; + loc_where.y = y; +} + +/* + * Load and display cg + * no : file no ( >= 0) + * flg: sprite color(!-1) +*/ +void cg_load(int no, int flg) { + cgdata *cg; + MyPoint p; + int i, bank = cg_vspPB; + + /* load and extract cg */ + if (NULL == (cg = loader(no))) { + return; + } + + /* need to set vsp bank or not */ + if (GCMD_EXTRACTCG(cg_fflg) && cg->type == ALCG_VSP) { + bank = cg_vspPB == -1 ? cg->vsp_bank : cg_vspPB; + set_vspbank(cg->pic, bank << 4, cg->width, cg->height); + /* copy pallets 0 -> bank */ + { + int i, i_dst = bank << 4; + for (i = 0; i < 16; i++) { + cg->pal->red[i + i_dst] = cg->pal->red[i]; + cg->pal->green[i + i_dst] = cg->pal->green[i]; + cg->pal->blue[i + i_dst] = cg->pal->blue[i]; + } + } + if (flg != -1) { + flg |= (bank << 4); + } + } + + /* copy pallet to system */ + if (GCMD_LOAD_PALLET(cg_fflg)) { + switch(cg->type) { + case ALCG_VSP: + ags_setPallets(cg->pal, 0, bank << 4, 16); + break; + case ALCG_PMS8: + if (cg->pms_bank & 1) + ags_setPallets(cg->pal, 10, 10, 6); + if (cg->pms_bank & (1 << 15)) + //ags_setPallets(cg->pal, 240, 240, 15); + ags_setPallets(cg->pal, 240, 240, 10); + for (i = 1; i < 15; i++) { + if (cg->pms_bank & (1 << i)) { + ags_setPallets(cg->pal, i * 16, i * 16, 16); + } + } + break; + case ALCG_BMP8: + ags_setPallets(cg->pal, 10, 10, 236); + break; + default: + break; + } + /* pallet load only */ + if (cg->pic == NULL) { + cgdata_free(cg); + } + } + + /* refrect pallet change */ + if (GCMD_SET_PALLET(cg_fflg)) { + switch(cg->type) { + case ALCG_VSP: + case ALCG_PMS8: + case ALCG_BMP8: + ags_setPalletToSystem(0, 256); + break; + default: + break; + } + } + + /* draw cg */ + switch(cg->type) { + case ALCG_VSP: + case ALCG_PMS8: + case ALCG_BMP8: + if (GCMD_EXTRACTCG(cg_fflg)) { + /* set display offset */ + p = set_display_loc(cg); + /* draw cg pixel */ + cg->spritecolor = flg; + display_cg(cg, p.x, p.y); + /* clear display offset */ + clear_display_loc(); + } + break; + case ALCG_PMS16: + case ALCG_BMP24: + if (GCMD_EXTRACTCG(cg_fflg)) { + /* set display offset */ + p = set_display_loc(cg); + /* draw alpha pixel */ + if (cg->alpha) { + ags_alpha_setPixel(p.x, p.y, cg->width, cg->height, cg->alpha); + } + /* draw cg pixel */ + cg->spritecolor = flg; + display_cg(cg, p.x, p.y); + /* clear display offset */ + clear_display_loc(); + } + break; + default: + break; + } +} + +/* + * Load and display cg with alpha + * cgno : file no for cg ( >= 0 or -1(alpha only)) + * shadowno: file no for alpha ( >= 0 ) +*/ +void cg_load_with_alpha(int cgno, int shadowno) { + cgdata *cg = NULL, *scg; + MyPoint p; + + /* load pixel */ + if (cgno >= 0) { + if (NULL == (cg = loader(cgno))) return; + if (cg->type != ALCG_PMS16) { + WARNING("commandGX cg_no != 16bitPMS\n"); + return; + } + } + + /* load alpha pixel */ + if (NULL == (scg = loader(shadowno))) return; + if (scg->type != ALCG_PMS8) { + WARNING("commandGX shadow_no != 8bitPMS\n"); + return; + } + + /* set alpha pixel offset */ + p = set_display_loc(scg); + /* draw alpha pixel */ + ags_alpha_setPixel(p.x, p.y, scg->width, scg->height, scg->pic); + + /* draw pixel */ + if (cg) { + p = set_display_loc(cg); + display_cg(cg, p.x, p.y); + } + + /* clear display offset */ + clear_display_loc(); +} + +/* + * Load and display cg from file 'name' (not cached right now) + * name: file name to be read + * x : display location x + * y : display location y + * return: file read status +*/ +int cg_load_with_filename(char *name, int x, int y) { + int status, type; + BYTE *data; + cgdata *cg = NULL; + MyPoint p; + + data = load_cg_with_file(name, &status); + if (data == NULL) return status; + + cg_set_display_location(x, y, OFFSET_ABSOLUTE_GC); + + type = check_cgformat(data); + switch(type) { + case ALCG_BMP8: + cg = bmp256_extract(data); + break; + case ALCG_BMP24: + cg = bmp16m_extract(data); + break; + default: + return status; + } + + /* load pallet if not extracted */ + if (GCMD_LOAD_PALLET(cg_fflg)) { + if (cg->type == ALCG_BMP8) + ags_setPallets(cg->pal, 10, 10, 236); + } + + if (GCMD_SET_PALLET(cg_fflg)) { + if (cg->type == ALCG_BMP8) + ags_setPalletToSystem(0, 256); + } + + /* draw cg */ + if (GCMD_EXTRACTCG(cg_fflg)) { + /* set display offset */ + p = set_display_loc(cg); + /* draw cg pixel */ + cg->spritecolor = -1; + display_cg(cg, p.x, p.y); + /* clear display offset */ + clear_display_loc(); + } + + cgdata_free(cg); + return status; +} + +/* + * Get cg information + * no : file no for cg ( >= 0 ) + * info: information to be retored +*/ +void cg_get_info(int no, MyRectangle *info) { + cgdata *cg = loader(no); + MyPoint p; + + if (cg == NULL) { + info->x = info->y = info->width = info->height = 0; + } else { + p = set_display_loc(cg); + info->x = p.x; + info->y = p.y; + info->width = cg->width; + info->height = cg->height; + } +} + +cgdata *cg_loadonly(int no) { + return loader(no); +} + +void cg_clear_display_loc() { + clear_display_loc(); +} diff --git a/src/cg.h b/src/cg.h new file mode 100644 index 0000000..f8a2435 --- /dev/null +++ b/src/cg.h @@ -0,0 +1,91 @@ +/* + * cg.h load and display cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cg.h,v 1.14 2001/09/16 15:59:11 chikama Exp $ */ + +#ifndef __CG__ +#define __CG__ + +#include "portab.h" +#include "graphics.h" + +/* + * available cg format id +*/ +typedef enum { + ALCG_UNKNOWN = 1, + ALCG_VSP = 2, + ALCG_PMS8 = 3, + ALCG_PMS16 = 4, + ALCG_BMP8 = 5, + ALCG_BMP24 = 6, + ALCG_QNT = 7 +} CG_TYPE; + +/* + * information for display cg data +*/ +typedef struct { + CG_TYPE type; /* cg format type */ + int x; /* default display location x */ + int y; /* default display location y */ + int width; /* image width */ + int height; /* image height */ + + BYTE *pic; /* extracted pixel data */ + BYTE *alpha; /* extracted alpha data if exists */ + Pallet256 *pal; /* extracted pallet data if exists */ + + int vsp_bank; /* pallet bank for vsp */ + int pms_bank; /* pallet bank for pms */ + + int spritecolor; /* sprite color for vsp and pms8 */ + int alphalevel; /* alpha level of image */ + + int data_offset; /* pic offset for clipping */ +} cgdata; + +/* + * location for draw image policy +*/ +typedef enum { + OFFSET_NOMOVE, /* use location in data */ + OFFSET_ABSOLUTE_GC, /* absolute location and use only once */ + OFFSET_ABSOLUTE_JC, /* absolute location and use til J4 cmd */ + OFFSET_RELATIVE_GC, /* relative location and use only once */ + OFFSET_RELATIVE_JC /* relative location and use til J4 cmd */ +} CG_WHERETODISP; + +extern void cg_init(); +extern void cg_set_display_location(int x, int y, CG_WHERETODISP policy); +extern void cg_load(int no, int flg); +extern void cg_load_with_alpha(int cgno, int shadowno); +extern int cg_load_with_filename(char *name, int x, int y); +extern void cg_get_info(int no, MyRectangle *info); +extern cgdata *cg_loadonly(int no); +extern void cg_clear_display_loc(); + +extern int cg_vspPB; +extern int cg_fflg; +extern int *cg_loadCountVar; +extern int cg_alphaLevel; + +#endif /* !__CG__ */ diff --git a/src/cmd2F.c b/src/cmd2F.c new file mode 100644 index 0000000..38036c6 --- /dev/null +++ b/src/cmd2F.c @@ -0,0 +1,1503 @@ +/* + * cmd2F.c SYSTEM35 0x2f,xx command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmd2F.c,v 1.35 2006/04/21 16:39:02 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include "portab.h" +#include "xsystem35.h" +#include "savedata.h" +#include "menu.h" +#include "selection.h" +#include "message.h" +#include "music_client.h" +#include "eucsjis.h" +#include "ags.h" +#include "graphicsdevice.h" +#include "ald_manager.h" +#include "LittleEndian.h" + +/* 選択 Window OPEN 時 callback */ +static int cb_sel_init_page = 0; +static int cb_sel_init_address = 0; + +extern INPUTSTRING_PARAM mi_param; + +extern void commandH(); +extern void commandHH(); + +typedef struct { + int page; + int index; +} fncall_table; + +#define FCTBL_MAX 1024 +static fncall_table fnctbl[FCTBL_MAX]; + +void commands2F00() { + /* テキストカラーをスタックからポップして設定する */ + int data[3]; + + sl_popData(data, 3); + if (data[0] == TxxTEXTCOLOR) { + if (data[1] == 0) { + nact->msg.MsgFontColor = data[2]; + } else { + nact->sel.MsgFontColor = data[2]; + } + } + + DEBUG_COMMAND("TOC:\n"); +} + +void commands2F01() { + /* テキストフォントサイズをスタックからポップして設定する */ + int data[3]; + + sl_popData(data, 3); + if (data[0] == TxxTEXTSIZE) { + if (data[1] == 0) { + nact->msg.MsgFontSize = data[2]; + } else { + nact->sel.MsgFontSize = data[2]; + } + } + + DEBUG_COMMAND("TOS:\n"); +} + +void commands2F02() { + /* 現在のテキストカラーをスタックにプッシュする */ + int exp = getCaliValue(); + int data[] = {TxxTEXTCOLOR,0,0}; + + data[1] = exp; + data[2] = (exp == 0 ? nact->msg.MsgFontColor : nact->sel.MsgFontColor); + sl_pushData(data, 3); + + DEBUG_COMMAND("TPC %d\n", exp); +} + +void commands2F03() { + /* 現在のテキストフォントサイズをスタックにプッシュする */ + int exp = getCaliValue(); + int data[] = {TxxTEXTSIZE, 0, 0}; + + data[1] = exp; + data[2] = (exp == 0 ? nact->msg.MsgFontSize : nact->sel.MsgFontSize); + sl_pushData(data, 3); + + DEBUG_COMMAND("TPS %d:%s\n", exp, ""); +} + +void commands2F04() { + /* テキスト表示位置をスタックからポップして設定する */ + int data[3]; + + sl_popData(data, 3); + if (data[0] == TxxTEXTLOC) { + msg_setMessageLocation(data[1], data[2]); + } + + DEBUG_COMMAND("TOP:\n"); +} + +void commands2F05() { + /* 現在のテキスト表示位置をスタックにプッシュする */ + int data[] = {TxxTEXTLOC, 0, 0}; + MyPoint loc; + + msg_getMessageLocation(&loc); + data[1] = loc.x; + data[2] = loc.y; + sl_pushData(data, 3); + + DEBUG_COMMAND("TPP:\n"); +} + +void commands2F08() { + /* アンチエイリアシング付きテキスト描画のフラグ設定 */ + int exp = getCaliValue(); + + ags_setAntialiasedStringMode(exp == 1); + + DEBUG_COMMAND("TAA %d:\n", exp); +} + +void commands2F09() { + /* アンチエイリアシング付きテキスト描画のフラグ取得 */ + int *var = getCaliVariable(); + + *var = ags_getAntialiasedStringMode() ? 1 : 0; + + DEBUG_COMMAND("TAB %d:\n", *var); +} + +void commands2F0A() { + /* Wavデータを読み込む */ + int eCh = getCaliValue(); + int eLinkNum = getCaliValue(); + + mus_wav_load(eCh, eLinkNum); + + DEBUG_COMMAND("wavLoad %d, %d:\n", eCh, eLinkNum); +} + +void commands2F0B() { + /* Wavを再生する */ + int eCh = getCaliValue(); + int eLoopFlag = getCaliValue(); + + mus_wav_play(eCh, eLoopFlag); + + DEBUG_COMMAND("wavPlay %d, %d\n", eCh, eLoopFlag); +} + +void commands2F0C() { + int eCh = getCaliValue(); + + mus_wav_stop(eCh); + + DEBUG_COMMAND("wavStop %d\n", eCh); +} + +void commands2F0D() { + int eCh = getCaliValue(); + + mus_wav_unload(eCh); + + DEBUG_COMMAND("wavUnload %d:\n", eCh); +} + +void commands2F0E() { + int eCh = getCaliValue(); + int *vResult = getCaliVariable(); + int pos = mus_wav_get_playposition(eCh); + + *vResult = ((pos == 0 || pos == 65535) ? 0 : 1); + + DEBUG_COMMAND("wavIsPlay %d, %d:\n", eCh, *vResult); +} + +void commands2F0F() { + int eCh = getCaliValue(); + int eTime = getCaliValue(); + int eVolume = getCaliValue(); + int eStopFlag = getCaliValue(); + + mus_wav_fadeout_start(eCh, eTime, eVolume, eStopFlag); + + DEBUG_COMMAND("wavFade %d, %d, %d, %d:\n", eCh, eTime, eVolume, eStopFlag); +} + +void commands2F10() { + int eCh = getCaliValue(); + int *vResult = getCaliVariable(); + + *vResult = (mus_wav_fadeout_get_state(eCh) ? 1 : 0); + + DEBUG_COMMAND("wavIsFade %d, %d:\n", eCh, *vResult); +} + +void commands2F11() { + int eCh = getCaliValue(); + + mus_wav_fadeout_stop(eCh); + + DEBUG_COMMAND("wavStopFade %d:\n", eCh); +} + +void commands2F12() { + char *sText = sys_getString(0); + + DEBUG_COMMAND("trace %s:\n", sText); + +} + +void commands2F13() { + int eCh = getCaliValue(); + int eX = getCaliValue(); + int eY = getCaliValue(); + int eZ = getCaliValue(); + + DEBUG_COMMAND_YET("wav3DSetPos %d, %d, %d, %d:\n", eCh, eX, eY, eZ); +} + +void commands2F14() { + DEBUG_COMMAND_YET("wav3DCommit:\n"); +} + +void commands2F15() { + int eCh = getCaliValue(); + int *eX = getCaliVariable(); + int *eY = getCaliVariable(); + int *eZ = getCaliVariable(); + + *eX = 0; + *eY = 0; + *eZ = 0; + DEBUG_COMMAND_YET("wav3DGetPos %d, %d, %d, %d:\n", eCh, *eX, *eY, *eZ); +} + +void commands2F16() { + int eX = getCaliValue(); + int eY = getCaliValue(); + int eZ = getCaliValue(); + + DEBUG_COMMAND_YET("wav3DSetPosL %d, %d, %d:\n", eX, eY, eZ); +} + +void commands2F17() { + int *vX = getCaliVariable(); + int *vY = getCaliVariable(); + int *vZ = getCaliVariable(); + + *vX = 0; + *vY = 0; + *vZ = 0; + DEBUG_COMMAND_YET("wav3DGetPosL %d, %d, %d:%s\n", *vX, *vY, *vZ); +} + +void commands2F18() { + int eCh = getCaliValue(); + int eTime = getCaliValue(); + int eX = getCaliValue(); + int eY = getCaliValue(); + int eZ = getCaliValue(); + + DEBUG_COMMAND_YET("wav3DFadePos %d, %d, %d, %d, %d:\n", eCh, eTime, eX, eY, eZ); +} + +void commands2F19() { + int eCh = getCaliValue(); + int *vResult = getCaliVariable(); + + *vResult = 0; + DEBUG_COMMAND_YET("wav3DIsFadePos %d, %d:\n", eCh, *vResult); +} + +void commands2F1A() { + int eCh = getCaliValue(); + + DEBUG_COMMAND_YET("wav3DStopFadePos %d:\n", eCh); +} + +void commands2F1B() { + int eTime = getCaliValue(); + int eX = getCaliValue(); + int eY = getCaliValue(); + int eZ = getCaliValue(); + + DEBUG_COMMAND_YET("wav3DFadePosL %d, %d, %d, %d:\n", eTime, eX, eY, eZ); +} + +void commands2F1C() { + int *vResult = getCaliVariable(); + + *vResult = 0; + DEBUG_COMMAND_YET("wav3DIsFadePosL %d:\n", *vResult); +} + +void commands2F1D() { + DEBUG_COMMAND_YET("wav3DStopFadePosL"); +} + +void commands2F1E() { + int eLinkNum = getCaliValue(); + int eLoop = getCaliValue(); + + if (eLinkNum > 0) { + mus_pcm_start(eLinkNum , eLoop); + } + + DEBUG_COMMAND("sndPlay %d, %d:\n", eLinkNum, eLoop); +} + +void commands2F1F() { + mus_pcm_stop(0); + + DEBUG_COMMAND("sndStop:\n"); +} + +void commands2F20() { + int *vResult = getCaliVariable(); + + mus_pcm_get_playposition(vResult); + + DEBUG_COMMAND("sndIsPlay %d:\n", *vResult); +} + +void commands2F21() { + char *str = sys_getString(0); + + sys_addMsg(str); +} + +void commands2F23() { + int x = getCaliValue(); + int y = getCaliValue(); + char *vFileName = sys_getString(0); + + sysVar[0] = cg_load_with_filename(vFileName, x, y); + + DEBUG_COMMAND("LC(new) %d, %d, %s:\n", x, y, vFileName); +} + +void commands2F24() { + int type = sys_getc(); + char *file_name = sys_getString(0); + int *var = NULL, _var = 0; + int num = 0; + + switch(type) { + case 0: + var = getCaliVariable(); + num = getCaliValue(); + sysVar[0] = save_load_var_with_file(file_name, var, num); + break; + case 1: + _var = getCaliValue(); + num = getCaliValue(); + sysVar[0] = save_load_str_with_file(file_name, _var, num); + break; + } + + DEBUG_COMMAND("LE(new) %d, %s, %d, %d:\n", type, file_name, var, num); +} + +void commands2F25() { + int file_name = getCaliValue(); + char *title = sys_getString(0); + char *filter = sys_getString(0); + + DEBUG_COMMAND_YET("LXG %d, %s, %s:\n", file_name, title, filter); +} + +void commands2F26() { + int dst_no = getCaliValue(); + int max_len = getCaliValue(); + char *title = sys_getString(0); + char *t1, *t2, *t3; + + t1 = sjis2lang(title); + t2 = sjis2lang(v_str(dst_no -1)); + + mi_param.title = t1; + mi_param.oldstring = t2; + mi_param.max = max_len; + + menu_inputstring(&mi_param); + if (mi_param.newstring == NULL) { + v_strcpy(dst_no -1, NULL); + free(t1); free(t2); + return; + } + + t3 = lang2sjis(mi_param.newstring); + + /* 全角文字以外は不可 */ + if (!sjis_has_hankaku(t3)) { + v_strcpy(dst_no -1, t3); + } + free(t1); + free(t2); + free(t3); + + DEBUG_COMMAND("MI(new) %d, %d, %s:\n", dst_no, max_len, title); +} + +void commands2F27() { + int num = getCaliValue(); + char *string = sys_getString(0); + + if (num > 0) { + v_strcpy(num - 1, string); + } else { + WARNING("MS: num <= 0\n"); + } + + DEBUG_COMMAND("MS(new) %d, %s:\n", num, string); +} + +void commands2F28() { + char *title = sys_getString(0); + + strncpy(nact->game_title_name, title, 30); + ags_setWindowTitle(title); + + DEBUG_COMMAND("MT(new) %s:\n",title); +} + +/* defined in cmdn.c */ +extern INPUTNUM_PARAM ni_param; +void commands2F29() { + char *title = sys_getString(0); + char *t; + + if (ni_param.title != NULL) { + free(ni_param.title); + } + t = sjis2lang(title); + ni_param.title = t; + + DEBUG_COMMAND("NT(new) %s:\n", title); +} + +void commands2F2A() { + int type = sys_getc(); + char *file_name = sys_getString(0); + int *var, _var = 0, cnt; + + switch(type) { + case 0: + var = getCaliVariable(); + cnt = getCaliValue(); + sysVar[0] = save_save_var_with_file(file_name, var, cnt); + break; + case 1: + _var = getCaliValue(); + cnt = getCaliValue(); + sysVar[0] = save_save_str_with_file(file_name, _var, cnt); + break; + default: + WARNING("Unknown QE command\n"); return; + } + + DEBUG_COMMAND("QE(new) %d, %s, %d, %d:\n", type, file_name, _var, cnt); +} + +void commands2F2B() { + int type = sys_getc(); + char *work_dir = sys_getString(0); + char *file_name = sys_getString(0); + + DEBUG_COMMAND_YET("UP(new) %d, %s, %s:\n", type, work_dir, file_name); +} + +void commands2F2D() { + int eCh = getCaliValue(); + int eTime = getCaliValue(); + + /* 該当する eCh が演奏中の場合 eTime だけ wait をいれる */ + mus_wav_waittime(eCh, eTime); + + DEBUG_COMMAND("wavWaitTime %d, %d:\n", eCh, eTime); +} + +void commands2F2E() { + int eCh = getCaliValue(); + int *vTime = getCaliVariable(); + + *vTime = mus_wav_get_playposition(eCh); + + DEBUG_COMMAND("wavGetPlayPos %d, %d:\n", eCh, *vTime); +} + +void commands2F2F() { + int eCh = getCaliValue(); + + /* 該当する eCh が演奏中の場合、終了まで待つ */ + /* ただし、無限ループの場合は1回目終了時まで */ + mus_wav_waitend(eCh); + + DEBUG_COMMAND("wavWaitEnd %d:\n", eCh); +} + +void commands2F30() { + int eCh = getCaliValue(); + int *vTime = getCaliVariable(); + + *vTime = mus_wav_wavtime(eCh); + + DEBUG_COMMAND("wavGetWavTime %d, %d:\n", eCh, *vTime); +} + +void commands2F31() { + int fPage = sys_getw(); + int fIndex = sys_getaddress(); + + sel_setCallback(1, fPage, fIndex); + DEBUG_COMMAND("menuSetCbkSelect page=%d, index=%x:\n", fPage, fIndex); +} + +void commands2F32() { + int fPage = sys_getw(); + int fIndex = sys_getaddress(); + + sel_setCallback(2, fPage, fIndex); + DEBUG_COMMAND("menuSetCbkCancel page=%d, index=%x:\n", fPage, fIndex); +} + +void commands2F33() { + sel_setCallback(1, 0, 0); + DEBUG_COMMAND("menuClearCbkSelect:\n"); +} + +void commands2F34() { + sel_setCallback(2, 0, 0); + DEBUG_COMMAND("menuClearCbkCancel:\n"); +} + +void commands2F35() { + int eCh = getCaliValue(); + int eMode = getCaliValue(); + + DEBUG_COMMAND_YET("wav3DSetMode %d, %d:\n", eCh, eMode); +} + +void commands2F36() { + int eDestX = getCaliValue(); + int eDestY = getCaliValue(); + int eDestWidth = getCaliValue(); + int eDestHeight = getCaliValue(); + int eSrcX = getCaliValue(); + int eSrcY = getCaliValue(); + int eSrcWidth = getCaliValue(); + int eSrcHeight = getCaliValue(); + int eMode = getCaliValue(); + + ags_scaledCopyArea(eSrcX, eSrcY, eSrcWidth, eSrcHeight, + eDestX, eDestY, eDestWidth, eDestHeight, 0); + ags_updateArea(eDestX, eDestY, eDestWidth, eDestHeight); + + DEBUG_COMMAND("grCopyStrerch %d, %d, %d, %d, %d, %d, %d, %d, %d:\n", + eDestX, eDestY, eDestWidth, eDestHeight, + eSrcX, eSrcY, eSrcWidth, eSrcHeight, eMode); +} + +void commands2F37() { + int eX = getCaliValue(); + int eY = getCaliValue(); + int eWidth = getCaliValue(); + int eHeight = getCaliValue(); + int eType = getCaliValue(); + + DEBUG_COMMAND_YET("grFilterRect %d, %d, %d, %d, %d:\n", + eX, eY, eWidth, eHeight, eType); +} + +void commands2F38() { + DEBUG_COMMAND("iptClearWheelCount:\n"); +} + +void commands2F39() { + int *vForward = getCaliVariable(); + int *vBack = getCaliVariable(); + + *vForward = 0; + *vBack = 0; + DEBUG_COMMAND("iptGetWheelCount %d, %d:\n", *vForward, *vBack); +} + +void commands2F3A() { + int *vSize = getCaliVariable(); + + *vSize = nact->sel.MsgFontSize; + DEBUG_COMMAND("menuGetFontSize %d:\n", *vSize); +} + +void commands2F3B() { + int *vSize = getCaliVariable(); + + *vSize = nact->msg.MsgFontSize; + DEBUG_COMMAND("msgGetFontSize %d:\n", *vSize); +} + +void commands2F3C() { + int eNum = getCaliValue(); + int ePos = getCaliValue(); + int *vResult = getCaliVariable(); + + if (eNum <= 0 || v_strlen(eNum -1) < ePos) { + *vResult = 0; + } else { + BYTE b1, b2 = 0; + b1 = *(v_str(eNum - 1) + ePos); + if (ePos == 0) { + *vResult = CHECKSJIS1BYTE(b1) ? 2 : 1; + } else { + b2 = *(v_str(eNum - 1) + ePos -1); + if (CHECKSJIS1BYTE(b1)) { + *vResult = 2; + } else { + *vResult = CHECKSJIS1BYTE(b2) ? 2 : 1; + } + } + } + + DEBUG_COMMAND("strGetCharType %d, %d, %d:\n", eNum, ePos, *vResult); +} + +void commands2F3D() { + int eNum = getCaliValue(); + int *vResult = getCaliVariable(); + + *vResult = v_strlen(eNum -1); + + DEBUG_COMMAND("strGetLengthASCII %d, %d:\n", eNum, *vResult); +} + +void commands2F3E() { + nact->is_message_locked = TRUE; + DEBUG_COMMAND("sysWinMsgLock:\n"); +} + +void commands2F3F() { + nact->is_message_locked = FALSE; + DEBUG_COMMAND("sysWinMsgUnlock:\n"); +} + +void commands2F40() { + int *vAry = getCaliVariable(); + int eCount = getCaliValue(); + int eNum = getCaliValue(); + int *vResult = getCaliVariable(); + int cnt = 0; + + DEBUG_COMMAND("aryCmpCount %d, %d, %d, %d:\n", *vAry, eCount, eNum, *vResult); + + while(eCount--) { + if (*vAry == eNum) cnt++; + vAry++; + } + *vResult = cnt; +} + +void commands2F41() { + int *vAry = getCaliVariable(); + int eNumof = getCaliValue(); + int eNum = getCaliValue(); + int eTransNum = getCaliValue(); + int eMaxTrans = getCaliValue(); + int *vResult = getCaliVariable(); + int cnt = 0; + + DEBUG_COMMAND("aryCmpTrans %d, %d, %d, %d, %d, %d:\n", + *vAry, eNumof, eNum, eTransNum, eMaxTrans, *vResult); + + while(eNumof--) { + if (*vAry == eNum) { + *vAry = eTransNum; + cnt++; + if (cnt >= eMaxTrans) break; + } + vAry++; + } + *vResult = cnt; +} + +void commands2F42() { + int eDestX = getCaliValue(); + int eDestY = getCaliValue(); + int eWidth = getCaliValue(); + int eHeight = getCaliValue(); + int eDestRate = getCaliValue(); + int eSrcX = getCaliValue(); + int eSrcY = getCaliValue(); + int eSrcRate = getCaliValue(); + int eType = getCaliValue(); + + DEBUG_COMMAND_YET("grBlendColorRect %d, %d, %d, %d, %d, %d, %d, %d, %d:\n", + eDestX, eDestY, eWidth, eHeight, eDestRate, + eSrcX, eSrcY, eSrcRate, eType); +} + +void commands2F43() { + int eX = getCaliValue(); + int eY = getCaliValue(); + int eLength = getCaliValue(); + int eColor = getCaliValue(); + + DEBUG_COMMAND_YET("grDrawFillCircle %d, %d, %d, %d:\n", eX, eY, eLength, eColor); +} + +void commands2F44() { + int num1 = getCaliValue(); + int fig = getCaliValue(); + int num2 = getCaliValue(); + char s[256]; + + if (fig) { + char *ss="%%%dd"; + char sss[256]; + sprintf(sss, ss, fig); + sprintf(s, sss, num2); + } else { + sprintf(s, "%d", num2); + } + v_strcpy(num1 - 1, s); + + DEBUG_COMMAND("MHH %d, %d, %d:\n", num1, fig, num2); +} + +void commands2F45() { + int fPage = sys_getw(); + int fIndex = sys_getaddress(); + + cb_sel_init_page = fPage; + cb_sel_init_address = fIndex; + + DEBUG_COMMAND("menuSetCbkInit page=%d, index=%x:\n", fPage, fIndex); +} + +void commands2F46() { + cb_sel_init_page = 0; + DEBUG_COMMAND("menuClearCbkInit:\n"); +} + +void commands2F47() { + if (cb_sel_init_page != 0) { + sl_jmpNear(sl_getIndex()); + sl_callFar2(cb_sel_init_page -1, cb_sel_init_address); + } + DEBUG_COMMAND("new ]:\n"); +} + +void commands2F48() { + char *sText = sys_getString(0); + + DEBUG_COMMAND_YET("sysOpenShell %s:\n", sText); +} + +void commands2F49() { + char *sTitle = sys_getString(0); + char *sUrl = sys_getString(0); + + DEBUG_COMMAND_YET("sysAddWebMenu %s, %s:\n", sTitle, sUrl); +} + +void commands2F4A() { + int eTime = getCaliValue(); + + ags_setCursorMoveTime(eTime); + DEBUG_COMMAND("iptSetMoveCursorTime %d:\n", eTime); +} + +void commands2F4B() { + int *vTime = getCaliVariable(); + + *vTime = ags_getCursorMoveTime(); + DEBUG_COMMAND("iptGetMoveCursorTime %d:\n", *vTime); +} + +void commands2F4C() { + int eX = getCaliValue(); + int eY = getCaliValue(); + int eSrcX = getCaliValue(); + int eSrcY = getCaliValue(); + int eWidth = getCaliValue(); + int eHeight = getCaliValue(); + + MyRectangle r; + MyPoint p; + + r.x = eSrcX; r.y = eSrcY; r.width = eWidth; r.height = eHeight; + p.x = eX, p.y = eY; + + UpdateArea(&r, &p); + + DEBUG_COMMAND("grBlt %d, %d, %d, %d, %d, %d:\n", + eX, eY, eSrcX, eSrcY, eWidth, eHeight); +} + +void commands2F4D() { + int eNum = getCaliValue(); + char *sText = sys_getString(0); + + DEBUG_COMMAND_YET("LXWT %d, %s:\n", eNum, sText); +} + +void commands2F4E() { + int eNum = getCaliValue(); + int eTextNum = getCaliValue(); + + DEBUG_COMMAND_YET("LXWS %d, %d:\n", eNum, eTextNum); +} + +void commands2F4F() { + int eNum = getCaliValue(); + int eType = getCaliValue(); + + DEBUG_COMMAND_YET("LXWE %d, %d:\n", eNum, eType); +} + +void commands2F50() { + int eFile = getCaliValue(); + int nFlg = sys_getc(); + int eNum = getCaliValue(); + + DEBUG_COMMAND_YET("LXWH %d, %d, %d:\n", eFile, nFlg, eNum); +} + +void commands2F51() { + int eFile = getCaliValue(); + int nFlg = sys_getc(); + int eNum = getCaliValue(); + + DEBUG_COMMAND_YET("LXWHH %d, %d, %d:\n", eFile, nFlg, eNum); +} + +void commands2F52() { + int eNum = getCaliValue(); + struct utsname un; + char s[256]; + + if (eNum <= 0) return; + if (uname(&un) < 0) return; + NOTICE("sysname %s nodename %s release %s version %s machine %s\n", + un.sysname, un.nodename, un.release, un.version, un.machine); + sprintf(s,"%s %s %s", + un.sysname, un.release, un.machine); + v_strcpy(eNum -1, s); + + DEBUG_COMMAND("sysGetOsName %d: %s\n", eNum, s); +} + +void commands2F53() { + int eFlag = getCaliValue(); + + nact->patch_ec = eFlag; + + DEBUG_COMMAND("patchEC %d:\n", eFlag); +} + +void commands2F54() { + int eX = getCaliValue(); + int eY = getCaliValue(); + int eWidth = getCaliValue(); + int eHeight = getCaliValue(); + + DEBUG_COMMAND_YET("mathSetClipWindow %d, %d, %d, %d:\n", eX, eY, eWidth, eHeight); +} + +void commands2F55() { + int *vDx = getCaliVariable(); + int *vDy = getCaliVariable(); + int *vSx = getCaliVariable(); + int *vSy = getCaliVariable(); + int *vWidth = getCaliVariable(); + int *vHeight = getCaliVariable(); + + DEBUG_COMMAND_YET("mathClip %d, %d, %d, %d, %d, %d:\n", + *vDx, *vDy, *vSx, *vSy, *vWidth, *vHeight); +} + +void commands2F56() { + int file_name = getCaliValue(); + char *title = sys_getString(0); + char *folder = sys_getString(0); + + DEBUG_COMMAND_YET("LXF %d, %s, %s:\n", file_name, title, folder); +} + +void commands2F57() { + char *sTitle = sys_getString(0); + int eStrVar = getCaliValue(); + int eLength = getCaliValue(); + int *vResult = getCaliVariable(); + + char *t1, *t2, *t3; + INPUTSTRING_PARAM p; + + t1 = sjis2lang(sTitle); + t2 = sjis2lang(v_str(eStrVar -1)); + p.title = t1; + p.oldstring = t2; + p.max = eLength; + + menu_inputstring(&p); + if (p.newstring == NULL) { + *vResult = 65535; + } else { + t3 = lang2sjis(p.newstring); + if (!sjis_has_hankaku(t3)) { + v_strcpy(eStrVar -1, t3); + *vResult = sjis_count_char(t3); + } else { + *vResult = 65535; + } + free(t3); + } + free(t1); + free(t2); + DEBUG_COMMAND("strInputDlg %s, %d, %d, %d:\n", + sTitle, eStrVar, eLength, *vResult); +} + +void commands2F58() { + int eNum = getCaliValue(); + int *vResult = getCaliVariable(); + + *vResult = sjis_has_hankaku(v_str(eNum) -1) ? 1 : 0; + + DEBUG_COMMAND("strCheckASCII %d, %d:\n", eNum, *vResult); +} + +void commands2F59() { + int eNum = getCaliValue(); + int *vResult = getCaliVariable(); + + *vResult = sjis_has_zenkaku(v_str(eNum) -1) ? 1 : 0; + + DEBUG_COMMAND("strCheckSJIS %d, %d:\n", eNum, *vResult); +} + +void commands2F5A() { + char *sText = sys_getString(0); + char *t1; + + t1 = sjis2lang(sText); + menu_msgbox_open(t1); + free(t1); + + DEBUG_COMMAND("strMessageBox %s:\n", sText); +} + +void commands2F5B() { + int eNum = getCaliValue(); + char *t1; + + t1 = sjis2lang(v_str(eNum) - 1); + menu_msgbox_open(t1); + free(t1); + + DEBUG_COMMAND("strMessageBoxStr %d:\n", eNum); +} + +void commands2F5C() { + int eDestX = getCaliValue(); + int eDestY = getCaliValue(); + int eSrcX = getCaliValue(); + int eSrcY = getCaliValue(); + int eWidth = getCaliValue(); + int eHeight = getCaliValue(); + int eAlpha = getCaliValue(); + + ags_copyArea_shadow_withrate(eSrcX, eSrcY, eWidth, eHeight, eDestX, eDestY, eAlpha); + DEBUG_COMMAND("grCopyUseAMapUseA %d, %d, %d, %d, %d, %d, %d:\n", + eDestX, eDestY, eSrcX, eSrcY, eWidth, eHeight, eAlpha); +} + +void commands2F5D() { + int eNum = getCaliValue(); + int eData = getCaliValue(); + + DEBUG_COMMAND_YET("grSetCEParam %d, %d:\n", eNum, eData); +} + +void commands2F5E() { + int eX = getCaliValue(); + int eY = getCaliValue(); + int eTime = getCaliValue(); + int eFlag = getCaliValue(); + + DEBUG_COMMAND_YET("grEffectMoveView %d, %d, %d, %d:\n", eX, eY, eTime, eFlag); +} + +void commands2F5F() { + int eSize = getCaliValue(); + + DEBUG_COMMAND_YET("cgSetCacheSize %d:\n", eSize); +} + +void commands2F61() { + int eChar = getCaliValue(); + int eCGNum = getCaliValue(); + + DEBUG_COMMAND_YET("gaijiSet %d, %d:\n", eChar, eCGNum); +} + +void commands2F62() { + DEBUG_COMMAND_YET("gaijiClearAll:\n"); +} + +void commands2F63() { + int *vSelect = getCaliVariable(); + + *vSelect = sel_getLastElement(); + + DEBUG_COMMAND("menuGetLatestSelect %d:\n", *vSelect); +} + +void commands2F64() { + int eType = getCaliValue(); + int eNum = getCaliValue(); + int *vResult = getCaliVariable(); + DRIFILETYPE t = DRIFILE_DATA; + dridata *dfile; + + switch(eType) { + case 0: + t = DRIFILE_DATA; + break; + case 1: + t = DRIFILE_CG; + break; + case 2: + t = DRIFILE_MIDI; + break; + case 3: + t = DRIFILE_SCO; + break; + case 4: + t = DRIFILE_WAVE; + break; + case 5: + t = DRIFILE_RSC; + break; + } + + dfile = ald_getdata(t, eNum -1); + if (dfile == NULL) { + *vResult = 0; + } else { + *vResult = 1; + } + + ald_freedata(dfile); + + DEBUG_COMMAND("lnkIsLink %d, %d, %d:\n", eType, eNum, *vResult); +} + +void commands2F65() { + int eType = getCaliValue(); + int eNum = getCaliValue(); + int *vResult = getCaliVariable(); + + DRIFILETYPE t = DRIFILE_DATA; + dridata *dfile; + + switch(eType) { + case 0: + t = DRIFILE_DATA; + break; + case 1: + t = DRIFILE_CG; + break; + case 2: + t = DRIFILE_MIDI; + break; + case 3: + t = DRIFILE_SCO; + break; + case 4: + t = DRIFILE_WAVE; + break; + case 5: + t = DRIFILE_RSC; + break; + } + + dfile = ald_getdata(t, eNum -1); + if (dfile == NULL) { + *vResult = 0; + } else { + *vResult = 1; + } + + ald_freedata(dfile); + + DEBUG_COMMAND("lnkIsData %d, %d, %d:\n", eType, eNum, *vResult); +} + +void commands2F66() { + int eNum = getCaliValue(); + int page = sys_getw(); + int index = sys_getdw(); + + DEBUG_COMMAND("fncSetTable %d, %d,%d:\n", eNum, page, index); + + if (eNum >= FCTBL_MAX) { + WARNING("fncSetTable: too many table number %d\n", eNum); + return; + } + + fnctbl[eNum].page = page; + fnctbl[eNum].index = index; +} + +void commands2F67() { + int eNum = getCaliValue(); + int eStrNum = getCaliValue(); + int *vResult = getCaliVariable(); + int i; + + for (i = 0; i < nact->ain.fncnum; i++) { + if (0 == strcmp(nact->ain.fnc[i].name, v_str(eStrNum -1))) { + fnctbl[eNum].page = nact->ain.fnc[i].page; + fnctbl[eNum].index = nact->ain.fnc[i].index; + break; + } + } + + *vResult = (i == nact->ain.fncnum) ? 0 : !0; + + DEBUG_COMMAND("fncSetTableFromStr %d, %d, %d:\n", eNum, eStrNum, *vResult); +} + +void commands2F68() { + int eNum = getCaliValue(); + + DEBUG_COMMAND("fncClearTable %d:\n", eNum); + + if (eNum >= FCTBL_MAX) { + WARNING("fncClearTable: too many table number %d\n", eNum); + return; + } + + fnctbl[eNum].page = 0; + fnctbl[eNum].index = 0; +} + +void commands2F69() { + int eNum = getCaliValue(); + + DEBUG_COMMAND("fncCall %d:\n", eNum); + + if (eNum >= FCTBL_MAX) { + WARNING("fncClearTable: too many table number %d\n", eNum); + return; + } + + if (fnctbl[eNum].page == 0 && fnctbl[eNum].index == 0) { + return; + } + + sl_callFar2(fnctbl[eNum].page -1, fnctbl[eNum].index); +} + +void commands2F6A() { + int eNum = getCaliValue(); + + nact->fnc_return_value = eNum; + + DEBUG_COMMAND("fncSetReturnCode %d:\n", eNum); +} + +void commands2F6B() { + int *vNum = getCaliVariable(); + + *vNum = nact->fnc_return_value; + + DEBUG_COMMAND("fncGetReturnCode %d:\n", *vNum); +} + +void commands2F6C() { + int eFlag = getCaliValue(); + + nact->is_msg_out = eFlag != 0 ? TRUE : FALSE; + + DEBUG_COMMAND("msgSetOutputFlag %d:\n", eFlag); +} + +void commands2F6D() { + int eNum = getCaliValue(); + int *vResult = getCaliVariable(); + + *vResult = save_delete_file(eNum -1); + + DEBUG_COMMAND("saveDeleteFile %d, %d:\n", eNum, *vResult); +} + +void commands2F6E() { + int eFlag = getCaliValue(); + + DEBUG_COMMAND_YET("wav3DSetUseFlag %d:\n", eFlag); +} + +void commands2F6F() { + int eCh = getCaliValue(); + int eTime = getCaliValue(); + int eVolume = getCaliValue(); + int eStopFlag = getCaliValue(); + + mus_wav_fadeout_start(eCh, eTime, eVolume, eStopFlag); + + DEBUG_COMMAND("wavFadeVolume %d, %d, %d, %d:\n", eCh, eTime, eVolume, eStopFlag); +} + +void commands2F70() { + int eFlag = getCaliValue(); + + nact->patch_emen = eFlag; + + DEBUG_COMMAND("patchEMEN %d:\n", eFlag); +} + +void commands2F71() { + int eFlag = getCaliValue(); + + DEBUG_COMMAND_YET("wmenuEnableMsgSkip %d:\n", eFlag); +} + +void commands2F72() { + int *vFlag = getCaliVariable(); + + DEBUG_COMMAND_YET("winGetFlipFlag %p:\n", vFlag); +} + +void commands2F73() { + int *vTrack = getCaliVariable(); + + *vTrack = mus_cdrom_get_maxtrack(); + + DEBUG_COMMAND("cdGetMaxTrack %d:\n", *vTrack); +} + +void commands2F74() { + char *str1 = sys_getString(0); + int *var = getCaliVariable(); + + DEBUG_COMMAND_YET("dlgErrorOkCancel %s,%d:\n", str1, *var); +} + +void commands2F75() { + int eNumof = getCaliValue(); + + sel_reduce(eNumof); + + DEBUG_COMMAND("menuReduce %d:\n", eNumof); +} + +void commands2F76() { + int *var = getCaliVariable(); + + *var = sel_getnumberof(); + + //DEBUG_COMMAND("menuGetNumof %p:\n", var); + DEBUG_COMMAND("menuGetNumof %d:\n", *var); +} + +void commands2F77() { + int eStrNum = getCaliValue(); + int eSelectNum = getCaliValue(); + + v_strcpy(eStrNum -1, sel_gettext(eSelectNum)); + + DEBUG_COMMAND("menuGetText %d,%d:\n", eStrNum, eSelectNum); +} + +void commands2F78() { + int eSelectNum = getCaliValue(); + int eClearFlag = getCaliValue(); + + sel_goto(eSelectNum, eClearFlag); + + DEBUG_COMMAND("menuGoto %d,%d:\n", eSelectNum, eClearFlag); +} + +void commands2F79() { + int eSelectNum = getCaliValue(); + int eClearFlag = getCaliValue(); + + sel_returengoto(eSelectNum, eClearFlag); + + DEBUG_COMMAND("menuReturnGoto %d,%d:\n", eSelectNum, eClearFlag); +} + +void commands2F7A() { + DEBUG_COMMAND_YET("menuFreeShelterDIB:\n"); +} + +void commands2F7B() { + DEBUG_COMMAND_YET("msgFreeShelterDIB:\n"); +} + +void commands2F7C() { + int index = sys_getdw(); + + sys_addMsg(nact->ain.msg[index]); + + DEBUG_COMMAND("2F7C %d:\n", index); +} + +void commands2F7D() { + int index = sys_getdw(); + + commandH(); + sys_addMsg(nact->ain.msg[index]); + + // DEBUG_COMMAND_YET("2F7D %d, %d, %d:\n", index, page, p1); + DEBUG_COMMAND("2F7D %d:\n", index); +} + +void commands2F7E() { + int index = sys_getdw(); + + commandHH(); + sys_addMsg(nact->ain.msg[index]); + + //DEBUG_COMMAND_YET("2F7E %d, %d, %d:\n", index, p1, p2); + DEBUG_COMMAND("2F7E %d:\n", index); +} + +void commands2F7F() { + int index = sys_getdw(); + int p1 = sys_getCaliValue(); + + sys_addMsg(v_str(p1 -1)); + sys_addMsg(nact->ain.msg[index]); + + DEBUG_COMMAND("2F7F %d, %d(%s,%s):\n", index, p1, nact->ain.msg[index], v_str(p1 -1)); +} + +void commands2F80() { + int page = sys_getw(); + int index = sys_getdw(); + + if (NULL == (nact->datatbl_addr = sl_setDataTable(page -1, index))) { + WARNING("dataSetPointer set failed\n"); + } + + DEBUG_COMMAND("dataSetPointer %d,%x\n", page, index); +} + +void commands2F81() { + int *vData = sys_getCaliVariable(); + int eNumof = sys_getCaliValue(); + int i; + WORD *p = (WORD *)nact->datatbl_addr; + + for (i = 0; i < eNumof; i++) { + *vData = LittleEndian_getW((BYTE *)p, 0); + p++; + vData++; + } + + nact->datatbl_addr = p; + + DEBUG_COMMAND("dataGetWORD %p,%d(%p):\n", vData, eNumof, nact->datatbl_addr); +} + +void commands2F82() { + int eStrNum = sys_getCaliValue(); + int eNumof = sys_getCaliValue(); + int i; + char *p = (char *)nact->datatbl_addr; + + DEBUG_COMMAND("dataGetString %d,%d:\n", eStrNum, eNumof); + + for (i = 0; i < eNumof; i++) { + v_strcpy(eStrNum + i -1, p); + p += (strlen(p) + 1); + } + + nact->datatbl_addr = p; +} + +void commands2F83() { + int eNumof = sys_getCaliValue(); + WORD *p = (WORD *)nact->datatbl_addr; + + p += eNumof; + + nact->datatbl_addr = p; + + DEBUG_COMMAND("dataSkipWORD %d:\n", eNumof); +} + +void commands2F84() { + int eNumof = sys_getCaliValue(); + int i; + char *p = (char *)nact->datatbl_addr; + + for (i = 0; i < eNumof; i++) { + p += (strlen(p) + 1); + } + + nact->datatbl_addr = p; + + DEBUG_COMMAND("dataSkipString %d:\n", eNumof); +} + +void commands2F85() { + int *vResult = sys_getCaliVariable(); + + *vResult = SYSVAR_MAX; + + DEBUG_COMMAND("varGetNumof %p:\n", vResult); +} + +void commands2F86() { + int eFlag = sys_getCaliValue(); + + nact->patch_g0 = eFlag; + + DEBUG_COMMAND("patchG0 %d:\n", eFlag); +} + +void commands2F87() { + int eSubKeyStrNum = sys_getCaliValue(); + int eBaneStrNum = sys_getCaliValue(); + int eResultStrNum = sys_getCaliValue(); + int *vResult = sys_getCaliVariable(); + + *vResult = 1; + + DEBUG_COMMAND("regReadString %d,%d,%d,%d:\n", + eSubKeyStrNum, eBaneStrNum, eResultStrNum, *vResult); +} + +void commands2F88() { + int eFileNameStrNum = sys_getCaliValue(); + int *vResult = sys_getCaliVariable(); + + *vResult = 1; + + DEBUG_COMMAND("fileCheckExist %d,%d:\n", eFileNameStrNum, *vResult); +} + +void commands2F89() { + int eYear = sys_getCaliValue(); + int eMonth = sys_getCaliValue(); + int eData = sys_getCaliValue(); + int *vResult = sys_getCaliVariable(); + + DEBUG_COMMAND_YET("timeCheckCurDate %d,%d,%d,%p:\n", eYear, eMonth, eData, vResult); +} + +void commands2F8A() { + char *s2 = sys_getConstString(); + char *s3 = sys_getConstString(); + + DEBUG_COMMAND_YET("dlgManualProtect %s,%s:\n", s2, s3); +} + +void commands2F8B() { + char *s2 = sys_getConstString(); + int c3 = sys_getCaliValue(); + int c4 = sys_getCaliValue(); + char *s6 = sys_getConstString(); + int *c7 = sys_getCaliVariable(); + + *c7 = 1; + + DEBUG_COMMAND_YET("fileCheckDVD %s,%d,%d,%s,%p:\n", s2, c3, c4, s6, c7); +} + +void commands2F8C() { + DEBUG_COMMAND("sysReset:\n"); + sys_reset(); +} diff --git a/src/cmd2F60.c b/src/cmd2F60.c new file mode 100644 index 0000000..5114ca3 --- /dev/null +++ b/src/cmd2F60.c @@ -0,0 +1,64 @@ +/* + * cmd2F60.c SYSTEM35 DLL call + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmd2F60.c,v 1.11 2003/01/12 10:48:50 chikama Exp $ */ + +#include +#include + +#include "portab.h" +#include "system.h" +#include "nact.h" +#include "s39ain.h" +#include "xsystem35.h" + +#define dll nact->ain.dll +#define msgi nact->ain.msg + +typedef void *entrypoint (void); + +void commands2F60() { + int type = sys_getdw(); /* DLL type */ + int fnum = sys_getdw(); /* function number */ + entrypoint *function = NULL; + + if (dll == NULL) { + SYSERROR("No DLL initilized\n"); + } + + if (dll + type == NULL) goto eexit; + + if (dll[type].handle == NULL) goto eexit; + + if (dll[type].function_num < fnum) goto eexit; + + if (dll[type].function[fnum].name == NULL) goto eexit; + + function = lt_dlsym((lt_dlhandle)(dll[type].handle), dll[type].function[fnum].name); + + if (function) { + (*function)(); + return; + } + + eexit: + SYSERROR("Can't continue further scenario.(%d,%d)(%s,%s)\n", type, fnum, dll[type].name, dll[type].function[fnum].name); +} diff --git a/src/cmd_check.c b/src/cmd_check.c new file mode 100644 index 0000000..5a25e8a --- /dev/null +++ b/src/cmd_check.c @@ -0,0 +1,1183 @@ +/* + * cmd_check.c SYSTEM35のコマンド解析 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmd_check.c,v 1.35 2003/04/22 16:34:28 chikama Exp $ */ + +#include +#include + +#include "portab.h" +#include "cmd_check.h" +#include "scenario.h" +#include "xsystem35.h" +#include "selection.h" +#include "message.h" +#include "imput.h" + +static void undeferr(); + +static void commandsINC() { + int *var = getCaliVariable(); + if (*var < 65535) (*var)++; +} + +static void commandsDEC() { + int *var = getCaliVariable(); + if (*var > 0) (*var)--; +} + +/* 変数の代入 */ +static void letVar(int type) { + int *varno = getVariable(); + int val = getCaliValue(); + + if (varno == NULL) { + WARNING("varno is NULL\n"); + return; + } + + switch(type) { + case '!': + *varno = val; break; + case 0x10: /* += */ + *varno = (int)(WORD)(*varno + val); break; + case 0x11: /* -= */ + *varno = max(0, *varno - val); break; + case 0x12: /* *= */ + *varno = (int)(WORD)(*varno * val); break; + case 0x13: /* /= */ + if (val == 0) *varno = 0; + else *varno /= val; + break; + case 0x14: /* %= */ + if (val == 0) *varno = 0; + else *varno %= val; + break; + case 0x15: /* &= */ + *varno &= val; break; + case 0x16: /* |= */ + *varno |= val; break; + case 0x17: /* ^= */ + *varno ^= val; break; + } + + // printf("letvar %p=%d\n",varno, val); +} + +/* データテーブルの設定 */ +static void getDataTableAdr() { + int index = sys_getaddress(); + int offset = sys_getCaliValue(); + + if (offset) { + index = sl_getdAt(index + 4 * (offset - 1)); + } + + if (NULL == (nact->datatbl_addr = sl_setDataTable(sl_getPage(), index))) { + WARNING("data table address set failed\n"); + } +} + +/* < ループ開始 */ +static void loopStart() { + int p1 = sys_getc(); + int exitadr, limit, direction, step; + int *var; + + if (p1 == 0) { + sys_getc(); + sys_getc(); + } else if (p1 != 1) { + undeferr(); + } + + exitadr = sys_getaddress(); + var = getCaliVariable(); + limit = getCaliValue(); + direction = getCaliValue(); + step = getCaliValue(); + + if (direction == 0) { + /* dec */ + if (p1 == 1) { + *var -= step; + } + if (*var < limit) { + if (p1 == 0) *var-= step; + sl_jmpNear(exitadr); + if (*var < 0) { *var = 0; } + return; + } + } else if (direction == 1) { + /* inc */ + if (p1 == 1) { + *var += step; + } + if (*var > limit) { + // if (p1 == 0) *var+= step; + sl_jmpNear(exitadr); + if (*var > 65535) { *var = 65535; } + return; + } + } else { + undeferr(); + } + return; +} + +static void undeferr() { + SYSERROR("Undefined Command:@ %03d,%05x\n", sl_getPage(), sl_getIndex()); +} + +void check_command(int c0) { + int page, index; + int bool; + + switch(c0) { + case 0: + /* メッセージのゴミ? */ + break; + case '!': + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + /* 変数代入 */ + letVar(c0); + break; + case '#': + /* データテーブルアドレス指定 */ + getDataTableAdr(); + break; + case '$': + /* 選択肢の登録 */ + if (nact->sel.in_setting) { + sel_fixElement(); + nact->sel.in_setting = FALSE; + } else { + sel_addRetValue(sys_getaddress()); + nact->sel.in_setting = TRUE; + } + break; + case '%': + /* ページコール */ + page = getCaliValue(); + if (page == 0) { + sl_retFar(); + } else { + sl_callFar(page); + } + break; + case '&': + /* ページジャンプ */ + sl_jmpFar(getCaliValue()); + break; + case '@': + /* puts("ラベルジャンプ") */ + sl_jmpNear(sys_getaddress()); + break; + case '<': + /* for loop */ + loopStart(); + break; + case '>': + /* loop end */ + sl_jmpNear(sys_getaddress()); + break; + case '/': + /* 小文字コマンド */ + switch(sl_getc()) { + case 0x00: + commands2F00(); break; + case 0x01: + commands2F01(); break; + case 0x02: + commands2F02(); break; + case 0x03: + commands2F03(); break; + case 0x04: + commands2F04(); break; + case 0x05: + commands2F05(); break; + case 0x06: + commandsINC(); break; + case 0x07: + commandsDEC(); break; + case 0x08: + commands2F08(); break; + case 0x09: + commands2F09(); break; + case 0x0a: + commands2F0A(); break; + case 0x0b: + commands2F0B(); break; + case 0x0c: + commands2F0C(); break; + case 0x0d: + commands2F0D(); break; + case 0x0e: + commands2F0E(); break; + case 0x0f: + commands2F0F(); break; + case 0x10: + commands2F10(); break; + case 0x11: + commands2F11(); break; + case 0x12: + commands2F12(); break; + case 0x13: + commands2F13(); break; + case 0x14: + commands2F14(); break; + case 0x15: + commands2F15(); break; + case 0x16: + commands2F16(); break; + case 0x17: + commands2F17(); break; + case 0x18: + commands2F18(); break; + case 0x19: + commands2F19(); break; + case 0x1a: + commands2F1A(); break; + case 0x1b: + commands2F1B(); break; + case 0x1c: + commands2F1C(); break; + case 0x1d: + commands2F1D(); break; + case 0x1e: + commands2F1E(); break; + case 0x1f: + commands2F1F(); break; + case 0x20: + commands2F20(); break; + case 0x21: + commands2F21(); break; + case 0x22: + commandHH(); break; + case 0x23: + commands2F23(); break; + case 0x24: + commands2F24(); break; + case 0x25: + commands2F25(); break; + case 0x26: + commands2F26(); break; + case 0x27: + commands2F27(); break; + case 0x28: + commands2F28(); break; + case 0x29: + commands2F29(); break; + case 0x2a: + commands2F2A(); break; + case 0x2b: + commands2F2B(); break; + case 0x2c: + commandF(); break; + case 0x2d: + commands2F2D(); break; + case 0x2e: + commands2F2E(); break; + case 0x2f: + commands2F2F(); break; + case 0x30: + commands2F30(); break; + case 0x31: + commands2F31(); break; + case 0x32: + commands2F32(); break; + case 0x33: + commands2F33(); break; + case 0x34: + commands2F34(); break; + case 0x35: + commands2F35(); break; + case 0x36: + commands2F36(); break; + case 0x37: + commands2F37(); break; + case 0x38: + commands2F38(); break; + case 0x39: + commands2F39(); break; + case 0x3a: + commands2F3A(); break; + case 0x3b: + commands2F3B(); break; + case 0x3c: + commands2F3C(); break; + case 0x3d: + commands2F3D(); break; + case 0x3e: + commands2F3E(); break; + case 0x3f: + commands2F3F(); break; + case 0x40: + commands2F40(); break; + case 0x41: + commands2F41(); break; + case 0x42: + commands2F42(); break; + case 0x43: + commands2F43(); break; + case 0x44: + commands2F44(); break; + case 0x45: + commands2F45(); break; + case 0x46: + commands2F46(); break; + case 0x47: + commands2F47(); break; + case 0x48: + commands2F48(); break; + case 0x49: + commands2F49(); break; + case 0x4a: + commands2F4A(); break; + case 0x4b: + commands2F4B(); break; + case 0x4c: + commands2F4C(); break; + case 0x4d: + commands2F4D(); break; + case 0x4e: + commands2F4E(); break; + case 0x4f: + commands2F4F(); break; + case 0x50: + commands2F50(); break; + case 0x51: + commands2F51(); break; + case 0x52: + commands2F52(); break; + case 0x53: + commands2F53(); break; + case 0x54: + commands2F54(); break; + case 0x55: + commands2F55(); break; + case 0x56: + commands2F56(); break; + case 0x57: + commands2F57(); break; + case 0x58: + commands2F58(); break; + case 0x59: + commands2F59(); break; + case 0x5a: + commands2F5A(); break; + case 0x5b: + commands2F5B(); break; + case 0x5c: + commands2F5C(); break; + case 0x5d: + commands2F5D(); break; + case 0x5e: + commands2F5E(); break; + case 0x5f: + commands2F5F(); break; + case 0x60: + commands2F60(); break; + case 0x61: + commands2F61(); break; + case 0x62: + commands2F62(); break; + case 0x63: + commands2F63(); break; + case 0x64: + commands2F64(); break; + case 0x65: + commands2F65(); break; + case 0x66: + commands2F66(); break; + case 0x67: + commands2F67(); break; + case 0x68: + commands2F68(); break; + case 0x69: + commands2F69(); break; + case 0x6a: + commands2F6A(); break; + case 0x6b: + commands2F6B(); break; + case 0x6c: + commands2F6C(); break; + case 0x6d: + commands2F6D(); break; + case 0x6e: + commands2F6E(); break; + case 0x6f: + commands2F6F(); break; + case 0x70: + commands2F70(); break; + case 0x71: + commands2F71(); break; + case 0x72: + commands2F72(); break; + case 0x73: + commands2F73(); break; + case 0x74: + commands2F74(); break; + case 0x75: + commands2F75(); break; + case 0x76: + commands2F76(); break; + case 0x77: + commands2F77(); break; + case 0x78: + commands2F78(); break; + case 0x79: + commands2F79(); break; + case 0x7A: + commands2F7A(); break; + case 0x7B: + commands2F7B(); break; + case 0x7C: + commands2F7C(); break; + case 0x7D: + commands2F7D(); break; + case 0x7E: + commands2F7E(); break; + case 0x7F: + commands2F7F(); break; + case 0x80: + commands2F80(); break; + case 0x81: + commands2F81(); break; + case 0x82: + commands2F82(); break; + case 0x83: + commands2F83(); break; + case 0x84: + commands2F84(); break; + case 0x85: + commands2F85(); break; + case 0x86: + commands2F86(); break; + case 0x87: + commands2F87(); break; + case 0x88: + commands2F88(); break; + case 0x89: + commands2F89(); break; + case 0x8A: + commands2F8A(); break; + case 0x8B: + commands2F8B(); break; + case 0x8C: + commands2F8C(); break; + default: + undeferr(); + } + break; + case 'A': + /* hit Any Key */ + sys_hit_any_key(); + msg_nextPage(TRUE); + DEBUG_COMMAND("A\n"); + break; + case 'B': + switch(sl_getc()) { + case 0: + commandB0(); break; + case 1: + commandB1(); break; + case 2: + commandB2(); break; + case 3: + commandB3(); break; + case 4: + commandB4(); break; + case 10: + commandB10(); break; + case 11: + commandB11(); break; + case 12: + commandB12(); break; + case 13: + commandB13(); break; + case 14: + commandB14(); break; + case 21: + commandB21(); break; + case 22: + commandB22(); break; + case 23: + commandB23(); break; + case 24: + commandB24(); break; + case 31: + commandB31(); break; + case 32: + commandB32(); break; + case 33: + commandB33(); break; + case 34: + commandB34(); break; + default: + undeferr(); + } + break; + case 'C': + switch(sl_getc()) { + case 'B': + commandCB(); break; + case 'C': + commandCC(); break; + case 'D': + commandCD(); break; + case 'E': + commandCE(); break; + case 'F': + commandCF(); break; + case 'K': + commandCK(); break; + case 'L': + commandCL(); break; + case 'M': + commandCM(); break; + case 'P': + commandCP(); break; + case 'S': + commandCS(); break; + case 'T': + commandCT(); break; + case 'U': + commandCU(); break; + case 'V': + commandCV(); break; + case 'X': + commandCX(); break; + case 'Y': + commandCY(); break; + case 'Z': + commandCZ(); break; + default: + undeferr(); + } + break; + case 'D': + switch(sl_getc()) { + case 'C': + commandDC(); break; + case 'I': + commandDI(); break; + case 'S': + commandDS(); break; + case 'R': + commandDR(); break; + case 'F': + commandDF(); break; + default: + undeferr(); + } + break; + case 'E': + switch(sl_getc()) { + case 'S': + commandES(); break; + case 'C': + commandEC(); break; + case 'G': + commandEG(); break; + case 'M': + commandEM(); break; + case 'N': + commandEN(); break; + default: + undeferr(); + } + break; + case 'F': + commandF(); break; + case 'G': + switch(sl_getc()) { + case 0: + commandG0(); break; + case 1: + commandG1(); break; + case 'S': + commandGS(); break; + case 'X': + commandGX(); break; + default: + undeferr(); + } + break; + case 'H': + commandH(); break; + case 'I': + switch(sl_getc()) { + case 'K': + commandIK(); break; + case 'M': + commandIM(); break; + case 'C': + commandIC(); break; + case 'Z': + commandIZ(); break; + case 'X': + commandIX(); break; + case 'Y': + commandIY(); break; + case 'G': + commandIG(); break; + case 'E': + commandIE(); break; + default: + undeferr(); + } + break; + case 'J': + switch(sl_getc()) { + case 0: + commandJ0(); break; + case 1: + commandJ1(); break; + case 2: + commandJ2(); break; + case 3: + commandJ3(); break; + case 4: + commandJ4(); break; + default: + undeferr(); + } + break; + case 'K': + switch(sl_getc()) { + case 'I': + commandKI(); break; + case 'K': + commandKK(); break; + case 'N': + commandKN(); break; + case 'P': + commandKP(); break; + case 'Q': + commandKQ(); break; + case 'R': + commandKR(); break; + case 'W': + commandKW(); break; + default: + undeferr(); + } + break; + case 'L': + switch(sl_getc()) { + case 'C': + commandLC(); break; + case 'D': + commandLD(); break; + case 'P': + commandLP(); break; + case 'T': + commandLT(); break; + case 'E': + commandLE(); break; + case 'L': + commandLL(); break; + case 'H': + switch(sl_getc()) { + case 'D': + commandLHD(); break; + case 'G': + commandLHG(); break; + case 'M': + commandLHM(); break; + case 'S': + commandLHS(); break; + case 'W': + commandLHW(); break; + default: + undeferr(); + } + break; + case 'X': + switch(sl_getc()) { + case 'G': + commandLXG(); break; + case 'O': + commandLXO(); break; + case 'C': + commandLXC(); break; + case 'L': + commandLXL(); break; + case 'S': + commandLXS(); break; + case 'P': + commandLXP(); break; + case 'R': + commandLXR(); break; + case 'W': + commandLXW(); break; + default: + undeferr(); + } + break; + default: + undeferr(); + } + break; + case 'M': + switch(sl_getc()) { + case 'A': + commandMA(); break; + case 'C': + commandMC(); break; + case 'D': + commandMD(); break; + case 'E': + commandME(); break; + case 'F': + commandMF(); break; + case 'G': + commandMG(); break; + case 'H': + commandMH(); break; + case 'I': + commandMI(); break; + case 'J': + commandMJ(); break; + case 'L': + commandML(); break; + case 'M': + commandMM(); break; + case 'N': + commandMN(); break; + case 'P': + commandMP(); break; + case 'S': + commandMS(); break; + case 'T': + commandMT(); break; + case 'V': + commandMV(); break; + case 'Z': + switch(sl_getc()) { + case 0: + commandMZ0(); break; + default: + undeferr(); + } + break; + default: + undeferr(); + } + break; + case 'N': + switch(sl_getc()) { + case '+': + commandN_ADD(); break; + case '-': + commandN_SUB(); break; + case '*': + commandN_MUL(); break; + case '/': + commandN_DIV(); break; + case '>': + commandN_GT(); break; + case '<': + commandN_LT(); break; + case '=': + commandN_EQ(); break; + case '\\': + commandN_NE(); break; + case '&': + commandN_AND(); break; + case '|': + commandN_OR(); break; + case '^': + commandN_XOR(); break; + case '~': + commandN_NOT(); break; + case 'B': + commandNB(); break; + case 'C': + commandNC(); break; + case 'I': + commandNI(); break; + case 'P': + commandNP(); break; + case 'R': + commandNR(); break; + case 'O': + commandNO(); break; + case 'T': + commandNT(); break; + case 'D': + switch(sl_getc()) { + case 'C': + commandNDC(); break; + case 'D': + commandNDD(); break; + case 'M': + commandNDM(); break; + case 'A': + commandNDA(); break; + case 'H': + commandNDH(); break; + case '+': + commandND_ADD(); break; + case '-': + commandND_SUB(); break; + case '*': + commandND_MUL(); break; + case '/': + commandND_DIV(); break; + default: + undeferr(); + } + break; + default: + undeferr(); + } + break; + case 'O': + commandO(); break; + case 'P': + switch(sl_getc()) { + case 'C': + commandPC(); break; + case 'D': + commandPD(); break; + case 'F': + commandPF(); break; + case 'G': + commandPG(); break; + case 'N': + commandPN(); break; + case 'P': + commandPP(); break; + case 'S': + commandPS(); break; + case 'W': + commandPW(); break; + case 'T': + switch(sl_getc()) { + case 0: + commandPT0(); break; + case 1: + commandPT1(); break; + case 2: + commandPT2(); break; + default: + undeferr(); + } + break; + default: + undeferr(); + } + break; + case 'Q': + switch(sl_getc()) { + case 'C': + commandQC(); break; + case 'D': + commandQD(); break; + case 'E': + commandQE(); break; + case 'P': + commandQP(); break; + default: + undeferr(); + } + break; + case 'R': + /* 改行 */ + DEBUG_MESSAGE("\n"); + msg_nextLine(); + break; + case 'S': + switch(sl_getc()) { + case 'C': + commandSC(); break; + case 'G': + commandSG(); break; + case 'L': + commandSL(); break; + case 'M': + commandSM(); break; + case 'O': + commandSO(); break; + case 'P': + commandSP(); break; + case 'Q': + commandSQ(); break; + case 'R': + commandSR(); break; + case 'S': + commandSS(); break; + case 'T': + commandST(); break; + case 'U': + commandSU(); break; + case 'W': + commandSW(); break; + case 'X': + commandSX(); break; + case 'I': + commandSI(); break; + default: + undeferr(); + } + break; + case 'T': + commandT(); break; + case 'U': + switch(sl_getc()) { + case 'C': + commandUC(); break; + case 'D': + commandUD(); break; + case 'R': + commandUR(); break; + case 'S': + commandUS(); break; + case 'G': + commandUG(); break; + case 'P': + switch(sl_getc()) { + case 0: + commandUP0(); break; + case 1: + commandUP1(); break; + case 2: + case 3: + commandUP3(); break; + default: + undeferr(); + } + break; + default: + undeferr(); + } + break; + case 'V': + switch(sl_getc()) { + case 'C': + commandVC(); break; + case 'P': + commandVP(); break; + case 'S': + commandVS(); break; + case 'G': + commandVG(); break; + case 'H': + commandVH(); break; + case 'F': + commandVF(); break; + case 'V': + commandVV(); break; + case 'R': + commandVR(); break; + case 'W': + commandVW(); break; + case 'E': + commandVE(); break; + case 'Z': + commandVZ(); break; + case 'X': + commandVX(); break; + case 'T': + commandVT(); break; + case 'B': + commandVB(); break; + case 'I': + switch(sl_getc()) { + case 'C': + commandVIC(); break; + case 'P': + commandVIP(); break; + default: + undeferr(); + } + break; + case 'A': + commandVA(); break; + case 'J': + commandVJ(); break; + default: + undeferr(); + } + break; + case 'W': + switch(sl_getc()) { + case 'W': + commandWW(); break; + case 'V': + commandWV(); break; + case 'X': + commandWX(); break; + case 'Z': + commandWZ(); break; + default: + undeferr(); + } + break; + case 'X': + { + int num=getCaliValue(); + sys_addMsg(v_str(num - 1)); + DEBUG_COMMAND("X %d:\n", num); + } + break; + case 'Y': + commandY(); break; + case 'Z': + switch(sl_getc()) { + case 'C': + commandZC(); break; + case 'M': + commandZM(); break; + case 'S': + commandZS(); break; + case 'B': + commandZB(); break; + case 'H': + commandZH(); break; + case 'W': + commandZW(); break; + case 'L': + commandZL(); break; + case 'E': + commandZE(); break; + case 'F': + commandZF(); break; + case 'D': + commandZD(); break; + case 'T': + switch(sl_getc()) { + case 0: + commandZT0(); break; + case 1: + commandZT1(); break; + case 2: + commandZT2(); break; + case 3: + commandZT3(); break; + case 4: + commandZT4(); break; + case 5: + commandZT5(); break; + case 10: + commandZT10(); break; + case 11: + commandZT11(); break; + case 20: + commandZT20(); break; + case 21: + commandZT21(); break; + default: + undeferr(); + } + break; + case 'Z': + switch(sl_getc()) { + case 0: + commandZZ0(); break; + case 1: + commandZZ1(); break; + case 2: + commandZZ2(); break; + case 3: + commandZZ3(); break; + case 4: + commandZZ4(); break; + case 5: + commandZZ5(); break; + case 7: + commandZZ7(); break; + case 8: + commandZZ8(); break; + case 9: + commandZZ9(); break; + case 10: + commandZZ10(); break; + case 13: + commandZZ13(); break; + case 14: + commandZZ14(); break; + default: + undeferr(); + } + break; + case 'G': + commandZG(); break; + case 'I': + commandZI(); break; + case 'A': + commandZA(); break; + case 'K': + commandZK(); break; + case 'R': + commandZR(); break; + default: + undeferr(); + } + break; + case '\\': + /* label call */ + index = sys_getaddress(); + if (index == 0) { + sl_retNear(); + } else { + sl_callNear(index); + } + break; + case ']': + /* puts("選択"); */ + sel_select(); + break; + case '{': + /* puts("条件文"); */ + bool = getCaliValue(); + index = sys_getaddress(); + if (bool == 0) { + sl_jmpNear(index); + } + break; + case '~': + /* label far call */ + page = sys_getw(); + if (page == 0x0000) { + // puts("~ cali:"); + nact->fnc_return_value = getCaliValue(); + sl_retFar(); + } else if (page == 0xffff) { + // puts("~~ cali:"); + *getCaliVariable() = nact->fnc_return_value; + } else { + sl_callFar2(page - 1, sys_getaddress()); + } + break; + default: + undeferr(); + } +} diff --git a/src/cmd_check.h b/src/cmd_check.h new file mode 100644 index 0000000..a2eb393 --- /dev/null +++ b/src/cmd_check.h @@ -0,0 +1,449 @@ +/* + * cmd_check.h SYSTEM35のコマンド解析 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmd_check.h,v 1.21 2003/04/22 16:34:28 chikama Exp $ */ + +#ifndef __CMD_CHECK__ +#define __CMD_CHECK__ + +/* define by cmdb.c */ +extern void commandB0(); +extern void commandB1(); +extern void commandB2(); +extern void commandB3(); +extern void commandB4(); +extern void commandB10(); +extern void commandB11(); +extern void commandB12(); +extern void commandB13(); +extern void commandB14(); +extern void commandB21(); +extern void commandB22(); +extern void commandB23(); +extern void commandB24(); +extern void commandB31(); +extern void commandB32(); +extern void commandB33(); +extern void commandB34(); + +/* defined by cmdc.c */ +extern void commandCB(); +extern void commandCC(); +extern void commandCD(); +extern void commandCE(); +extern void commandCF(); +extern void commandCK(); +extern void commandCL(); +extern void commandCM(); +extern void commandCP(); +extern void commandCS(); +extern void commandCT(); +extern void commandCU(); +extern void commandCV(); +extern void commandCX(); +extern void commandCY(); +extern void commandCZ(); + +/* defined by cmdd.c */ +extern void commandDC(); +extern void commandDI(); +extern void commandDS(); +extern void commandDR(); +extern void commandDF(); + +/* defined by cmde.c */ +extern void commandES(); +extern void commandEC(); +extern void commandEG(); +extern void commandEM(); +extern void commandEN(); + +/* defined by cmdf.c */ +extern void commandF(); + +/* defined by cmdg.c */ +extern void commandG0(); +extern void commandG1(); +extern void commandGS(); +extern void commandGX(); + +/* defined by cmdh.c */ +extern void commandH(); +extern void commandHH(); + +/* defined by cmdi.c */ +extern void commandIK(); +extern void commandIM(); +extern void commandIC(); +extern void commandIZ(); +extern void commandIX(); +extern void commandIY(); +extern void commandIG(); +extern void commandIE(); + +/* defined by cmdj.c */ +extern void commandJ0(); +extern void commandJ1(); +extern void commandJ2(); +extern void commandJ3(); +extern void commandJ4(); + +/* defined by cmdk.c */ +extern void commandKI(); +extern void commandKK(); +extern void commandKN(); +extern void commandKP(); +extern void commandKQ(); +extern void commandKR(); +extern void commandKW(); + +/* defined by cmdl.c */ +extern void commandLC(); +extern void commandLD(); +extern void commandLE(); +extern void commandLHD(); +extern void commandLHG(); +extern void commandLHM(); +extern void commandLHS(); +extern void commandLHW(); +extern void commandLL(); +extern void commandLP(); +extern void commandLT(); +extern void commandLXG(); +extern void commandLXO(); +extern void commandLXC(); +extern void commandLXL(); +extern void commandLXS(); +extern void commandLXP(); +extern void commandLXR(); +extern void commandLXW(); + + +/* defined by cmdm.c */ +extern void commandMA(); +extern void commandMC(); +extern void commandMD(); +extern void commandME(); +extern void commandMF(); +extern void commandMG(); +extern void commandMH(); +extern void commandMI(); +extern void commandMJ(); +extern void commandML(); +extern void commandMM(); +extern void commandMN(); +extern void commandMP(); +extern void commandMS(); +extern void commandMT(); +extern void commandMV(); +extern void commandMZ0(); + +/* defined by cmdn.c */ +extern void commandN_ADD(); +extern void commandN_SUB(); +extern void commandN_MUL(); +extern void commandN_DIV(); +extern void commandN_GT(); +extern void commandN_LT(); +extern void commandN_EQ(); +extern void commandN_NE(); +extern void commandN_AND(); +extern void commandN_OR(); +extern void commandN_XOR(); +extern void commandN_NOT(); +extern void commandNB(); +extern void commandNC(); +extern void commandNI(); +extern void commandNP(); +extern void commandNR(); +extern void commandNO(); +extern void commandNT(); +extern void commandND_ADD(); +extern void commandND_SUB(); +extern void commandND_MUL(); +extern void commandND_DIV(); +extern void commandNDC(); +extern void commandNDD(); +extern void commandNDM(); +extern void commandNDA(); +extern void commandNDH(); + +/* defined by cmdo.c */ +extern void commandO(); + +/* defined by cmdp.c */ +extern void commandPC(); +extern void commandPD(); +extern void commandPF(); +extern void commandPG(); +extern void commandPN(); +extern void commandPP(); +extern void commandPS(); +extern void commandPT0(); +extern void commandPT1(); +extern void commandPT2(); +extern void commandPW(); + +/* defined by cmdq.c */ +extern void commandQC(); +extern void commandQD(); +extern void commandQE(); +extern void commandQP(); + +/* defined by cmds.c */ +extern void commandSC(); +extern void commandSG(); +extern void commandSL(); +extern void commandSM(); +extern void commandSO(); +extern void commandSP(); +extern void commandSQ(); +extern void commandSR(); +extern void commandSS(); +extern void commandST(); +extern void commandSU(); +extern void commandSW(); +extern void commandSX(); +extern void commandSI(); + +/* defined by cmdt.c */ +extern void commandT(); + +/* defined by cmdu.c */ +extern void commandUC(); +extern void commandUD(); +extern void commandUR(); +extern void commandUS(); +extern void commandUG(); +extern void commandUP0(); +extern void commandUP1(); +extern void commandUP3(); + +/* defined by cmdv.c */ +extern void commandVC(); +extern void commandVP(); +extern void commandVS(); +extern void commandVG(); +extern void commandVH(); +extern void commandVF(); +extern void commandVV(); +extern void commandVR(); +extern void commandVW(); +extern void commandVE(); +extern void commandVZ(); +extern void commandVX(); +extern void commandVT(); +extern void commandVB(); +extern void commandVIC(); +extern void commandVIP(); +extern void commandVA(); +extern void commandVJ(); + +/* defined by cmdw.c */ +extern void commandWW(); +extern void commandWV(); +extern void commandWZ(); +extern void commandWX(); + +/* defined by cmdy.c */ +extern void commandY(); + +/* defined by cmdz.c */ +extern void commandZC(); +extern void commandZM(); +extern void commandZS(); +extern void commandZB(); +extern void commandZH(); +extern void commandZW(); +extern void commandZL(); +extern void commandZE(); +extern void commandZF(); +extern void commandZD(); +extern void commandZT0(); +extern void commandZT1(); +extern void commandZT2(); +extern void commandZT3(); +extern void commandZT4(); +extern void commandZT5(); +extern void commandZT10(); +extern void commandZT11(); +extern void commandZT20(); +extern void commandZT21(); +extern void commandZZ0(); +extern void commandZZ1(); +extern void commandZZ2(); +extern void commandZZ3(); +extern void commandZZ4(); +extern void commandZZ5(); +extern void commandZZ7(); +extern void commandZZ8(); +extern void commandZZ9(); +extern void commandZZ10(); +extern void commandZZ13(); +extern void commandZZ14(); +extern void commandZG(); +extern void commandZI(); +extern void commandZA(); +extern void commandZK(); +extern void commandZR(); + +/* define in cmd2F.c */ +extern void commands2F00(); +extern void commands2F01(); +extern void commands2F02(); +extern void commands2F03(); +extern void commands2F04(); +extern void commands2F05(); +extern void commands2F08(); +extern void commands2F09(); +extern void commands2F0A(); +extern void commands2F0B(); +extern void commands2F0C(); +extern void commands2F0D(); +extern void commands2F0E(); +extern void commands2F0F(); +extern void commands2F10(); +extern void commands2F11(); +extern void commands2F12(); +extern void commands2F13(); +extern void commands2F14(); +extern void commands2F15(); +extern void commands2F16(); +extern void commands2F17(); +extern void commands2F18(); +extern void commands2F19(); +extern void commands2F1A(); +extern void commands2F1B(); +extern void commands2F1C(); +extern void commands2F1D(); +extern void commands2F1E(); +extern void commands2F1F(); +extern void commands2F20(); +extern void commands2F21(); +extern void commands2F23(); +extern void commands2F24(); +extern void commands2F25(); +extern void commands2F26(); +extern void commands2F27(); +extern void commands2F28(); +extern void commands2F29(); +extern void commands2F2A(); +extern void commands2F2B(); +extern void commands2F2D(); +extern void commands2F2E(); +extern void commands2F2F(); +extern void commands2F30(); +extern void commands2F31(); +extern void commands2F32(); +extern void commands2F33(); +extern void commands2F34(); +extern void commands2F35(); +extern void commands2F36(); +extern void commands2F37(); +extern void commands2F38(); +extern void commands2F39(); +extern void commands2F3A(); +extern void commands2F3B(); +extern void commands2F3C(); +extern void commands2F3D(); +extern void commands2F3E(); +extern void commands2F3F(); +extern void commands2F40(); +extern void commands2F41(); +extern void commands2F42(); +extern void commands2F43(); +extern void commands2F44(); +extern void commands2F45(); +extern void commands2F46(); +extern void commands2F47(); +extern void commands2F48(); +extern void commands2F49(); +extern void commands2F4A(); +extern void commands2F4B(); +extern void commands2F4C(); +extern void commands2F4D(); +extern void commands2F4E(); +extern void commands2F4F(); +extern void commands2F50(); +extern void commands2F51(); +extern void commands2F52(); +extern void commands2F53(); +extern void commands2F54(); +extern void commands2F55(); +extern void commands2F56(); +extern void commands2F57(); +extern void commands2F58(); +extern void commands2F59(); +extern void commands2F5A(); +extern void commands2F5B(); +extern void commands2F5C(); +extern void commands2F5D(); +extern void commands2F5E(); +extern void commands2F5F(); +extern void commands2F61(); +extern void commands2F62(); +extern void commands2F63(); +extern void commands2F64(); +extern void commands2F65(); +extern void commands2F66(); +extern void commands2F67(); +extern void commands2F68(); +extern void commands2F69(); +extern void commands2F6A(); +extern void commands2F6B(); +extern void commands2F6C(); +extern void commands2F6D(); +extern void commands2F6E(); +extern void commands2F6F(); +extern void commands2F70(); +extern void commands2F71(); +extern void commands2F72(); +extern void commands2F73(); +extern void commands2F74(); +extern void commands2F75(); +extern void commands2F76(); +extern void commands2F77(); +extern void commands2F78(); +extern void commands2F79(); +extern void commands2F7A(); +extern void commands2F7B(); +extern void commands2F7C(); +extern void commands2F7D(); +extern void commands2F7E(); +extern void commands2F7F(); +extern void commands2F80(); +extern void commands2F81(); +extern void commands2F82(); +extern void commands2F83(); +extern void commands2F84(); +extern void commands2F85(); +extern void commands2F86(); +extern void commands2F87(); +extern void commands2F88(); +extern void commands2F89(); +extern void commands2F8A(); +extern void commands2F8B(); +extern void commands2F8C(); + +/* define in cmd2F60.c */ +extern void commands2F60(); + +#endif /* !__CMD_CHECK__ */ diff --git a/src/cmdb.c b/src/cmdb.c new file mode 100644 index 0000000..6d143e4 --- /dev/null +++ b/src/cmdb.c @@ -0,0 +1,272 @@ +/* + * cmdb.c SYSTEM35 B command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdb.c,v 1.20 2002/05/07 21:43:53 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "windowframe.h" +#include "selection.h" +#include "message.h" +#include "selection.h" + +/* 選択肢Window情報 */ +Bcom_WindowInfo selWinInfo[SELWINMAX] = {{ 464, 80, 160, 160, TRUE}, 0}; +/* 現在の選択肢Window番号 */ +static int selWinNo; +/* MessageWindow情報 */ +Bcom_WindowInfo msgWinInfo[MSGWINMAX] = {{ 8, 311, 616, 80, TRUE}, 0}; +/* 現在のMessageWindow番号 */ +static int msgWinNo; + +void commandB0() { + /* メッセージウィンドウをクリアする。*/ + int num = getCaliValue(); + + switch(num) { + case 0: + msg_nextPage(TRUE); break; + case 1: + msg_nextPage(FALSE); break; + default: + break; + } + + DEBUG_COMMAND("B0 %d:\n", num); +} + +void commandB1() { + int num = getCaliValue() - 1; + int X1 = getCaliValue(); + int Y1 = getCaliValue(); + int X2 = getCaliValue(); + int Y2 = getCaliValue(); + int V = getCaliValue(); + + if (num < 0 || num >= SELWINMAX) { + WARNING("commandB1(): Window number is out of range %d", num); + return; + } + selWinInfo[num].x = X1; + selWinInfo[num].y = Y1; + selWinInfo[num].width = X2; + selWinInfo[num].height = Y2; + selWinInfo[num].save = (V == 0) ? false : true; + + DEBUG_COMMAND("B1 %d,%d,%d,%d,%d,%d:\n", num + 1, X1, Y1, X2, Y2, V); +} + +void commandB2() { + int num = getCaliValue() - 1 ; + int W = getCaliValue(); + int C1 = getCaliValue(); + int C2 = getCaliValue(); + int C3 = getCaliValue(); + int dot = getCaliValue(); + + if (num < 0 || num >= SELWINMAX) { + WARNING("commandB2(): Window number is out of range %d", num); + return; + } + nact->sel.win = &selWinInfo[num]; + + nact->sel.WindowFrameType = W; + nact->sel.FrameCgNoTop = C1; + nact->sel.FrameCgNoMid = C2; + nact->sel.FrameCgNoBot = C3; + nact->sel.Framedot = W == 0 ? 0 : W == 1 ? 8 : dot ; + + selWinNo = num + 1; + + DEBUG_COMMAND("B2 %d,%d,%d,%d,%d,%d:\n", num + 1, W, C1, C2, C3, dot); +} + +void commandB3() { + int num = getCaliValue() - 1; + int X1 = getCaliValue(); + int Y1 = getCaliValue(); + int X2 = getCaliValue(); + int Y2 = getCaliValue(); + int V = getCaliValue(); + + if (num < 0 || num >= MSGWINMAX) { + WARNING("commandB3(): Window number is out of range %d", num); + return; + } + msgWinInfo[num].x = X1; + msgWinInfo[num].y = Y1; + msgWinInfo[num].width = X2; + msgWinInfo[num].height = Y2; + msgWinInfo[num].save = (V == 0) ? FALSE : TRUE; + + DEBUG_COMMAND("B3 %d,%d,%d,%d,%d,%d:\n", num + 1, X1, Y1, X2, Y2, V); +} + +void commandB4() { + int num = getCaliValue() - 1; + int W = getCaliValue(); + int C1 = getCaliValue(); + int C2 = getCaliValue(); + int N = getCaliValue(); + int M = getCaliValue(); + + if (num < 0 || num >= MSGWINMAX) { + WARNING("commandB4(): Window number is out of range %d", num); + num = 0; + } + + msgWinNo = num + 1; + nact->msg.win = &msgWinInfo[num]; + msg_openWindow(W, C1, C2, N, M); + + DEBUG_COMMAND("B4 %d,%d,%d,%d,%d,%d:\n", num + 1, W, C1, C2, N, M); +} + +void commandB10() { + MyPoint p; + int *x_var = getCaliVariable(); + int *y_var = getCaliVariable(); + + msg_getMessageLocation(&p); + *x_var = p.x; + *y_var = p.y; + DEBUG_COMMAND("B10 %d,%d:\n", *x_var, *y_var); +} + +void commandB11() { + int *sel_no_var = getCaliVariable(); + int *msg_no_var = getCaliVariable(); + + *sel_no_var = selWinNo; + *msg_no_var = msgWinNo; + + DEBUG_COMMAND("B11 %d,%d:\n", *sel_no_var, *msg_no_var); +} + +void commandB12() { + int *var = getCaliVariable(); + + *var = sel_getRegistoredElementNumber(); + DEBUG_COMMAND("B12 %d:\n", *var); +} + +void commandB13() { + int *var = getCaliVariable(); + + *var = sel_getRegistoredElementWidth(); + DEBUG_COMMAND("B13 %d:\n", *var); +} + +void commandB14() { + int *var = getCaliVariable(); + + *var = sel_getRegistoredElement_strlen(); + DEBUG_COMMAND("B14 %d:\n", *var); +} + +void commandB21() { + int no = getCaliValue(); + int *x_var = getCaliVariable(); + int *y_var = getCaliVariable(); + + *x_var = selWinInfo[selWinNo - 1].x; + *y_var = selWinInfo[selWinNo - 1].y; + + DEBUG_COMMAND("B21 %d,%d,%d:\n", no, *x_var, *y_var); +} + +void commandB22() { + int no = getCaliValue(); + int *x_var = getCaliVariable(); + int *y_var = getCaliVariable(); + + *x_var = selWinInfo[selWinNo - 1].width; + *y_var = selWinInfo[selWinNo - 1].height; + + DEBUG_COMMAND("B22 %d,%d,%d:\n", no, *x_var, *y_var); +} + +void commandB23() { + int no = getCaliValue(); + int *x_var = getCaliVariable(); + int *y_var = getCaliVariable(); + + *x_var = msgWinInfo[msgWinNo - 1].x; + *y_var = msgWinInfo[msgWinNo - 1].y; + + DEBUG_COMMAND("B23 %d,%d,%d:\n", no, *x_var, *y_var); +} + +void commandB24() { + int no = getCaliValue(); + int *x_var_size = getCaliVariable(); + int *y_var_size = getCaliVariable(); + + *x_var_size = msgWinInfo[msgWinNo - 1].width; + *y_var_size = msgWinInfo[msgWinNo - 1].height; + + DEBUG_COMMAND("B24 %d,%d,%d:\n", no, *x_var_size, *y_var_size); +} + +void commandB31() { + /* 設定されてある選択肢ウィンドウの左上座標を取得する */ + int no = getCaliValue(); + int *x_var = getCaliVariable(); + int *y_var = getCaliVariable(); + + *x_var = selWinInfo[no - 1].x; + *y_var = selWinInfo[no - 1].y; + + DEBUG_COMMAND("B31 %d,%d,%d:\n", no, *x_var, *y_var); +} + +void commandB32() { + int no = getCaliValue(); + int *x_var_size = getCaliVariable(); + int *y_var_size = getCaliVariable(); + + *x_var_size = selWinInfo[no - 1].width; + *y_var_size = selWinInfo[no - 1].height; + + DEBUG_COMMAND("B32 %d,%d,%d:\n", no, *x_var_size, *y_var_size); +} + +void commandB33() { + int no = getCaliValue(); + int *x_var = getCaliVariable(); + int *y_var = getCaliVariable(); + + *x_var = msgWinInfo[no - 1].x; + *y_var = msgWinInfo[no - 1].y; + DEBUG_COMMAND("B33 %d,%d,%d:\n", no, *x_var, *y_var); +} + +void commandB34() { + int no = getCaliValue(); + int *x_var_size = getCaliVariable(); + int *y_var_size = getCaliVariable(); + + *x_var_size = msgWinInfo[no - 1].width; + *y_var_size = msgWinInfo[no - 1].height; + DEBUG_COMMAND("B34 %d,%d,%d:\n", no, *x_var_size, *y_var_size); +} + diff --git a/src/cmdc.c b/src/cmdc.c new file mode 100644 index 0000000..ae4077a --- /dev/null +++ b/src/cmdc.c @@ -0,0 +1,325 @@ +/* + * cmdc.c SYSTEM35 C command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdc.c,v 1.31 2006/04/21 16:40:48 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" + +void commandCC() { + int src_x = getCaliValue(); + int src_y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int dst_x = getCaliValue(); + int dst_y = getCaliValue(); + + ags_copyArea(src_x, src_y, width, height, dst_x, dst_y); + ags_updateArea(dst_x, dst_y, width, height); + + DEBUG_COMMAND("CC %d,%d,%d,%d,%d,%d:\n", src_x, src_y, width, height, dst_x, dst_y); +} + +void commandCS() { + int src_x = getCaliValue(); + int src_y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int dst_x = getCaliValue(); + int dst_y = getCaliValue(); + int sprite = getCaliValue(); + + ags_copyAreaSP(src_x, src_y, width, height, dst_x, dst_y, sprite); + ags_updateArea(dst_x, dst_y, width, height); + + DEBUG_COMMAND("CS %d,%d,%d,%d,%d,%d,%d:\n", src_x, src_y, width, height, dst_x, dst_y, sprite); +} + +void commandCX() { + int mode = getCaliValue(); + int src_x = getCaliValue(); + int src_y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int dst_x = getCaliValue(); + int dst_y = getCaliValue(); + int col = getCaliValue(); + + switch(mode) { + case 0: + ags_copyArea_shadow(src_x, src_y, width, height, dst_x, dst_y); + ags_updateArea(dst_x, dst_y, width, height); + break; + case 1: + ags_copyArea_transparent(src_x, src_y, width, height, dst_x, dst_y, col); + ags_updateArea(dst_x, dst_y, width, height); + break; + case 2: + ags_copyFromAlpha(src_x, src_y, width, height, dst_x, dst_y, col == 1 ? TO_16L : TO_16H); + ags_updateArea(dst_x, dst_y, width, height); + break; + case 3: + ags_copyToAlpha(src_x, src_y, width, height, dst_x, dst_y, col == 1 ? FROM_16L : FROM_16H); + break; + case 4: + ags_copyFromAlpha(src_x, src_y, width, height, dst_x, dst_y, col == 1 ? TO_24R : col == 2 ? TO_24G : TO_24B); + ags_updateArea(dst_x, dst_y, width, height); + break; + case 5: + ags_copyToAlpha(src_x, src_y, width, height, dst_x, dst_y, col == 1 ? FROM_24R : col == 2 ? FROM_24G : FROM_24B); + break; + case 6: + DEBUG_COMMAND_YET("CX %d,%d,%d,%d,%d,%d,%d,%d:\n", mode, src_x, src_y, width, height, dst_x, dst_y, col); + break; + } + + DEBUG_COMMAND("CX %d,%d,%d,%d,%d,%d,%d,%d:\n", mode, src_x, src_y, width, height, dst_x, dst_y, col); +} + +void commandCM() { + int src_x = getCaliValue(); + int src_y = getCaliValue(); + int src_width = getCaliValue(); + int src_height = getCaliValue(); + int dst_x = getCaliValue(); + int dst_y = getCaliValue(); + int dst_width = getCaliValue(); + int dst_height = getCaliValue(); + int mirror_sw = getCaliValue(); + + ags_scaledCopyArea(src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height, mirror_sw); + ags_updateArea(dst_x, dst_y, dst_width, dst_height); + + DEBUG_COMMAND("CM %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", src_x, src_y, src_width, src_height, dst_x, dst_y, dst_width, dst_height, mirror_sw); +} + +void commandCE() { + int src_x = getCaliValue(); + int src_y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int dst_x = getCaliValue(); + int dst_y = getCaliValue(); + int effect_sw = getCaliValue(); + int option = getCaliValue(); + int wait_flag = getCaliValue(); + + ags_eCopyArea(src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, -1); + + if (wait_flag == 1) { + sysVar[0] = nact->waitcancel_key; + } + + switch(effect_sw) { + case 53: + case 54: + case 1000: + case 1001: + DEBUG_COMMAND_YET("CE %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag); + break; + default: + DEBUG_COMMAND("CE %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag); + } +} + +void commandCD() { + int src_x = getCaliValue(); + int src_y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int dst_x = getCaliValue(); + int dst_y = getCaliValue(); + int effect_sw = getCaliValue(); + int option = getCaliValue(); + int wait_flag = getCaliValue(); + int color = getCaliValue(); + + ags_eCopyArea(src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, color); + + if (wait_flag == 1) { + sysVar[0] = nact->waitcancel_key; + } + + switch(effect_sw) { + case 6: + case 7: + case 8: + case 9: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 1000: + case 2000: + case 2001: + DEBUG_COMMAND_YET("CD %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, color); + break; + default: + DEBUG_COMMAND("CD %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", src_x, src_y, width, height, dst_x, dst_y, effect_sw, option, wait_flag, color); + } +} + +void commandCK() { + int no = sys_getc(); + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int d1 = getCaliValue(); + int d2 = getCaliValue(); + int d3 = getCaliValue(); + int d4 = getCaliValue(); + + switch(no) { + case 1: + ags_wrapColor(x, y, width, height, d1, d2); break; + case 2: + DEBUG_COMMAND_YET("CK %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", no, x, y, width, height, d1, d2, d3, d4); break; + case 3: /* from T2 */ + ags_changeColorArea(x, y, width, height, d1, d2, d3); break; + default: + WARNING("Unknown CK Command %d\n", no); + } + ags_updateArea(x, y, width, height); + DEBUG_COMMAND("CK %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", no, x, y, width, height, d1, d2, d3, d4); +} + +void commandCL() { + int x0 = getCaliValue(); + int y0 = getCaliValue(); + int x1 = getCaliValue(); + int y1 = getCaliValue(); + int color = getCaliValue(); + + ags_drawLine(x0, y0, x1, y1, color); + ags_updateArea(min(x0, x1), min(y0, y1), abs(x1 - x0) + 1, abs(y1 - y0) + 1); + + DEBUG_COMMAND("CL %d,%d,%d,%d,%d:\n", x0, y0, x1, y1, color); +} + +void commandCB() { + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int color = getCaliValue(); + + ags_drawRectangle(x, y, width, height, color); + ags_updateArea (x, y, width, height); + + DEBUG_COMMAND("CB %d,%d,%d,%d,%d:\n", x, y, width, height, color); +} + +void commandCF() { + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int color = getCaliValue(); + + ags_fillRectangle(x, y, width, height, color); + ags_updateArea (x, y, width, height); + + DEBUG_COMMAND("CF %d,%d,%d,%d,%d:\n", x, y, width, height, color); +} + +void commandCP() { + int x = getCaliValue(); + int y = getCaliValue(); + int color = getCaliValue(); + + MyRectangle* rec = ags_imageFlood(x, y, color); + + if (rec != NULL) { + ags_updateArea(rec->x, rec->y, rec->width, rec->height); + } + + DEBUG_COMMAND("CP %d,%d,%d:\n", x, y, color); +} + +void commandCT() { + /* (24bitのみ) 影データを取得する。*/ + int *var = getCaliVariable(); + int x = getCaliValue(); + int y = getCaliValue(); + + ags_alpha_getPixel(x, y, var); + DEBUG_COMMAND("CT %d,%d,%d:\n", *var, x, y); +} + +void commandCU() { + /* (24bitのみ) 指定矩形領域内の影データのborder以下のデータをsetに変更する。*/ + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int border = getCaliValue(); + int set = getCaliValue(); + + ags_alpha_lowercut(x, y, width, height, border, set); + DEBUG_COMMAND("CU %d,%d,%d,%d,%d,%d:\n", x, y, width, height, border, set); +} + +void commandCV() { + /* (24bitのみ) 指定矩形領域内の影データのborder以上のデータをsetに変更する。*/ + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int border = getCaliValue(); + int set = getCaliValue(); + + ags_alpha_uppercut(x, y, width, height, border, set); + DEBUG_COMMAND("CV %d,%d,%d,%d,%d,%d:\n", x, y, width, height, border, set); +} + +void commandCY() { + /* (24bitのみ) 指定矩形領域内の影データを lv に設定する */ + int x = getCaliValue(); + int y = getCaliValue(); + int w = getCaliValue(); + int h = getCaliValue(); + int lv = getCaliValue(); + + ags_alpha_setLevel(x, y, w, h, lv); + DEBUG_COMMAND("CY %d,%d,%d,%d,%d:\n", x, y, w, h, lv); +} + +void commandCZ() { + /* (24bitのみ) 指定矩形領域内の影データを (dx,dy)に転送する */ + int sx = getCaliValue(); + int sy = getCaliValue(); + int w = getCaliValue(); + int h = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int op = getCaliValue(); + + ags_alpha_copyArea(sx, sy, w, h, dx, dy); + DEBUG_COMMAND("CZ %d,%d,%d,%d,%d,%d,%d:\n", sx, sy, w, h, dx, dy, op); +} diff --git a/src/cmdd.c b/src/cmdd.c new file mode 100644 index 0000000..7647700 --- /dev/null +++ b/src/cmdd.c @@ -0,0 +1,87 @@ +/* + * cmdd.c SYSTEM35 D command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * +*/ +/* $Id: cmdd.c,v 1.9 2002/04/29 05:48:21 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" + +void commandDC() { + int page = getCaliValue(); + int size = getCaliValue(); + int save = getCaliValue(); + boolean bool; + + bool = v_allocateArrayBuffer(page , size, save == 0 ? false : true); + if(!bool) { + WARNING("commandDC(): Array allocate failed\n"); + } + DEBUG_COMMAND("DC %d,%d,%d:\n", page, size, save); +} + +void commandDI() { + int page = getCaliValue(); + int *var_size = getCaliVariable(); + int *var_save = getCaliVariable(); + + *var_size = v_releaseArrayVar(page); + *var_save = v_getArrayBufferCnt(page) == true ? 1 : 0; + + DEBUG_COMMAND("DI %d,%p,%p:\n", page, var_size, var_save); +} + +void commandDS() { + int *point_var = getCaliVariable(); + int *data_var = getCaliVariable(); + int varno = preVarNo; + int offset = getCaliValue(); + int page = getCaliValue(); + boolean bool; + + DEBUG_COMMAND("DS %p,%p,%d,%d:\n",point_var, data_var, offset, page); + bool = v_defineArrayVar(varno, point_var, offset, page); + if (!bool) { + WARNING("commandDS(): Array allocate failed\n"); + WARNING("if you are playing 'Pastel Chime', please patch to scenario(see patch/README.TXT for detail)\n"); + } +} + + +void commandDR() { + int *data_var = getCaliVariable(); + v_releaseArrayVar(preVarNo); + + DEBUG_COMMAND("DR %p:\n", data_var); +} + +void commandDF() { + int *data_var = getCaliVariable(); + int cnt = getCaliValue(); + int data = getCaliValue(); + + DEBUG_COMMAND("DF %p,%d,%d:\n", data_var, cnt, data); + + while (cnt--) { + *data_var = data; data_var++; + } +} diff --git a/src/cmde.c b/src/cmde.c new file mode 100644 index 0000000..121fb84 --- /dev/null +++ b/src/cmde.c @@ -0,0 +1,123 @@ +/* + * cmde.c SYSTEM35 E command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmde.c,v 1.11 2003/01/17 23:23:11 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" +#include "graphics.h" + +typedef struct { + MyRectangle r; + int pal; +} Ecomtbl; + +static Ecomtbl tbl[100]; + +void commandES() { + int num = getCaliValue(); + int pal = getCaliValue(); + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + + tbl[num - 1].r.x = x; + tbl[num - 1].r.y = y; + tbl[num - 1].r.width = width; + tbl[num - 1].r.height = height; + tbl[num - 1].pal = pal; + + DEBUG_COMMAND("ES %d,%d,%d,%d,%d,%d:\n", num, pal, x, y, width, height); +} + +void commandEC() { + int num = getCaliValue(); + Ecomtbl *e; + MyRectangle *r; + + if (num == 0) { + r = &nact->sys_view_area; + ags_fillRectangle(r->x, r->y, r->width, r->height, 0); + ags_updateArea(r->x, r->y, r->width, r->height); + } else { + int adj = (nact->patch_ec == 0) ? -1 : 0; + e = &tbl[num - 1]; + ags_fillRectangle(e->r.x, e->r.y, e->r.width + adj, e->r.height + adj, e->pal); + ags_updateArea(e->r.x, e->r.y, e->r.width + adj, e->r.height + adj); + } + DEBUG_COMMAND("EC %d:\n", num); +} + +void commandEG() { + int num = getCaliValue(); + int *x = getCaliVariable(); + int *y = getCaliVariable(); + int *width = getCaliVariable(); + int *height = getCaliVariable(); + + *x = tbl[num -1].r.x; + *y = tbl[num -1].r.y; + *width = tbl[num -1].r.width; + *height = tbl[num -1].r.height; + + DEBUG_COMMAND("EG %d,%d,%d,%d,%d:\n", num, *x, *y, *width, *height); +} + +void commandEM() { + int num = getCaliValue(); + int *var = getCaliVariable(); + int x = getCaliValue(); + int y = getCaliValue(); + MyRectangle r = tbl[num - 1].r; + + if (nact->patch_emen == 0) { + r.width -= 1; + r.height -= 1; + } + *var = ags_regionContains(&r, x, y) ? 1 : 0; + DEBUG_COMMAND("EM %d,%d,%d,%d:\n", num, *var, x, y); +} + +void commandEN() { + int *var = getCaliVariable(); + int min = getCaliValue(); + int max = getCaliValue(); + int x = getCaliValue(); + int y = getCaliValue(); + int i; + MyRectangle r; + + *var = 0; + + for (i = min; i <= max; i++) { + r = tbl[i - 1].r; + if (nact->patch_emen == 0) { + r.width -= 1; + r.height -= 1; + } + if (ags_regionContains(&r, x, y)) *var = i; + } + + DEBUG_COMMAND("EN %d,%d,%d,%d,%d:\n", *var, min, max, x, y); +} diff --git a/src/cmdf.c b/src/cmdf.c new file mode 100644 index 0000000..15d27ae --- /dev/null +++ b/src/cmdf.c @@ -0,0 +1,198 @@ +/* + * cmdf.c SYSTEM35 F command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * +*/ +/* $Id: cmdf.c,v 1.15 2006/04/21 16:39:02 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "xsystem35.h" +#include "scenario.h" +#include "nact.h" +#include "LittleEndian.h" + +static void commandF1(); +static void commandF2(); +static void commandF3(); +static void commandF4(); +static void commandF5(); +static void commandF6(); +static void commandF7(); +static void commandF8(); +static void commandF9(); +static void commandF10(); +static void commandF11(); + +/* F6/7 用変数 */ +static int *F6Index[256]; + +void commandF() { + switch (sys_getc()) { + case 1: + commandF1(); break; + case 2: + commandF2(); break; + case 3: + commandF3(); break; + case 4: + commandF4(); break; + case 5: + commandF5(); break; + case 6: + commandF6(); break; + case 7: + commandF7(); break; + case 8: + commandF8(); break; + case 9: + commandF9(); break; + case 10: + commandF10(); break; + case 11: + commandF11(); break; + default: + break; + } +} + +static void commandF1() { + int str_number = sys_getCaliValue(); + int skip = sys_getCaliValue(); + int i; + char *p; + + DEBUG_COMMAND("F1 %d,%d:\n", str_number, skip); + + p = (char *)nact->datatbl_addr; + for (i = 0; i < skip; i++) { + p += (strlen(p) + 1); + } + + v_strcpy(str_number - 1 , p); + p += (strlen(p) + 1); + nact->datatbl_addr = (void *)p; +} + +static void commandF2() { + int *read_var = sys_getCaliVariable(); + int skip = sys_getCaliValue(); + WORD *p = (WORD *)nact->datatbl_addr; + + p += skip; + + *read_var = LittleEndian_getW((BYTE *)p, 0); + + p++; + nact->datatbl_addr = (void *)p; + + DEBUG_COMMAND("F2 %d,%d:\n", *read_var, skip); +} + +static void commandF3() { + int *read_var = sys_getCaliVariable(); + int skip = sys_getCaliValue(); + + *read_var = LittleEndian_getW(nact->datatbl_addr, skip *2); + + DEBUG_COMMAND("F3 %d,%d:\n", *read_var, skip); +} + +static void commandF4() { + int *read_var = sys_getCaliVariable(); + int count = sys_getCaliValue(); + int i; + WORD *p = (WORD *)nact->datatbl_addr; + + for (i = 0; i < count; i++) { + *read_var = LittleEndian_getW((BYTE *)p, 0); + p++; + read_var++; + } + + nact->datatbl_addr = p; + + DEBUG_COMMAND("F4 %d,%d:\n", *read_var, count); +} + +static void commandF5() { + int *read_var = sys_getCaliVariable(); + int count = sys_getCaliValue(); + int i; + + for (i = 0; i < count; i++) { + *read_var = LittleEndian_getW(nact->datatbl_addr, i * 2); + read_var++; + } + + DEBUG_COMMAND("F5 %d,%d:\n", *read_var, count); +} + +static void commandF6() { + int *var = sys_getCaliVariable(); + int index = sys_getCaliValue(); + + F6Index[index] = var; + + DEBUG_COMMAND("F6 %d,%d:\n", *var, index); +} + +static void commandF7() { + int data_width = sys_getCaliValue(); + int count = sys_getCaliValue(); + int i, j; + WORD *p = (WORD *)nact->datatbl_addr; + + for (i = 0; i < count; i++) { + for (j = 0; j < data_width; j++) { + *(F6Index[j] + i) = LittleEndian_getW((BYTE *)p, 0); + p++; + } + } + + nact->datatbl_addr = p; + + DEBUG_COMMAND("F7 %d,%d\n", data_width, count); +} + +static void commandF8() { + int snum = sys_getCaliValue(); + int scnt = sys_getCaliValue(); + DEBUG_COMMAND_YET("F8 %d,%d:\n", snum, scnt); +} + +static void commandF9() { + int snum = sys_getCaliValue(); + int scnt = sys_getCaliValue(); + DEBUG_COMMAND_YET("F9 %d,%d:\n", snum, scnt); +} + +static void commandF10() { + int snum = sys_getCaliValue(); + int scnt = sys_getCaliValue(); + DEBUG_COMMAND_YET("F10 %d,%d:\n", snum, scnt); +} + +static void commandF11() { + int snum = sys_getCaliValue(); + int ends = sys_getCaliValue(); + DEBUG_COMMAND_YET("F11 %d,%d:\n", snum, ends); +} diff --git a/src/cmdg.c b/src/cmdg.c new file mode 100644 index 0000000..ad9814f --- /dev/null +++ b/src/cmdg.c @@ -0,0 +1,89 @@ +/* + * cmdg.c SYSTEM35 G command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdg.c,v 1.33 2001/09/16 15:59:11 chikama Exp $ */ + +#include "portab.h" +#include "xsystem35.h" +#include "cg.h" + +void commandG0() { + int num = getCaliValue(); + + if (num == 0) { + WARNING("G0 num: num = 0!!\n"); + cg_clear_display_loc(); + return; + } + + cg_load(num - 1, -1); + + DEBUG_COMMAND("G %d:\n",num); +} + +void commandG1() { + int num = getCaliValue(); + int sprite = getCaliValue(); + + if (num == 0) { + WARNING("G1 num: num = 0!!\n"); + cg_clear_display_loc(); + return; + } + + cg_load(num - 1, sprite); + + DEBUG_COMMAND("G %d,%d:\n",num,sprite); +} + +void commandGS() { + /* num 番にリンクされているCGの座標とサイズを取得する */ + MyRectangle r; + int num = getCaliValue(); + int *var = getCaliVariable(); + + if (num == 0) { + WARNING("GS num: num = 0!!\n"); + return; + } + + cg_get_info(num - 1, &r); + var[0] = r.x; + var[1] = r.y; + var[2] = r.width; + var[3] = r.height; + + DEBUG_COMMAND("GS %d,%p:\n",num,var); +} + +void commandGX() { + int cg_num = getCaliValue(); + int shadow_num = getCaliValue(); + + if (shadow_num == 0) { + WARNING("GX shadow_now = 0!!\n"); + return; + } + + cg_load_with_alpha(cg_num -1, shadow_num -1); + + DEBUG_COMMAND("GX %d,%d:\n",cg_num, shadow_num); +} diff --git a/src/cmdh.c b/src/cmdh.c new file mode 100644 index 0000000..432f6b0 --- /dev/null +++ b/src/cmdh.c @@ -0,0 +1,75 @@ +/* + * cmdh.c SYSTEM35 H command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdh.c,v 1.5 2000/09/10 10:39:48 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "xsystem35.h" + +/* defined by hankana2sjis.c */ +extern char *num2sjis(int num); + +void commandH() { + int fig = sys_getc(); + int num = getCaliValue(); + char _work1[10], _work2[512]; + char *work1 = _work1, *work2 = _work2; + int len; + + *work2 = 0; + sprintf(work1, "%d", num); + if (fig != 0) { + len = strlen(work1); + if (fig > len) { + /* 空白でうめる */ + len = fig - len; + while(len--) { + strcat(work2, num2sjis(10)); + } + } else { + work1 += (len - fig); + } + } + while(*work1) { + strcat(work2, num2sjis((*work1) - '0')); work1++; + } + + sys_addMsg(work2); + DEBUG_COMMAND("H %d,%d:\n",fig,num); +} + +void commandHH(void) { + int fig = sys_getc(); + int num = getCaliValue(); + char s[256]; + if( fig ) { + char *ss="%%%dd"; + char sss[256]; + sprintf(sss,ss,fig); + sprintf(s,sss,num); + } else { + sprintf(s,"%d",num); + } + sys_addMsg(s); + DEBUG_COMMAND("HH %d,%d:\n",fig,num); +} diff --git a/src/cmdi.c b/src/cmdi.c new file mode 100644 index 0000000..d99a5e9 --- /dev/null +++ b/src/cmdi.c @@ -0,0 +1,177 @@ +/* + * cmdi.c SYSTEM35 I command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdi.c,v 1.30 2001/03/30 19:16:37 chikama Exp $ */ + +#include +#include +#include "config.h" +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" +#include "graphicsdevice.h" +#include "imput.h" + +#define REPEAT_RATE_FAST 60 +#define REPEAT_RATE_SLOW 600 + +static int repeating = 0; +static int ik_key = 0; + +void commandIK() { + /* キー入力関連のコマンド */ + int num = sys_getc(); + int key; + + DEBUG_COMMAND("IK %d:\n",num); + + /* to be fix + * IK0/1 is affected by ZI + * need cleanup + */ + switch(num) { + case 0: + sysVar[0] = 0; + key = sys_getInputInfo(); + if (ik_key != key) repeating = 0; + if (get_skipMode()) break; + key = sys_keywait(INT_MAX, TRUE); + + if (repeating == 1) { + sys_keywait(REPEAT_RATE_SLOW, FALSE); + } + repeating++; + sys_key_releasewait(key, TRUE); + sysVar[0] = ik_key = key; + break; + case 1: + sysVar[0] = 0; + key = sys_getInputInfo(); + if (ik_key != key) repeating = 0; + if (get_skipMode()) break; + key = sys_keywait(INT_MAX, TRUE); + + if (repeating == 1) { + sys_keywait(REPEAT_RATE_FAST, FALSE); + } + repeating++; + sys_key_releasewait(key, TRUE); + sysVar[0] = ik_key = key; + break; + case 2: + sysVar[0] = sys_getMouseInfo(NULL, TRUE); + break; + case 3: + sysVar[0] = sys_getKeyInfo(); + break; + case 4: + sysVar[0] = sys_getJoyInfo(); + break; + case 5: + sysVar[0] = 0; + break; + case 6: + sysVar[0] = sys_getInputInfo(); + break; + default: + WARNING("commandIK(): Unknown Command %d\n", num); + } +} + +void commandIM() { + /* マウスカーソルの座標取得 */ + int *x_var = getCaliVariable(); + int *y_var = getCaliVariable(); + MyPoint p; + + sysVar[0] = sys_getMouseInfo(&p, FALSE); + *x_var = p.x; + *y_var = p.y; + DEBUG_COMMAND("IM %d,%d:\n", *x_var, *y_var); +} + +void commandIC() { + /* マウスカーソルの形状変更 */ + static int pre = 1; + int cursor_num = getCaliValue(); + int *oldcursor = getCaliVariable(); + *oldcursor = pre; + pre = cursor_num; + + ags_setCursorType(cursor_num); + DEBUG_COMMAND("IC %d,%p:\n", cursor_num, oldcursor); +} + +void commandIZ() { + /* マウスカーソルの座標を変更する (マウスカーソルはスムーズに移動する) */ + int x = getCaliValue(); + int y = getCaliValue(); + + ags_setCursorLocation(x, y, TRUE); + DEBUG_COMMAND("IZ %d,%d:\n", x, y); +} + +void commandIX() { + /* 「次の選択肢まで進む」の状態取得 */ + int *var = getCaliVariable(); + + *var = get_skipMode() == TRUE ? 1 : 0; + DEBUG_COMMAND("IX %p:\n",var); +} + +void commandIY() { + int p1 = getCaliValue(); + + if (p1 == 0) { + set_skipMode(FALSE); + } else if (p1 == 1) { + set_skipMode(TRUE); + } else if (p1 == 2) { + set_skipMode2(TRUE); + } else if (p1 == 3) { + set_skipMode2(FALSE); + } + + DEBUG_COMMAND("IY %d:\n",p1); +} + +void commandIG() { /* T2 */ + int *var = getCaliVariable(); + int code = getCaliValue(); + int cnt = getCaliValue(); + int rsv = getCaliValue(); + int i; + + for (i = 0; i < cnt; i++) { + *var = RawKeyInfo[code + i] ? 1 : 0; + var++; + } + + DEBUG_COMMAND("IG %p,%d,%d,%d\n", var, code, cnt, rsv); +} + +void commandIE() { + int p1 = getCaliValue(); + int p2 = getCaliValue(); + + ags_loadCursor(p1, p2); + DEBUG_COMMAND("IE %d,%d\n", p1, p2); +} diff --git a/src/cmdj.c b/src/cmdj.c new file mode 100644 index 0000000..67b51d7 --- /dev/null +++ b/src/cmdj.c @@ -0,0 +1,64 @@ +/* + * cmdj.c SYSTEM35 J command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdj.c,v 1.7 2000/09/20 10:33:15 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "cg.h" + +void commandJ0() { + int x = getCaliValue(); + int y = getCaliValue(); + + cg_set_display_location(x, y, OFFSET_ABSOLUTE_GC); + DEBUG_COMMAND("J0 %d,%d:\n", x, y); +} + +void commandJ1() { + int x = getCaliValue(); + int y = getCaliValue(); + + cg_set_display_location(x, y, OFFSET_RELATIVE_GC); + DEBUG_COMMAND("J1 %d,%d:\n", x, y); +} + +void commandJ2() { + int x = getCaliValue(); + int y = getCaliValue(); + + cg_set_display_location(x, y, OFFSET_ABSOLUTE_JC); + DEBUG_COMMAND("J2:%d,%d\n", x, y); +} + +void commandJ3() { + int x = getCaliValue(); + int y = getCaliValue(); + + cg_set_display_location(x, y, OFFSET_RELATIVE_JC); + DEBUG_COMMAND("J3:%d,%d\n", x, y); +} + +void commandJ4() { + cg_set_display_location(0, 0, OFFSET_NOMOVE); + DEBUG_COMMAND("J4 :\n"); +} diff --git a/src/cmdk.c b/src/cmdk.c new file mode 100644 index 0000000..f6b7b3c --- /dev/null +++ b/src/cmdk.c @@ -0,0 +1,100 @@ +/* + * cmdk.c SYSTEM36 K command + * + * Copyright (C) 1999- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: cmdk.c,v 1.3 2000/09/10 10:39:48 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "network.h" + +void commandKI() { + /* ネットワークのチャンネルを新規作成する/ネットワークのチャンネルに接続する */ + int *var = getCaliVariable(); + int port_num = getCaliValue(); + int user_max = getCaliValue(); + + *var = network_create_channel(port_num, user_max); + + DEBUG_COMMAND_YET("KI %d,%d,%d:\n", *var, port_num, user_max); + return; +} + +void commandKK() { + /* user_num番のユーザーを切断する */ + int use_num = getCaliValue(); + + network_close(use_num); + + DEBUG_COMMAND_YET("KK %d:\n", use_num); + return; +} + +void commandKN() { + /* 自分自身の接続番号を取得する */ + int *var = getCaliVariable(); + + *var = network_get_channel(); + + DEBUG_COMMAND_YET("KN %d:\n", *var); + return; +} + +void commandKP() { + /* データ受信バッファにデータがあるか調べる */ + int *var = getCaliVariable(); + + *var = network_check_buffer(); + + DEBUG_COMMAND_YET("KP %d:\n", *var); + return; +} + +void commandKQ() { + /* ユーザーが接続されているかどうか確認する */ + int *var = getCaliVariable(); + int user_num = getCaliValue(); + + *var = network_get_user_state(user_num); + + DEBUG_COMMAND_YET("KQ %d,%d:\n", *var, user_num); + return; +} + +void commandKR() { + /* データ受信バッファからデータを取得する */ + int *var = getCaliVariable(); + + network_read_buffer(var); + + DEBUG_COMMAND_YET("KR %d:\n", *var); + return; +} + +void commandKW() { + /* データを送信する */ + int *var = getCaliVariable(); + int num = getCaliValue(); + + network_write_buffer(var, num); + + DEBUG_COMMAND_YET("KR %d,%d:\n", *var, num); + return; +} diff --git a/src/cmdl.c b/src/cmdl.c new file mode 100644 index 0000000..c992f26 --- /dev/null +++ b/src/cmdl.c @@ -0,0 +1,318 @@ +/* + * cmdl.c SYSTEM35 L command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdl.c,v 1.27 2003/01/17 23:23:11 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "xsystem35.h" +#include "dri.h" +#include "savedata.h" +#include "cg.h" + +void commandLD() { + /* 変数領域などのデータをロードする。(全ロード)*/ + int num = getCaliValue(); + + if (num <= 0) { + sysVar[0] = 255; + } else { + sysVar[0] = save_loadAll(num - 1); + } + DEBUG_COMMAND("LD %d:\n",num); +} + +void commandLP() { + /* セーブデータの一部分をロードする。(数値変数部) */ + int num = getCaliValue(); + int *point = getCaliVariable(); + int page = preVarPage; + int index = preVarIndex; + int cnt = getCaliValue(); + + if (num <= 0) { + sysVar[0] = 255; + } else { + sysVar[0] = save_loadPartial(num - 1, page, index, cnt); + } + DEBUG_COMMAND("LP %d,%p,%d:\n",num, point, cnt); +} + +void commandLT() { + /* タイムスタンプの読み込み */ + int num = getCaliValue(); + int *var = getCaliVariable(); + int status; + struct stat buf; + struct tm *lc; + + if (num <= 0) { + *var = 0; + *(var + 1) = 0; + *(var + 2) = 0; + *(var + 3) = 0; + *(var + 4) = 0; + *(var + 5) = 0; + sysVar[0] = 255; + return; + } + + status = stat(save_get_file(num - 1), &buf); + if (status) { + /* んなんどこにもかいてないやん! */ + *var = 0; + *(var + 1) = 0; + *(var + 2) = 0; + *(var + 3) = 0; + *(var + 4) = 0; + *(var + 5) = 0; + sysVar[0] = 255; + } else { + lc = localtime(&buf.st_mtime); + *var = 1900 + lc->tm_year; + *(var + 1) = 1 + lc->tm_mon; + *(var + 2) = lc->tm_mday; + *(var + 3) = lc->tm_hour; + *(var + 4) = lc->tm_min; + *(var + 5) = lc->tm_sec; + sysVar[0] = 0; + } + DEBUG_COMMAND("LT %d,%p\n",num, var); +} + +void commandLE() { + int type = sys_getc(); + char *filename = sys_getString(':'); + int *var, _var = 0; + int num; + + switch(type) { + case 0: /* T2 */ + var = getCaliVariable(); + num = getCaliValue(); + sysVar[0] = save_load_var_with_file(filename, var, num); + break; + case 1: /* 456 */ + _var = getCaliValue(); + num = getCaliValue(); + sysVar[0] = save_load_str_with_file(filename, _var, num); + break; + default: + WARNING("Unknown LE command %d\n", type); return; + } + + DEBUG_COMMAND("LE %d,%s,%d,%d:\n",type, filename, _var, num); +} + +void commandLL() { + int type = sys_getc(); + int link_no = getCaliValue(); + int *var, _var = 0; + int num, i; + dridata *dfile = ald_getdata(DRIFILE_DATA, link_no - 1); + WORD *data; + + if (dfile == NULL) { + getCaliValue(); + getCaliValue(); + sysVar[0] = 255; + return; + } + + data = (WORD *)dfile->data; + + switch(type) { + case 0: /* T2 */ + var = getCaliVariable(); + num = getCaliValue(); + + DEBUG_COMMAND("LL %d,%d,%d,%d:\n",type, link_no, _var, num); + + if (dfile->size < num * sizeof(WORD)) { + WARNING("data shortage (req = %d, result = %d)\n", num, dfile->size/ sizeof(WORD)); + /* sysVar[0] = 254; 大嘘*/ + /* return; */ + num = dfile->size / sizeof(WORD); + } + for (i = 0; i < num; i++) { +#ifdef WORDS_BIGENDIAN + *var = swap16(*data); var++; data++; +#else + *var = *data; var++; data++; +#endif + } + break; + + case 1: + _var = getCaliValue(); + num = getCaliValue(); + DEBUG_COMMAND_YET("LL1 not yet %d, %d\n", _var, num); + sysVar[0] = 255; + goto out; + break; + + default: + WARNING("Unknown LL command %d\n", type); + goto out; + } + + sysVar[0] = 0; + + out: + ald_freedata(dfile); +} + +void commandLHD() { + // CDのデータをHDDへ登録/削除する + int p1 = sys_getc(); + int no = getCaliValue(); + // X版では全てをHDDに置くのでサポートしない + + sysVar[0] = 255; + DEBUG_COMMAND("LHD %d,%d:\n",p1,no); +} + +void commandLHG() { + // CDのデータをHDDへ登録/削除する + int p1 = sys_getc(); + int no = getCaliValue(); + /* X版では全てをHDDに置くのでサポートしない */ + + sysVar[0] = 255; + DEBUG_COMMAND("LHG %d,%d:\n",p1,no); +} + +void commandLHM() { + // CDのデータをHDDへ登録/削除する + int p1 = sys_getc(); + int no = getCaliValue(); + // X版では全てをHDDに置くのでサポートしない + + sysVar[0] = 255; + DEBUG_COMMAND("LHM %d,%d:\n",p1,no); +} + +void commandLHS() { + // CDのデータをHDDへ登録/削除する + int p1 = sys_getc(); + int no = getCaliValue(); + // X版では全てをHDDに置くのでサポートしない + + sysVar[0] = 255; + DEBUG_COMMAND("LHS %d,%d:\n",p1,no); +} + +void commandLHW() { + // CDのデータをHDDへ登録/削除する + int p1 = sys_getc(); + int no = getCaliValue(); + // X版では全てをHDDに置くのでサポートしない + + sysVar[0] = 255; + DEBUG_COMMAND("LHW %d,%d:\n",p1,no); +} + +void commandLC() { + int x = getCaliValue(); + int y = getCaliValue(); + char *filename = sys_getString(':'); + + sysVar[0] = cg_load_with_filename(filename, x, y); + + DEBUG_COMMAND("LC %d,%d,%s:\n", x, y, filename); +} + +void commandLXG() { + /* ファイルを選択する */ + int file_name = getCaliValue(); + char *title = sys_getString(':'); + char *filter = sys_getString(':'); + + DEBUG_COMMAND_YET("LXG %d,%s,%s:\n", file_name, title, filter); +} + +void commandLXO() { + /* ファイルを作成またはオープンする */ + int num = getCaliValue(); + int file_name = getCaliValue(); + int how_to_create = getCaliValue(); + + sysVar[0]=255; + DEBUG_COMMAND_YET("LXO %d,%d,%d:\n",num,file_name,how_to_create); +} + +void commandLXC() { + /* ファイルをクローズする */ + int num = getCaliValue(); + + DEBUG_COMMAND_YET("LXC %d:\n",num); +} + +void commandLXL() { + /* CGファイルロード */ + int x = getCaliValue(); + int y = getCaliValue(); + int file_name = getCaliValue(); + + DEBUG_COMMAND_YET("LXL %d,%d,%d:\n",x,y,file_name); +} + +void commandLXS() { + /* ファイルサイズ(バイト数)を取得する */ + int num = getCaliValue(); + int *hi = getCaliVariable(); + int *lo = getCaliVariable(); + + DEBUG_COMMAND_YET("LXS %d,%d,%d:\n", num, *hi, *lo); +} + +void commandLXP() { + /* ファイルポインタの位置を(先頭からのバイト数)設定する */ + int num = getCaliValue(); + int hi = getCaliValue(); + int lo = getCaliValue(); + + DEBUG_COMMAND_YET("LXP %d,%d,%d:\n",num,hi,lo); +} + +void commandLXR() { + /* ファイルからデータを読み取る */ + int num = getCaliValue(); + int *var = getCaliVariable(); + int size = getCaliValue(); + + DEBUG_COMMAND_YET("LXR %d,%d,%d:\n",num,*var,size); +} + +void commandLXW() { + /* ファイルにデータを書き込む */ + int num = getCaliValue(); + int *var = getCaliVariable(); + int size = getCaliValue(); + + DEBUG_COMMAND_YET("LXW %d,%d,%d:\n",num,*var,size); +} diff --git a/src/cmdm.c b/src/cmdm.c new file mode 100644 index 0000000..9d2bbf5 --- /dev/null +++ b/src/cmdm.c @@ -0,0 +1,387 @@ +/* + * cmdm.c SYSTEM35 M command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdm.c,v 1.27 2002/12/21 12:28:35 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "xsystem35.h" +#include "eucsjis.h" +#include "menu.h" +#include "ags.h" +#include "message.h" + +/* defined by cmds.c */ +extern boolean dummy_pcm_su_flag; +/* defined by hankan2sjis.c */ +extern char *num2sjis(int num); +/* defined by cmds.c */ +extern boolean Y3waitCancel; + + +/* MI 用パラメータ */ +INPUTSTRING_PARAM mi_param; + +void commandMS() { + /* Xコマンドで表示される文字列領域に文字列を入れる */ + int num = getCaliValue(); + char *str = sys_getString(':'); + + if (num > 0) { /* thanx tajiri@wizard */ + v_strcpy(num - 1, str); + } else { + WARNING("MS: num(%d) <= 0\n", num); + } + DEBUG_COMMAND("MS %d,%s:\n",num,str); +} + +void commandMP() { + /* 指定の文字列を指定文字数だけ表示する(Xコマンドの桁数指定) */ + int num1 = getCaliValue(); + int num2 = getCaliValue(); + u_char bstr[3] = { 0x81,0x40,0x00 }; // white blank + int len = min(num2 * 2, v_strlen(num1 - 1)); + int blen = num2 * 2 - len; + char *str = malloc(num2 * 2 + 1); + + if (NULL == str) { + NOMEMERR(); + } + + memset(str, 0, num2 * 2 + 1); + strncpy(str, v_str(num1 - 1), len); + while(blen) { + strcat(str, bstr); + blen -= 2; + } + sys_addMsg(str); + DEBUG_COMMAND("MP %d,%d:\n",num1,num2); + + free(str); +} + +void commandMI() { /* T2 */ + /* ユーザーによる文字列の入力 */ + int dst_no = getCaliValue(); + int max_len = getCaliValue(); + char *title = sys_getString(':'); + char *t1, *t2, *t3; + + t1 = sjis2lang(title); + t2 = sjis2lang(v_str(dst_no -1)); + + mi_param.title = t1; + mi_param.oldstring = t2; + mi_param.max = max_len; + + menu_inputstring(&mi_param); + if (mi_param.newstring == NULL) { + v_strcpy(dst_no -1, NULL); + free(t1); free(t2); + return; + } + + t3 = lang2sjis(mi_param.newstring); + + /* 全角文字以外は不可 */ + if (!sjis_has_hankaku(t3)) { + v_strcpy(dst_no -1, t3); + } + free(t1); + free(t2); + free(t3); + DEBUG_COMMAND("MI %d,%d,%s:\n",dst_no,max_len, title); +} + +void commandMA() { + /* num1 の文字列の後ろに num2 をつなげる */ + int num1 = getCaliValue(); + int num2 = getCaliValue(); + + v_strcat(num1 - 1, v_str(num2 - 1)); + + DEBUG_COMMAND("MA %d,%d:\n",num1,num2); +} + +void commandMC() { + /* num1 , num2 を比較して結果を RND に返す (RND=0 不一致 , RND=1 一致) */ + int num1 = getCaliValue(); + int num2 = getCaliValue(); + + sysVar[0] = strcmp(v_str(num1 - 1), v_str(num2 - 1)) == 0 ? 1 : 0; + + DEBUG_COMMAND("MC %d,%d:\n",num1,num2); +} + +void commandMT() { + /* ウインドウのタイトル文字列を設定する */ + char *str = sys_getString(':'); + + strncpy(nact->game_title_name, str, sizeof(nact->game_title_name) -1); + ags_setWindowTitle(str); + + /* 闘神都市II 対策 */ + if (0 == strcmp(str, GT_TOSHIN2)) { + dummy_pcm_su_flag = TRUE; + } + + /* Rance4 対策? */ + if (0 == strcmp(str, GT_RANCE4)) { + Y3waitCancel = FALSE; + } + + DEBUG_COMMAND("MT %s:\n",str); +} + +void commandMM() { + /* num1 の文字列に num2 をコピーする */ + int num1 = getCaliValue(); + int num2 = getCaliValue(); + + v_strcpy(num1 - 1, v_str(num2 - 1)); + + DEBUG_COMMAND("MM %d,%d:\n",num1, num2); +} + +void commandMH() { + /* 数値を文字列に変換する (参考 Hコマンド) */ + int num1 = getCaliValue(); + int fig = getCaliValue(); + int num2 = getCaliValue(); + char _work1[10],_work2[200]; + char *work1 = _work1, *work2 = _work2; + int len; + + *work2 = 0; + sprintf(work1,"%d",num2); + if (fig != 0) { + len = strlen(work1); + if (fig > len) { + /* 空白でうめる */ + len = fig - len; + while(len--) { + strcat(work2, num2sjis(10)); + } + } else { + work1 += (len - fig); + } + } + while(*work1) { + strcat(work2, num2sjis((*work1) - '0')); work1++; + } + v_strcpy(num1 - 1, work2); + + DEBUG_COMMAND("MH %d,%d,%d:\n",num1,fig,num2); +} + +void commandMV() { + /* シナリオバージョンをシステムへ通知する */ + int version = getCaliValue(); + + nact->scenario_version = version; + DEBUG_COMMAND("MV %d:\n",version); +} + +void commandML() { + /* 文字列の長さを取得する */ + int *var = getCaliVariable(); + int str_no = getCaliValue(); + + *var = sjis_count_char(v_str(str_no -1)); + + DEBUG_COMMAND("ML %p,%d:\n",var, str_no); +} + +void commandMD() { + /* 文字列変数を指定長さ分コピーする */ + int dst_str_no = getCaliValue(); + int src_str_no = getCaliValue(); + int len = getCaliValue(); + + strncpy(v_str(dst_str_no - 1), v_str(src_str_no - 1), len * 2); + *(v_str(dst_str_no - 1) + len*2) = '\0'; + + DEBUG_COMMAND("MD %d,%d,%d:\n",dst_str_no, src_str_no, len); +} + +void commandME() { + /* 位置指定つきの文字列コピー */ + int dst_str_no = getCaliValue(); + int dst_pos = getCaliValue(); + int src_str_no = getCaliValue(); + int src_pos = getCaliValue(); + int len = getCaliValue(); + + strncpy(v_str(dst_str_no - 1) + dst_pos * 2, v_str(src_str_no - 1) + src_pos * 2, len*2); + *(v_str(dst_str_no - 1) + dst_pos * 2 + len*2) = '\0'; + + DEBUG_COMMAND("ME %d,%d,%d,%d,%d:\n",dst_str_no, dst_pos, src_str_no, src_pos, len); +} + +void commandMF() { + /* 文字列中から指定文字列の位置を探す */ + int *var = getCaliVariable(); + int dst_no = getCaliValue(); + int key_no = getCaliValue(); + int start_pos = getCaliValue(); + char *start = v_str(dst_no - 1) + start_pos * 2; + + char *pos = strstr(start, v_str(key_no - 1)); + + if (pos == NULL) { + sysVar[0] = 255; + } else { + *var = (pos - start) / 2; + sysVar[0] = 0; + } + + DEBUG_COMMAND("MF %p,%d,%d,%d:\n",var, dst_no, key_no, start_pos); +} + +void commandMZ0() { + /* 文字列変数の文字数・個数の設定の変更 */ + int max_len = getCaliValue(); + int max_num = getCaliValue(); + int rsv = getCaliValue(); + + DEBUG_COMMAND("MZ0 %d,%d,%d:\n",max_len, max_num, rsv); + + /* いつからか、文字列変数の最大長さは∞になったようだ */ + if (max_len == 0) max_len = STRVAR_LEN * 2; + + v_initStringVars(max_num,max_len * 2 + 1); +} + +void commandMG() { + int no = sys_getc(); + int sw = 0, *var; + + switch(no) { + case 0: + sw = getCaliValue(); + nact->msg.mg_getString = sw == 1 ? TRUE : FALSE; + break; + case 1: + sw = getCaliValue(); + nact->msg.mg_startStrVarNo = sw; + break; + case 2: + sw = getCaliValue(); + nact->msg.mg_policyR = sw; + break; + case 3: + sw = getCaliValue(); + nact->msg.mg_policyA = sw; + break; + case 4: + sw = getCaliValue(); + nact->msg.mg_curStrVarNo = nact->msg.mg_startStrVarNo + sw; + v_strcpy(nact->msg.mg_curStrVarNo -1, ""); + break; + case 5: + var = getCaliVariable(); + *var = nact->msg.mg_curStrVarNo; + break; + case 6: + sw = getCaliValue(); + msg_mg6_command(sw); + break; + case 7: + var = getCaliVariable(); + *var = v_strlen(nact->msg.mg_curStrVarNo -1) / 2; + break; + case 100: + sw = getCaliValue(); + nact->msg.mg_dspMsg = sw == 1 ? TRUE : FALSE; + break; + default: + sw = getCaliValue(); + WARNING("Unknown MG command %d,%d\n", no, sw); + break; + } + + DEBUG_COMMAND("MG %d,%d:\n",no, sw); +} + +void commandMJ() { + /* 文字列入力 (ウィンド無し) */ + int num = getCaliValue(); + int x = getCaliValue(); + int y = getCaliValue(); + int h = getCaliValue(); + int max_len = getCaliValue(); + INPUTSTRING_PARAM mj_param; + char *t1, *t2; + + t1 = sjis2lang(v_str(num -1)); + mj_param.max = max_len; + mj_param.x = x; + mj_param.y = y; + mj_param.h = h; + mj_param.oldstring = t1; + + ags_setCursorLocation(x, y, FALSE); /* XXX */ + menu_inputstring2(&mj_param); + if (mj_param.newstring == NULL) return; + + t2 = lang2sjis(mj_param.newstring); + if (!sjis_has_hankaku(t2)) { + v_strcpy(num -1, t2); + } + free(t1); + free(t2); + DEBUG_COMMAND("MJ %d,%d,%d,%d,%d:\n", num, x, y, h, max_len); +} + +void commandMN() { + int no = sys_getc(); + int num = getCaliValue(); + int *var = getCaliVariable(); + int i, len; + char *b; + + switch(no) { + case 0: + /* 文字列を配列に変換する */ + len = v_strlen(num -1); + b = v_str(num -1); + for (i = 0; i < len; i++) { + *var = *b; + var++; b++; + } + *var = 0; + break; + case 1: + /* 配列を文字列に変換する */ + b = v_str(num -1); + while(*var) { + *b = *var; b++; var++; + } + *b = '\0'; + break; + default: + WARNING("UnKnown MN command(%d)\n", no); + } + DEBUG_COMMAND("MN %d,%d,%d:\n",no, num, *var); +} diff --git a/src/cmdn.c b/src/cmdn.c new file mode 100644 index 0000000..0caaf56 --- /dev/null +++ b/src/cmdn.c @@ -0,0 +1,406 @@ +/* + * cmdn.c SYSTEM35 N command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdn.c,v 1.18 2001/04/02 21:00:44 chikama Exp $ */ + +#include +#include +#include +#include "portab.h" +#include "eucsjis.h" +#include "xsystem35.h" +#include "menu.h" + +/* NI/NT 用パラメータ */ +INPUTNUM_PARAM ni_param; + +void commandNB() { + /* var1 から始まるcount個の変数へ + var2 から始まるcount個の変数をコピーする */ + int *var1 = getCaliVariable(); + int *var2 = getCaliVariable(); + int cnt = getCaliValue(); + + if (var1 == NULL) { + WARNING("NB dst variable(var1) is NULL\n"); + return; + } + + if (var2 == NULL) { + WARNING("NB src variable(var2) is NULL\n"); + return; + } + + DEBUG_COMMAND("NB %d,%d,%d:\n", *var1, *var2, cnt); + while(cnt--) { + *var1 = *var2; var1++; var2++; + } +} + +void commandNC() { + /* var1から始まるcount個の変数を0でクリアする */ + int *var1 = getCaliVariable(); + int cnt = getCaliValue(); + + DEBUG_COMMAND("NC %d,%d:\n", *var1, cnt); + + while(cnt--) { + *var1++ = 0; + } +} + +void commandNR() { + /* var1にvar2のルートを求める (間違い)*/ + /* NR 100,D01: ; < D01にルート100(10)が返る */ + int var1 = getCaliValue(); + int *var2 = getCaliVariable(); + + *var2 = (int)sqrt(var1); + DEBUG_COMMAND("NR %d,%d:\n", var1, *var2); +} + +void commandN_ADD() { + /* var1から始まるcount個の変数にnumを足す */ + int *var1 = getCaliVariable(); + int num = getCaliValue(); + int cnt = getCaliValue(); + + DEBUG_COMMAND("N+ %d,%d,%d:\n", *var1, num, cnt); + while(cnt--) { + *var1 = (int)((WORD)(*var1 + num)) ; var1++; + // *var1 += num; var1++; + } +} + +void commandN_SUB() { + /* var1から始まるcount個の変数からnumを引く */ + int *var1 = getCaliVariable(); + int num = getCaliValue(); + int cnt = getCaliValue(); + + DEBUG_COMMAND("N- %d,%d,%d:\n", *var1, num, cnt); + while(cnt--) { + *var1 = max(0, *var1 - num); var1++; + // *var1 -= num; var1++; + } +} + +void commandN_MUL() { + /* var1から始まるcount個の変数にnumを掛ける */ + int *var1 = getCaliVariable(); + int num = getCaliValue(); + int cnt = getCaliValue(); + + DEBUG_COMMAND("N* %d,%d,%d:\n", *var1, num, cnt); + while(cnt--) { + *var1 = (int)((WORD)(*var1 * num)); var1++; + // *var1 *= num; var1++; + } +} + +void commandN_DIV() { + /* var1から始まるcount個の変数をnumで割る */ + int *var1 = getCaliVariable(); + int num = getCaliValue(); + int cnt = getCaliValue(); + + DEBUG_COMMAND("N/ %d,%d,%d:\n", *var1, num, cnt); + while(cnt--) { + // *var1 = (unsigned short)(*var1)/num; var1++; + *var1 /= num; var1++; + } +} + +void commandN_GT() { + /* var1 から始まるcount個の変数からnumより大きいければ1を、以下ならば0を + var2から始まる変数列に返す + */ + int *var1 = getCaliVariable(); + int num = getCaliValue(); + int cnt = getCaliValue(); + int *var2 = getCaliVariable(); + + DEBUG_COMMAND("N> %d,%d,%d,%d:\n", *var1, num, cnt, *var2); + while (cnt--) { + *var2 = *var1 > num ? 1 : 0; var1++; var2++; + } +} + +void commandN_LT() { + /* var1から始まるcount個の変数からnumより小さければ1を、以上ならば0を + var2から始まる変数列に返す + */ + int *var1 = getCaliVariable(); + int num = getCaliValue(); + int cnt = getCaliValue(); + int *var2 = getCaliVariable(); + + DEBUG_COMMAND("N< %p,%d,%d,%p:\n", var1, num, cnt, var2); + while(cnt--) { + *var2 = *var1 < num ? 1 : 0; var1++; var2++; + } +} + +void commandN_EQ() { + /* var1から始まるcount個の変数からnumに等しければ1を、等しくなければ0を + var2から始まる変数列に返す + */ + int *var1 = getCaliVariable(); + int num = getCaliValue(); + int cnt = getCaliValue(); + int *var2 = getCaliVariable(); + + DEBUG_COMMAND("N= %p,%d,%d,%p:\n", var1, num, cnt, var2); + while(cnt--) { + *var2 = *var1 == num ? 1 : 0; var1++; var2++; + } +} + +void commandN_NE() { + /* var1から始まるcount個の変数の0,1を反転する */ + int *var1 = getCaliVariable(); + int cnt = getCaliValue(); + + DEBUG_COMMAND("N\\ %p,%d:\n", var1, cnt); + while(cnt--) { + *var1 ^= 1; var1++; + } +} + +void commandN_AND() { + /* var1,var2のcount個の変数のANDをとる */ + int *var1 = getCaliVariable(); + int cnt = getCaliValue(); + int *var2 = getCaliVariable(); + + DEBUG_COMMAND("N& %p,%d,%p:\n", var1, cnt, var2); + while(cnt--) { + *var2 &= *var1; var1++; var2++; + } +} + +void commandN_OR() { + /* var1,var2のcount個の変数のORをとる */ + int *var1 = getCaliVariable(); + int cnt = getCaliValue(); + int *var2 = getCaliVariable(); + + DEBUG_COMMAND("N| %p,%d,%p:\n", var1, cnt, var2); + while(cnt--) { + *var2 |= *var1; var1++; var2++; + } +} + +void commandN_XOR() { + /* var1,var2のcount個の変数のXORをとる */ + int *var1 = getCaliVariable(); + int cnt = getCaliValue(); + int *var2 = getCaliVariable(); + + DEBUG_COMMAND("N^ %p,%d,%p:\n", var1, cnt, var2); + while(cnt--) { + *var2 ^= *var1; var1++; var2++; + } +} + +void commandN_NOT() { + /* ビット反転する */ + int *var = getCaliVariable(); + int cnt = getCaliValue(); + + DEBUG_COMMAND("N~ %p,%d\n", var, cnt); + while(cnt--) { + *var ^= 0xffff; var++; + } +} + +void commandNO() { /* T2 */ + int p1 = sys_getc(); + int *dst_var = getCaliVariable(); + int *src_var = getCaliVariable(); + int cnt = getCaliValue(); + int i, tmp = 0; + + if (p1 == 0) { + /* 変数並びをビット列に圧縮する。 */ + for (i = 0; i < cnt; i++) { + tmp |= ((*src_var & 1) << (15 - (i%16))); src_var++; + if ((i%16) == 15 && i < (cnt-1)) { + *dst_var = tmp; dst_var++; tmp = 0; + } + } + *dst_var = tmp; + } else if (p1 == 1) { + /* ビット列を変数並びに展開する。*/ + for (i = 0; i < cnt; i++) { + if ((i%16) == 0) { + tmp = *src_var++; + } + *dst_var = (tmp & (1 << (15 - (i%16)))) ? 1 : 0; dst_var++; + } + } else { + WARNING("Unknown NO %d command\n", p1); + } + + DEBUG_COMMAND("NO %d,%p,%p,%d:\n", p1, src_var, dst_var, cnt); +} + +void commandNDC() { + /* w64nにnumをコピーする */ + int w64n = getCaliValue(); + int num = getCaliValue(); + longVar[w64n] = num; + + DEBUG_COMMAND("NDC %d,%d:\n", w64n, num); +} + +void commandNDD() { + /* varにw64nをコピーする*/ + int *var = getCaliVariable(); + int w64n = getCaliValue(); + *var = (int)longVar[w64n]; + + DEBUG_COMMAND("NDD %p,%d:\n", var, w64n); +} + +void commandNDM() { + // 数値w64nを文字列領域strへ文字列として反映 + int str = getCaliValue(); + int w64n = getCaliValue(); + + DEBUG_COMMAND_YET("NDM %d,%d:\n", str, w64n); +} + +void commandNDA() { + // 文字列領域strを数値としてw64nへ反映 + int str = getCaliValue(); + int w64n = getCaliValue(); + + DEBUG_COMMAND_YET("NDA %d,%d:\n", str, w64n); +} + +void commandNDH() { + // 数値w64nを画面に表示(パラメータの意味はHコマンドに準拠) + int str = getCaliValue(); + int w64n = getCaliValue(); + + DEBUG_COMMAND_YET("NDH %d,%d:\n", str, w64n); +} + +void commandND_ADD() { + /* w64n2とw64n3を足してw64n1に代入 */ + int w64n1 = getCaliValue(); + int w64n2 = getCaliValue(); + int w64n3 = getCaliValue(); + + longVar[w64n1] = longVar[w64n2] + longVar[w64n3]; + + DEBUG_COMMAND("ND+ %d,%d,%d:\n", w64n1, w64n2); +} + +void commandND_SUB() { + /* w64n2からw64n3を引いてw64n1に代入 */ + int w64n1 = getCaliValue(); + int w64n2 = getCaliValue(); + int w64n3 = getCaliValue(); + + longVar[w64n1] = longVar[w64n2] - longVar[w64n3]; + + DEBUG_COMMAND("ND- %d,%d,%d:\n", w64n1, w64n2, w64n3); +} + +void commandND_MUL() { + /* w64n2とw64n3を掛けてw64n1に代入 */ + int w64n1 = getCaliValue(); + int w64n2 = getCaliValue(); + int w64n3 = getCaliValue(); + + longVar[w64n1] = longVar[w64n2] * longVar[w64n3]; + + DEBUG_COMMAND("ND* %d,%d,%d:\n", w64n1, w64n2, w64n3); +} + +void commandND_DIV() { + // w64n2をw64n3で割ってw64n1に代入 + int w64n1 = getCaliValue(); + int w64n2 = getCaliValue(); + int w64n3 = getCaliValue(); + + longVar[w64n1] = longVar[w64n2] / longVar[w64n3]; + + DEBUG_COMMAND("ND/ %d,%d,%d:\n", w64n1, w64n2, w64n3); +} + +void commandNI() { /* From Panyo */ + /* 数値入力 */ + int *var = getCaliVariable(); + int def = getCaliValue(); + int _min = getCaliValue(); + int _max = getCaliValue(); + + ni_param.def = def; + ni_param.max = _max; + ni_param.min = _min; + + menu_inputnumber(&ni_param); + + if (ni_param.value < 0) { + sysVar[0] = 255; + } else { + *var = ni_param.value; + sysVar[0] = 0; + } + + DEBUG_COMMAND("NI %p,%d,%d,%d:\n", var, def, _min, _max); +} + +void commandNT() { /* From Panyo */ + /* NIコマンドで表示するタイトルを設定する。*/ + char *str = sys_getString(':'); + char *t; + + if (ni_param.title != NULL) { + free(ni_param.title); + } + t = sjis2lang(str); + ni_param.title = t; + + DEBUG_COMMAND("NT %p:\n", str); +} + +void commandNP() { + /* 配列比較 */ + int *var1 = getCaliVariable(); + int *var2 = getCaliVariable(); + int count = getCaliValue(); + int *result = getCaliVariable(); + + DEBUG_COMMAND("NP %d,%d,%d,%d:\n", *var1, *var2, count, *result); + + while(count--) { + if (*var1 != *var2) { + *result = 0; + return; + } + var1++; var2++; + } + *result = 1; +} diff --git a/src/cmdo.c b/src/cmdo.c new file mode 100644 index 0000000..16fb64e --- /dev/null +++ b/src/cmdo.c @@ -0,0 +1,26 @@ +/* + * cmdo.c SYSTEM35 O command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdo.c,v 1.3 2000/09/10 10:39:48 chikama Exp $ */ + +void commandO() { + return; +} diff --git a/src/cmdp.c b/src/cmdp.c new file mode 100644 index 0000000..8157221 --- /dev/null +++ b/src/cmdp.c @@ -0,0 +1,203 @@ +/* + * cmdp.c SYSTEM35 P command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdp.c,v 1.17 2001/07/30 22:58:40 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" + +/* absolete */ +void commandPN() { + /* num 番のCGを表示する時、カラーパレットを展開しないようにする。*/ + int num = getCaliValue(); + + DEBUG_COMMAND_YET("PN %d:\n",num); +} + +void commandPF() { + int p1 = sys_getc(); + int num = getCaliValue(); + boolean cancel_enabled; + + if (p1 == 2 || p1 == 3) { + cancel_enabled = getCaliValue() == 0 ? FALSE : TRUE; + } else { + cancel_enabled = FALSE; + } + switch(p1) { + case 0: + /* グラフィック画面をフェードインする(黒画面→通常画面)*/ + ags_fadeIn(num, cancel_enabled); break; + case 2: + ags_fadeIn(num, cancel_enabled); + sysVar[0] = nact->waitcancel_key; break; + case 1: + /* グラフィック画面をフェードアウトする(通常画面→黒画面)*/ + ags_fadeOut(num, cancel_enabled); break; + case 3: + ags_fadeOut(num, cancel_enabled); + sysVar[0] = nact->waitcancel_key; break; + } + + DEBUG_COMMAND("PF %d,%d,%d:\n", p1, num, cancel_enabled); +} + +void commandPW() { + int p1 = sys_getc(); + int num = getCaliValue(); + boolean cancel_enabled; + + if (p1 == 2 || p1 == 3) { + cancel_enabled = getCaliValue() == 0 ? FALSE : TRUE; + } else { + cancel_enabled = FALSE; + } + switch(p1) { + case 0: + /* グラフィック画面をホワイトフェードインする(白画面→通常画面) */ + ags_whiteIn(num, cancel_enabled); break; + case 2: + ags_whiteIn(num, cancel_enabled); + sysVar[0] = nact->waitcancel_key; break; + case 1: + /* グラフィック画面をホワイトフェードアウトする(通常画面→白画面) */ + ags_whiteOut(num, cancel_enabled); break; + case 3: + ags_whiteOut(num, cancel_enabled); + sysVar[0] = nact->waitcancel_key; break; + } + + DEBUG_COMMAND("PW %d,%d,%d:\n", p1, num, cancel_enabled); +} + +void commandPS() { + /* カラーパレットを設定する。 */ + int Plane, Red, Green, Blue; + Plane = getCaliValue(); + Red = getCaliValue(); + Green = getCaliValue(); + Blue = getCaliValue(); + + ags_setPallet(Plane , Red, Green, Blue); + ags_setPalletToSystem(Plane, 1); + DEBUG_COMMAND("PS %d,%d,%d,%d:\n", Plane, Red, Green, Blue); +} + +void commandPG() { /* T2 */ + /* パレットデータを変数列に取得する */ + int *var = getCaliVariable(); + int num1 = getCaliValue(); + int num2 = getCaliValue(); + int i; + + for (i = 0; i < num2; i++) { + *var = nact->sys_pal->red[num1 + i]; var++; + *var = nact->sys_pal->green[num1 + i]; var++; + *var = nact->sys_pal->blue[num1 + i]; var++; + } + DEBUG_COMMAND("PG %p,%d,%d:\n", var, num1, num2); +} + +void commandPP() { /* T2 */ + /* パレットデータを変数列から書き込み */ + int *var = getCaliVariable(); + int num1 = getCaliValue(); + int num2 = getCaliValue(); + int i; + + for (i = 0; i < num2; i++) { + ags_setPallet(num1 + i, *var, *(var +1), *(var +2)); var+=3; + } + ags_setPalletToSystem(num1, num2); + DEBUG_COMMAND("PP %p,%d,%d:\n", var, num1, num2); +} + +void commandPC() { + /* Gコマンドの制御(パレット取得、パレット展開、CG展開)を変更する。*/ + int num = getCaliValue(); + + cg_fflg = num; + + DEBUG_COMMAND("PC %d:\n",num); +} + +void commandPD() { + /* CG展開の明度を指定する */ + int num = getCaliValue(); + + cg_alphaLevel = num; + + DEBUG_COMMAND("PD %d:\n",num); +} + +void commandPT0() { + /* 指定座標に描かれているパレット番号を取得する */ + int *var = getCaliVariable(); + int x = getCaliValue(); + int y = getCaliValue(); + Pallet cell; + + ags_getPixel(x, y, &cell); + *var = cell.pixel; + + DEBUG_COMMAND("PT0 %p,%d,%d:\n", var, x, y); +} + +void commandPT1() { + /* 指定座標に描かれている色を取得する */ + int *r_var = getCaliVariable(); + int *g_var = getCaliVariable(); + int *b_var = getCaliVariable(); + int x = getCaliValue(); + int y = getCaliValue(); + Pallet cell; + + ags_getPixel(x, y, &cell); + *r_var = cell.r; + *g_var = cell.g; + *b_var = cell.b; + + DEBUG_COMMAND("PT1 %p,%p,%p,%d,%d:\n", r_var, g_var, b_var, x, y); +} + +void commandPT2() { + /* 指定座標に描かれている色を取得する */ + int *hi_var = getCaliVariable(); + int *low_var = getCaliVariable(); + int x = getCaliValue(); + int y = getCaliValue(); + Pallet cell; + int r, g, b, pic; + + ags_getPixel(x, y, &cell); + r = cell.r; + g = cell.r; + b = cell.r; + + pic = (r & 0xf8) | ((g & 0xfc) << 3) | (b >> 3); + + *hi_var = pic >> 8; + *low_var = pic & 0xff; + + DEBUG_COMMAND("PT2 %p,%p,%d,%d:\n", hi_var, low_var, x, y); +} diff --git a/src/cmdq.c b/src/cmdq.c new file mode 100644 index 0000000..5e290fb --- /dev/null +++ b/src/cmdq.c @@ -0,0 +1,106 @@ +/* + * cmdq.c SYSTEM35 Q command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * +*/ +/* $Id: cmdq.c,v 1.12 2003/01/25 01:34:50 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "savedata.h" + +#define WARN_SAVEERR(cmd, st) \ +if (st > 200) fprintf(stderr, "WARNING: Fail to save (cmd=%s, stat=%d)\n", cmd, st) + +void commandQD() { + /* 変数領域などのデータをセーブする。(全セーブ)*/ + int num = getCaliValue(); + + if (num <= 0) { + sysVar[0] = 255; + } else { + sysVar[0] = save_saveAll(num - 1); + } + + WARN_SAVEERR("QD", sysVar[0]); + + DEBUG_COMMAND("QD %d:\n",num); +} + +void commandQP() { + /* 変数領域などのデータを一部セーブする。(数値変数部) */ + int num = getCaliValue(); + int *point = getCaliVariable(); + int page = preVarPage; + int index = preVarIndex; + int cnt = getCaliValue(); + + if (num <= 0) { + sysVar[0] = 255; + } else { + sysVar[0] = save_savePartial(num - 1, page, index, cnt); + } + + WARN_SAVEERR("QP", sysVar[0]); + + DEBUG_COMMAND("QP %d,%p,%d:\n", num, point, cnt); +} + +void commandQC() { + /* セーブファイルをnum2の領域からnum1の領域へコピー */ + int num1 = getCaliValue(); + int num2 = getCaliValue(); + + if (num1 <= 0 || num2 <= 0) { + sysVar[0] = 255; + } else { + sysVar[0] = save_copyAll(num1 - 1, num2 - 1); + } + + WARN_SAVEERR("QC", sysVar[0]); + + DEBUG_COMMAND("QC %d,%d:\n",num1,num2); +} + +void commandQE() { + int type = sys_getc(); + char *filename = sys_getString(':'); + int *var, _var = 0, cnt; + + switch(type) { + case 0: + var = getCaliVariable(); + cnt = getCaliValue(); + sysVar[0] = save_save_var_with_file(filename, var, cnt); + break; + case 1: + _var = getCaliValue(); + cnt = getCaliValue(); + sysVar[0] = save_save_str_with_file(filename, _var, cnt); + break; + default: + WARNING("Unknown QE command %d\n", type); return; + } + + WARN_SAVEERR("QE", sysVar[0]); + + DEBUG_COMMAND("QE %d,%s,%d,%d:\n", type, filename, _var, cnt); +} diff --git a/src/cmds.c b/src/cmds.c new file mode 100644 index 0000000..d221c3d --- /dev/null +++ b/src/cmds.c @@ -0,0 +1,379 @@ +/* + * cmds.c SYSTEM35 S command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmds.c,v 1.33 2002/12/31 04:11:19 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "music_client.h" + +/* ぱにょ〜ん 異常シナリオ対策 */ +static boolean dummy_pcm_in_play = FALSE; +/* 闘神都市II 異常シナリオ対策 */ +boolean dummy_pcm_su_flag = FALSE; +/* 次の cdrom の loop 回数 */ +static int next_cdrom_loopcnt = 0; + +void commandSS() { + /* 音楽演奏を開始する(CDのみ)*/ + int num = getCaliValue(); + static int pre = 0; + + DEBUG_COMMAND("SS %d:\n",num); + + if (num == 0) { + mus_cdrom_stop(); + } else { + if (pre != num) { + mus_cdrom_stop(); + mus_cdrom_start(num + 1, next_cdrom_loopcnt); + } + } + + next_cdrom_loopcnt = 0; + pre = num; +} + +void commandSC() { + /* CDのプレイ中のタイムを取得する */ + int *var = getCaliVariable(); + cd_time info; + + mus_cdrom_get_playposition(&info); + if (info.t == 999) { + *var++ = 999; + } else { + *var++ = info.t - 1; + } + *var++ = info.m; + *var++ = info.s; + *var++ = info.f; + + DEBUG_COMMAND("SC %p:\n",var); +} + +void commandSD() { + /* 音楽演奏を開始する(デフォルトはCD−DA)*/ + int num1 = getCaliValue(); + int num2 = getCaliValue(); + + DEBUG_COMMAND_YET("SD %d,%d:\n",num1,num2); +} + +void commandSR() { + /* 音楽演奏情報を返す (CD,MIDI) + num = デバイスの指定 (0=CD , 1=MIDI) + var = 演奏曲番号 (0の時は演奏停止中) + var+1 = ループ回数 + var+2 = 演奏位置 + var+3 = フェードイン/アウト中 + */ + /* Hushaby から SR,c,P:に変更か? */ + int num, *var; + int c = sl_getcAt(sl_getIndex()); + if (c < 0x40) { + num = sl_getc(); + } else { + num = getCaliValue(); + } + var = getCaliVariable(); + + if (num == 0) { + cd_time info; + mus_cdrom_get_playposition(&info); + if (info.t == 999) { + *var = 0; + } else { + *var = info.t - 1; + } + } else { + midiplaystate st; + mus_midi_get_playposition(&st); + *var = st.play_no; + } + + DEBUG_COMMAND("SR %d,%p:\n",num, var); +} + +void commandSL() { + /* 次の音楽のループ回数を指定する */ + int num = getCaliValue(); + + next_cdrom_loopcnt = num; + + DEBUG_COMMAND("SL %d:\n",num); +} + +void commandSI() { + /* 指定した音源の接続状態を var に取得 */ + int type = sys_getc(); + int *var = getCaliVariable(); + + if (type == 0) { /* MIDI */ + *var = mus_midi_get_state() == TRUE ? 1 : 0; + } else if (type == 1) { /* PCM */ + *var = mus_pcm_get_state() == TRUE ? 1 : 0; + } else if (type == 2) { /* CD */ + *var = mus_cdrom_get_state() == TRUE ? 1 : 0; + } + + DEBUG_COMMAND("SI %d,%d:\n",type,*var); +} + +void commandSG() { + /* MIDI演奏 */ + static int loopcnt = 0; + int sw = sys_getc(); + int num, fnum, *var; + midiplaystate st; + + switch(sw) { + case 0: + /* 演奏中のMIDIを停止する */ + num = getCaliValue(); + mus_midi_stop(); + DEBUG_COMMAND("SG0 %d:\n", num); + break; + case 1: + /* MIDIを演奏する */ + num = getCaliValue(); + if (num == 0) { + mus_midi_stop(); + } else { + mus_midi_stop(); + mus_midi_start(num, loopcnt); + } + DEBUG_COMMAND("SG1 %d:\n", num); + break; + case 2: + /* MIDI演奏位置を1/100秒単位で取得する */ + var = getCaliVariable(); + mus_midi_get_playposition(&st); + *var = st.loc_ms / 10; + DEBUG_COMMAND("SG2 %p:\n", var); + break; + case 3: + num = getCaliValue(); + if (num == 0) { + /* 演奏中のMIDIを一時停止する */ + mus_midi_pause(); + } else { + /* 一時停止中のMIDIの一時停止を解除する */ + mus_midi_unpause(); + } + DEBUG_COMMAND("SG3 %d:\n", num); + break; + case 4: + num = getCaliValue(); + /* 次のSG1コマンドでのMIDI演奏の繰り返し回数指定 */ + loopcnt = num; + DEBUG_COMMAND("SG4 %d:\n", num); + break; + case 5: + fnum = getCaliValue() & 0x7f; + num = getCaliValue(); + mus_midi_set_flag(0, fnum, num); + + DEBUG_COMMAND("SG5 %d,%d:\n", fnum, num); + break; + case 6: + fnum = getCaliValue() & 0x7f; + num = getCaliValue(); + mus_midi_set_flag(1, fnum, num); + + DEBUG_COMMAND("SG6 %d,%d:\n", fnum, num); + break; + case 7: + fnum = getCaliValue() & 0x7f; + var = getCaliVariable(); + *var = mus_midi_get_flag(0, fnum); + + DEBUG_COMMAND("SG7 %d,%d:\n", fnum, *var); + break; + case 8: { + fnum = getCaliValue() & 0x7f; + var = getCaliVariable(); + *var = mus_midi_get_flag(1, fnum); + DEBUG_COMMAND("SG8 %d,%p:\n", fnum, var); + break; + } + default: + SYSERROR("Unknown SG command %d\n", sw); + break; + } +} + +void commandSP() { + /* PCMデータを演奏する */ + int no = getCaliValue(); + int loop = getCaliValue(); + + DEBUG_COMMAND("SP %d,%d:\n",no,loop); + + if (!mus_pcm_get_state()) { + dummy_pcm_in_play = TRUE; + } + + /* ???? */ + if (no == 0) { + mus_pcm_stop(0); + } else { + mus_pcm_start(no, loop); + } +} + +void commandST() { + /* PCMデータの演奏を停止する。 */ + int time = getCaliValue(); + + DEBUG_COMMAND("ST %d:\n",time); + + if (!mus_pcm_get_state()) { + dummy_pcm_in_play = FALSE; + } + mus_pcm_stop(time); +} + +void commandSU() { + /* PCMの演奏状態を変数 var1 , var2 に返す */ + int *var1 = getCaliVariable(); + int *var2 = getCaliVariable(); + + if (!mus_pcm_get_state()) { + *var1 = dummy_pcm_in_play ? 1 : 0; + *var2 = 0; + if (dummy_pcm_in_play) dummy_pcm_in_play = FALSE; + } else { + *var1 = mus_pcm_get_playposition(var2); + /* XXX for panyon_new */ + if (*var2 == 0){ + *var1 = dummy_pcm_in_play ? TRUE : FALSE; + dummy_pcm_in_play = dummy_pcm_in_play ? FALSE : TRUE; + } + } + if (dummy_pcm_su_flag) { + *var1 = *var2 = 0; + } + + DEBUG_COMMAND("SU %d,%d:\n",*var1, *var2); +} + +void commandSQ() { + /* 左右別々のPCMデータを合成して演奏する */ + int noL = getCaliValue(); + int noR = getCaliValue(); + int loop = getCaliValue(); + + DEBUG_COMMAND("SQ %d,%d,%d:\n", noL, noR, loop); + + if (!mus_pcm_get_state()) { + dummy_pcm_in_play = TRUE; + } + + if( noL<1 || noR<1 ) { + mus_pcm_stop(0); + return; + } + mus_pcm_mix(noL, noR, loop); + return; +} + +void commandSO() { + // PCMデバイスのサポート情報を取得 + int *var = getCaliVariable(); + + DEBUG_COMMAND_YET("SO %p:\n",var); +} + +void commandSW() { + /* 指定データ形式が演奏出来るかチェックする.*/ + int *var = getCaliVariable(); + int channel = getCaliValue(); + int Srate = getCaliValue(); + int bit = getCaliValue(); + + if (mus_pcm_get_state()) { + int rate = Srate == 11 ? 11025 : Srate == 22 ? 22050 : Srate == 44 ? 44100 : 8000; + boolean able; + int ret; + + ret = mus_pcm_check_ability(bit, rate, channel, &able); + if (ret < 0) { + *var = 0; + } else { + *var = (able ? 2 : 1); + } + } else { + *var = 0; + } + + DEBUG_COMMAND("SW %p,%d,%d,%d:\n",var, channel, Srate, bit); +} + +void commandSM() { + /* PCMデータをメモリ上に乗せる。*/ + int no = getCaliValue(); + DEBUG_COMMAND("SM %d:\n",no); + + mus_pcm_load(no); +} + +void commandSX() { + int device = sys_getc(); + int sw = sys_getc(); + + switch(sw) { + case 1: { + /* フェード */ + int time = getCaliValue(); + int volume = getCaliValue(); + int stop = getCaliValue(); + mus_mixer_fadeout_start(device, time, volume, stop); + DEBUG_COMMAND("SX %d,%d,%d,%d,%d:\n", device, sw, time, volume, stop); + break; + } + case 2: { + /* フェード終了確認 */ + int *var = getCaliVariable(); + boolean st; + st = mus_mixer_fadeout_get_state(device); + *var = (st ? 0 : 1); + DEBUG_COMMAND("SX %d,%d:\n", device, sw); + break; + } + case 3: { + /* フェード強制終了 */ + mus_mixer_fadeout_stop(device); + DEBUG_COMMAND("SX %d,%d:\n", device, sw); + break; + } + case 4: { + /* ボリューム取得 */ + int *var = getCaliVariable(); + *var = mus_mixer_get_level(device); + DEBUG_COMMAND("SX %d,%d:\n", device, sw); + break; + } + default: + SYSERROR("Unknown SX command\n"); + } +} diff --git a/src/cmdt.c b/src/cmdt.c new file mode 100644 index 0000000..3269692 --- /dev/null +++ b/src/cmdt.c @@ -0,0 +1,36 @@ +/* + * cmdt.c SYSTEM35 T command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdt.c,v 1.8 2006/04/21 16:40:48 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "message.h" + +void commandT() { + /* 文字の表示開始座標を指定する */ + int x = getCaliValue(); + int y = getCaliValue(); + msg_setMessageLocation(x, y); + + DEBUG_COMMAND("T %d,%d:\n",x,y); +} diff --git a/src/cmdu.c b/src/cmdu.c new file mode 100644 index 0000000..4eb1378 --- /dev/null +++ b/src/cmdu.c @@ -0,0 +1,109 @@ +/* + * cmdu.c SYSTEM35 U command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdu.c,v 1.7 2000/09/10 10:39:49 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "scenario.h" + +void commandUC() { /* 王道勇者 */ + /* ラベル・シナリオコールのスタックフレームを削除する。*/ + int mode = sys_getc(); + int num = getCaliValue(); + + switch(mode) { + case 0: + sl_stackClear_allCall(); break; + case 1: + sl_stackClear_labelCall(num); break; + case 2: + sl_stackClear_pageCall(num); break; + default: + break; + } + DEBUG_COMMAND("UC %d,%d:\n",mode,num); +} + +void commandUD() { + int mode = getCaliValue(); + + switch(mode) { + case 0: + sl_reinit(); break; + case 1: + sl_retFar2(); break; + default: + WARNING("UnKnown UD command %d\n", mode); + } + + DEBUG_COMMAND("UD %d:\n",mode); +} + +void commandUR() { + /* 最後に積まれたスタックの属性をリード */ + int *var = getCaliVariable(); + + DEBUG_COMMAND_YET("UR %p:\n",var); +} + +void commandUS() { + /* ローカル変数指定(変数 PUSH) */ + int *var = getCaliVariable(); + int cnt = getCaliValue(); + + sl_pushVar(var, cnt); + DEBUG_COMMAND("US %p,%d:\n",var,cnt); +} + +void commandUG() { + /* ローカル変数指定(変数 POP) */ + int *var = getCaliVariable(); + int cnt = getCaliValue(); + + sl_popVar(var, cnt); + DEBUG_COMMAND("UG %p,%d:\n",var,cnt); +} + +void commandUP0() { + /* 子プロセスを起動する */ + int no = getCaliValue(); + int mode = getCaliValue(); + + DEBUG_COMMAND_YET("UP0 %d,%d:\n",no,mode); +} + +void commandUP1() { + /* 子プロセスを起動する */ + char *str = sys_getString(':'); + int mode = getCaliValue(); + + DEBUG_COMMAND_YET("UP1 %s,%d:\n",str,mode); +} + +void commandUP3() { + /* 外部プログラム起動後SYSTEM3.6終了*/ + char *str1 = sys_getString(':'); + char *str2 = sys_getString(':'); + + DEBUG_COMMAND_YET("UP3 %s,%s:\n",str1,str2); +} diff --git a/src/cmdv.c b/src/cmdv.c new file mode 100644 index 0000000..ec2e3fa --- /dev/null +++ b/src/cmdv.c @@ -0,0 +1,1070 @@ +/* + * cmdv.c SYSTEM35 V command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdv.c,v 1.21 2001/05/09 04:11:24 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" +#include "imput.h" + +extern void sys_set_signalhandler(int SIG, void (*handler)(int)); + +typedef struct { + int x0Unit; + int y0Unit; + int nxUnit; + int nyUnit; + int bSpCol; + boolean fEnable; + boolean useTTP; + int TTPunit; +} UnitMapSrcImg; + +typedef struct { + int unitWidth; /* Unitの大きさ */ + int unitHeight; + int patternNum; /* パターン数 */ + int intervaltime; /* 書換え間隔 */ + int srcX; /* 取得位置 */ + int srcY; + int startX; /* 表示位置 */ + int startY; + int endX; /* 移動先 */ + int endY; + int saveX; /* 背景退避位置 */ + int saveY; + int spType; /* スプライト方法 */ + int spCol; /* スプライト色 */ + int state; /* 現在の状態 0:停止 1:動 */ + int elaspCut; /* 経過コマ数 */ + int quantmsec; /* 経過秒数 */ + int totalCut; /* 全コマ数 */ + int preX; /* 前回の位置 */ + int preY; + int curX; /* 現在位置 */ + int curY; + boolean draw; /* UNITを描く? */ + boolean nomove; /* 移動あり・なし */ + boolean rewrite; /* 画面更新の必要あり */ +} VaParam; + +typedef struct { + int x; + int y; +} VhMark; + +#define UNITMAP_DISPLAY_PAGE_MAX 16 /* VSの最大ページ数 */ +#define UNITMAP_VARIABLE_IMMOVALE 255 /* 歩数ペイントの移動不可能マーク */ +#define UNITMAP_VARIABLE_OUTOFRANGE 65535 /* 範囲外のマーク */ +#define UNITMAP_ATTRIB_DEPTH (4) +#define UNITMAP_ATTRIB_UNITNUMBER (0) +#define UNITMAP_ATTRIB_VARIABLE (1) +#define UNITMAP_ATTRIB_WALKPAINT (2) +#define UNITMAP_ATTRIB_WALKRESULT (3) + +/* UnitMAP 全体へのポインタ */ +static int *UnitMap = NULL; +/* VC command */ +static int nPageNum; +static int x0Map; +static int y0Map; +static int cxMap; +static int cyMap; +static int cxUnit; +static int cyUnit; +/* VH command */ +static VhMark *vh_src, *vh_dst, *_vh_src, *_vh_dst; +static int vh_cnt_src, vh_cnt_dst; +/* VP command */ +static UnitMapSrcImg *srcimg; +/* VA command state */ +#define VA_STOPPED 0 +#define VA_RUNNING 1 +#define VACMD_MAX 20 /* Panyoで18まで */ +static VaParam VAcmd[VACMD_MAX]; +static boolean inAnimation = FALSE; /* 画面更新中 */ + +/* UnitMap 各種マクロ */ +#define MAPSIZE_PER_ATTRIB (cxMap * cyMap) +#define MAPSIZE_PER_PAGE ((MAPSIZE_PER_ATTRIB) * UNITMAP_ATTRIB_DEPTH) + +#define UNITMAP_UNITNUMBER(page,x,y) (UnitMap + (page) * (MAPSIZE_PER_PAGE) + UNITMAP_ATTRIB_UNITNUMBER * (MAPSIZE_PER_ATTRIB) + (y) * cxMap + (x)) +#define UNITMAP_VARIABLE(page,x,y) (UnitMap + (page) * (MAPSIZE_PER_PAGE) + UNITMAP_ATTRIB_VARIABLE * (MAPSIZE_PER_ATTRIB) + (y) * cxMap + (x)) +#define UNITMAP_WALKPAINT(page,x,y) (UnitMap + (page) * (MAPSIZE_PER_PAGE) + UNITMAP_ATTRIB_WALKPAINT * (MAPSIZE_PER_ATTRIB) + (y) * cxMap + (x)) +#define UNITMAP_WALKRESULT(page,x,y) (UnitMap + (page) * (MAPSIZE_PER_PAGE) + UNITMAP_ATTRIB_WALKRESULT * (MAPSIZE_PER_ATTRIB) + (y) * cxMap + (x)) + +#define UNITMAP_UNITNUMBER_PAGETOP(page) UNITMAP_UNITNUMBER((page),0,0) +#define UNITMAP_VARIABLE_PAGETOP(page) UNITMAP_VARIABLE((page),0,0) +#define UNITMAP_WALKPAINT_PAGETOP(page) UNITMAP_WALKPAINT((page),0,0) +#define UNITMAP_WALKRESULT_PAGETOP(page) UNITMAP_WALKRESULT((page),0,0) + +static boolean vh_checkImmovableArea(int page, int x, int y, int w, int h); +static void vh_append_pos(int x, int y); +static void vh_copy_to_src(); +static void vh_check_udlr(int n, int nPage, int x, int y); +static void va_drawUnit(int no); +static void va_restoreUnit(int no); +static void va_updateUnit(int i); +static void va_updatePreArea(int i); +static void va_animationAlone(int i); +static void va_interval_process(); +static void va_init_itimer(); +static void va_pause_itimer(); +static void va_unpause_itimer(); +static void alarmHandler(); + +void commandVC() { /* from Rance4 */ + nPageNum = getCaliValue(); + x0Map = getCaliValue(); + y0Map = getCaliValue(); + cxMap = getCaliValue(); + cyMap = getCaliValue(); + cxUnit = getCaliValue(); + cyUnit = getCaliValue(); + + DEBUG_COMMAND("VC %d,%d,%d,%d,%d,%d,%d:\n",nPageNum, x0Map, y0Map, cxMap, cyMap, cxUnit, cyUnit); + + if (NULL != UnitMap ) { + free(UnitMap); + free(srcimg); + free(_vh_src); + free(_vh_dst); + } + + if (nPageNum > UNITMAP_DISPLAY_PAGE_MAX) { + WARNING("VC nPageNum too big %d\n", nPageNum); + sysVar[0] = 0; + return; + } + + UnitMap = (int *)calloc(cxMap * cyMap * nPageNum * UNITMAP_ATTRIB_DEPTH, sizeof(int)); + srcimg = (UnitMapSrcImg *)calloc(nPageNum, sizeof(UnitMapSrcImg)); + + if (NULL == UnitMap || NULL == srcimg) { + NOMEMERR(); + } + + _vh_src = (VhMark *)calloc(3 * (cxMap + cyMap), sizeof(VhMark)); + _vh_dst = (VhMark *)calloc(3 * (cxMap + cyMap), sizeof(VhMark)); + if (NULL == _vh_src || NULL == _vh_dst) { + NOMEMERR(); + } + sysVar[0] = 1; +} + +void commandVP() { /* from T2 */ + int nPage = getCaliValue(); + int x0Unit = getCaliValue(); + int y0Unit = getCaliValue(); + int nxUnit = getCaliValue(); + int nyUnit = getCaliValue(); + int bSpCol = getCaliValue(); + + DEBUG_COMMAND("VP %d,%d,%d,%d,%d,%d:\n",nPage, x0Unit, y0Unit, nxUnit, nyUnit, bSpCol); + + if (nPage >= nPageNum) { + WARNING("VP nPage too large %d\n", nPage); + return; + } + + srcimg[nPage].x0Unit = x0Unit; + srcimg[nPage].y0Unit = y0Unit; + srcimg[nPage].nxUnit = nxUnit; + srcimg[nPage].nyUnit = nyUnit; + srcimg[nPage].bSpCol = bSpCol; + srcimg[nPage].useTTP = FALSE; + srcimg[nPage].fEnable = TRUE; +} + +void commandVS() { /* from Rance4 */ + int nPage = getCaliValue(); + int nType = getCaliValue(); + int x = getCaliValue(); + int y = getCaliValue(); + int wData = getCaliValue(); + + DEBUG_COMMAND("VS %d,%d,%d,%d,%d:\n",nPage, nType, x, y, wData); + + if (nPage >= nPageNum) { + WARNING("VS nPage too large %d\n", nPage); + return; + } + + if (x >= cxMap || x < 0) { + WARNING("VS x out of range %d\n", x); + return; + } + + if (y >= cyMap || y < 0) { + WARNING("VS y out of range %d\n", y); + return; + } + if (wData < 0) { + WARNING("VS wData illegal value %d\n", wData); + return; + } + + /* どうやら、 sysVar[0] に値を返してはいけないらしい thanx 村田さん*/ + switch(nType) { + case 1: + /* sysVar[0] = *UNITMAP_UNITNUMBER(nPage, x, y); */ + *UNITMAP_UNITNUMBER(nPage, x, y) = wData; + break; + case 2: + /* sysVar[0] = *UNITMAP_VARIABLE(nPage, x, y); */ + *UNITMAP_VARIABLE(nPage, x, y) = wData; + break; + case 3: + /* sysVar[0] = *UNITMAP_WALKPAINT(nPage, x, y); */ + *UNITMAP_WALKPAINT(nPage, x, y) = wData; + break; + case 4: + /* sysVar[0] = *UNITMAP_WALKRESULT(nPage, x, y); */ + *UNITMAP_WALKRESULT(nPage, x, y) = wData; + break; + default: + WARNING("VS unknown type %d\n", nType); + } +} + +void commandVG() { /* from Rance4 */ + int nPage = getCaliValue(); + int nType = getCaliValue(); + int x = getCaliValue(); + int y = getCaliValue(); + + DEBUG_COMMAND("VG %d,%d,%d,%d:\n",nPage, nType, x, y); + + if (nPage >= nPageNum) { + WARNING("VG nPage too large %d\n", nPage); + return; + } + + if (x >= cxMap || x < 0) { + NOTICE("VG x out of range %d\n", x); + sysVar[0] = UNITMAP_VARIABLE_OUTOFRANGE; + return; + } + + if (y >= cyMap || y < 0) { + NOTICE("VG y out of range %d\n", y); + sysVar[0] = UNITMAP_VARIABLE_OUTOFRANGE; + return; + } + + switch(nType) { + case 1: + sysVar[0] = *UNITMAP_UNITNUMBER(nPage, x, y); break; + break; + case 2: + sysVar[0] = *UNITMAP_VARIABLE(nPage, x, y); break; + case 3: + sysVar[0] = *UNITMAP_WALKPAINT(nPage, x, y); break; + case 4: + sysVar[0] = *UNITMAP_WALKRESULT(nPage, x, y); break; + default: + WARNING("VG unknown type %d\n", nType); + } +} + +void commandVH() { /* from Rance4 */ + int nPage = getCaliValue(); + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int _max = getCaliValue(); + int xx, yy, i, n; + int maxfoot, lmtx, lmty, lmtw, lmth; + + DEBUG_COMMAND("VH %d,%d,%d,%d,%d,%d:\n",nPage, x, y, width, height, _max); + + if (nPage >= nPageNum) { + WARNING("VH nPage too large %d\n", nPage); + return; + } + if (x >= cxMap || x < 0) { + WARNING("VH x out of range %d\n", x); + return; + } + + if (y >= cyMap || y < 0) { + WARNING("VH y out of range %d\n", y); + return; + } + + if (_max == 0) { + for (yy = 0; yy < cyMap; yy++) { + for (xx = 0; xx < cxMap; xx++) { + *UNITMAP_WALKRESULT(nPage, xx , yy) = UNITMAP_VARIABLE_IMMOVALE;; + } + } + /* 自分自身は 0 */ + *UNITMAP_WALKRESULT(nPage, x , y) = 0; + return; + } + /* + for (yy = 0; yy < cyMap; yy++) { + for (xx = 0; xx < cxMap; xx++) { + *UNITMAP_WALKPAINT(nPage, xx, yy) == 255 ? putchar('*') : putchar(' '+ *UNITMAP_WALKPAINT(nPage, xx, yy)); + } + printf("\n"); + } + */ + maxfoot = min(_max, UNITMAP_VARIABLE_IMMOVALE); + lmtx = max(0, x - maxfoot); + lmty = max(0, y - maxfoot); + lmtw = min(maxfoot + cxMap - x, min(cxMap, 2 * maxfoot + 1)); + lmth = min(maxfoot + cyMap - y, min(cyMap, 2 * maxfoot + 1)); + + for (yy = 0; yy < cyMap; yy++) { + for (xx = 0; xx < cxMap; xx++) { + /* 最大歩数の外は不可 */ + if (maxfoot < (abs(yy-y)+abs(xx-x))) { + *UNITMAP_WALKRESULT(nPage, xx , yy) = UNITMAP_VARIABLE_IMMOVALE; + } else if (*UNITMAP_WALKPAINT(nPage, xx, yy) >= UNITMAP_VARIABLE_IMMOVALE) { + /* 障害物なら */ + *UNITMAP_WALKRESULT(nPage, xx , yy) = UNITMAP_VARIABLE_IMMOVALE; + } else { + /* いずれでもないときは 0 でならす */ + *UNITMAP_WALKRESULT(nPage, xx , yy) = 0; + } + } + } + + /* 移動不可領域の決定 */ + if (width > 1 || height > 1) { + for (yy = 0; yy < lmth; yy++) { + for (xx = 0; xx < lmtw; xx++) { + if (vh_checkImmovableArea(nPage, xx + lmtx, yy + lmty, width, height)) { + *UNITMAP_WALKRESULT(nPage, xx + lmtx , yy + lmty) = UNITMAP_VARIABLE_IMMOVALE; + } + } + } + } + + /* list の初期化 */ + vh_src = _vh_src; + vh_dst = _vh_dst; + /* 初期位置の設定 */ + vh_src -> x = x; + vh_src -> y = y; + vh_cnt_src = n = 1; + vh_cnt_dst = 0; + + while(TRUE) { + for (i = 0; i < vh_cnt_src; i++) { + vh_check_udlr(n, nPage, (vh_src + i)->x, (vh_src + i)->y); + } + if (vh_cnt_dst == 0) break; /* 未踏地が無くなったら終了 */ + vh_copy_to_src(); + if (n >= maxfoot) break; /* maxfoot までマークしたら終了 */ + n++; + } + + /* 閉領域を255に */ + for (yy = 0; yy < lmth; yy++) { + for (xx = 0; xx < lmtw; xx++) { + if (*UNITMAP_WALKRESULT(nPage, xx + lmtx, yy + lmty) == 0) { + *UNITMAP_WALKRESULT(nPage, xx + lmtx , yy + lmty) = UNITMAP_VARIABLE_IMMOVALE; + } + } + } + + /* 自分自身は 0 */ + *UNITMAP_WALKRESULT(nPage, x , y) = 0; + + /* + for (yy = 0; yy < cyMap; yy++) { + for (xx = 0; xx < cxMap; xx++) { + *UNITMAP_WALKRESULT(nPage, xx, yy) == 255 ? putchar('*') :putchar('0' + *UNITMAP_WALKRESULT(nPage, xx, yy)); + } + printf("\n"); + } + */ +} + +void commandVF() { /* from Panyo */ + int x, y, i; + int unit, unit_x, unit_y; + UnitMapSrcImg *img; + + for (i = 0; i < nPageNum; i++) { + img = &srcimg[i]; + + if (img->fEnable == FALSE) continue; + + for (y = 0; y < cyMap; y++) { + for (x = 0; x < cxMap; x++) { + unit = *UNITMAP_UNITNUMBER(i, x, y); + if (img->useTTP == TRUE && img->TTPunit == unit) continue; + // printf("i = %d, x = %d, y = %d, unit no = %d\n", i, x, y,unit); + unit_x = unit % img->nxUnit; + unit_y = unit / img->nxUnit; + if (img->bSpCol == 256) { + ags_copyArea(img->x0Unit + cxUnit * unit_x, + img->y0Unit + cyUnit * unit_y, + cxUnit, cyUnit, + x0Map + x * cxUnit, + y0Map + y * cyUnit); + } else { + ags_copyAreaSP(img->x0Unit + cxUnit * unit_x, + img->y0Unit + cyUnit * unit_y, + cxUnit, cyUnit, + x0Map + x * cxUnit, + y0Map + y * cyUnit, img->bSpCol); + } + } + } + } + + ags_updateArea(x0Map, y0Map, cxMap * cxUnit, cyMap * cyUnit); + DEBUG_COMMAND("VF:\n"); +} + +void commandVV() { /* from T2 */ + int nPage = getCaliValue(); + int fEnable = getCaliValue(); + + DEBUG_COMMAND("VV %d,%d:\n",nPage, fEnable); + + srcimg[nPage].fEnable = (fEnable == 1 ? TRUE : FALSE); +} + +void commandVR() { /* from Rance4 */ + int nPage = getCaliValue(); + int nType = getCaliValue(); + int *var = getCaliVariable(); + int *dst; + + DEBUG_COMMAND("VR %d,%d,%p:\n",nPage, nType, var); + + if (nPage >= nPageNum) { + WARNING("VR nPage too large %d\n", nPage); + return; + } + + switch(nType) { + case 1: + dst = UNITMAP_UNITNUMBER_PAGETOP(nPage); break; + case 2: + dst = UNITMAP_VARIABLE_PAGETOP(nPage); break; + case 3: + dst = UNITMAP_WALKPAINT_PAGETOP(nPage); break; + case 4: + dst = UNITMAP_WALKRESULT_PAGETOP(nPage); break; + default: + WARNING("VR unknown type %d\n", nType); + return; + } + + memcpy(dst, var, sizeof(int) * MAPSIZE_PER_ATTRIB); +} + +void commandVW() { /* from Rance4 */ + int nPage = getCaliValue(); + int nType = getCaliValue(); + int *var = getCaliVariable(); + int *src; + + DEBUG_COMMAND("VW %d,%d,%p:\n",nPage, nType, var); + + if (nPage >= nPageNum) { + WARNING("VW nPage too large %d\n", nPage); + return; + } + + switch(nType) { + case 1: + src = UNITMAP_UNITNUMBER_PAGETOP(nPage); break; + case 2: + src = UNITMAP_VARIABLE_PAGETOP(nPage); break; + case 3: + src = UNITMAP_WALKPAINT_PAGETOP(nPage); break; + case 4: + src = UNITMAP_WALKRESULT_PAGETOP(nPage); break; + default: + WARNING("VW unknown type %d\n", nType); + return; + } + + memcpy(var, src, sizeof(int) * MAPSIZE_PER_ATTRIB); +} + +void commandVE() { /* from T2 */ + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int out_ptn = getCaliValue(); + int flag = getCaliValue(); + int xx, yy, i; + int unit, unit_x, unit_y; + UnitMapSrcImg *img; + + DEBUG_COMMAND("VE %d,%d,%d,%d,%d,%d:\n", x, y, width, height, out_ptn, flag); + if (flag == 1) { + WARNING("VE flag1 is not yet\n"); + } + + for (i = 0; i < nPageNum; i++) { + img = &srcimg[i]; + /* VV による */ + if (img->fEnable == FALSE) continue; + + for (yy = y; yy < (y+height); yy++) { + for (xx = x; xx < (x+width); xx++) { + if (xx >= cxMap || yy >= cyMap) { + unit = out_ptn; + } else { + unit = *UNITMAP_UNITNUMBER(i, xx, yy); + } + + if (img->useTTP == TRUE && img->TTPunit == unit) continue; + //printf("i = %d, xx = %d, yy = %d, unit no = %d\n", i, xx, yy,unit); + unit_x = unit % img->nxUnit; + unit_y = unit / img->nxUnit; + ags_copyAreaSP(img->x0Unit + cxUnit * unit_x, + img->y0Unit + cyUnit * unit_y, + cxUnit, cyUnit, + x0Map + (xx-x) * cxUnit, + y0Map + (yy-y) * cyUnit, img->bSpCol); + } + } + } + + ags_updateArea(x0Map, y0Map, cxMap * cxUnit, cyMap * cyUnit); +} + +void commandVZ() { /* from T2 */ + int p1 = sys_getc(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + + DEBUG_COMMAND("VZ %d,%d,%d:\n", p1, p2, p3); + + switch(p1) { + case 0: + srcimg[p2].useTTP = FALSE; break; + case 1: + srcimg[p2].useTTP = TRUE; + srcimg[p2].TTPunit = p3; + break; + case 2: + x0Map = p2; y0Map = p3; + break; + case 3: + cxUnit = p2; cyUnit = p3; + break; + default: + WARNING("unknown VZ %d:\n", p1); + } +} + +void commandVX() { /* from T2 */ + int p1 = getCaliValue(); + int p2 = getCaliValue(); + int p3 = getCaliValue(); + int p4 = getCaliValue(); + + DEBUG_COMMAND("VX %d,%d,%d,%d:\n", p1, p2, p3, p4); + + switch(p1) { + case 0: + srcimg[p2].x0Unit = p3; + srcimg[p2].y0Unit = p4; break; + case 1: + srcimg[p2].nxUnit = p3; + srcimg[p2].nyUnit = p4; break; + case 2: + srcimg[p2].bSpCol = p3; break; + case 3: + /* かえるにょ国にょアリスで問題が出たのでとりあえず */ + // commandVF(); + break; + default: + WARNING("VX unknown command %d:\n", p1); + } +} + +void commandVT() { /* from Panyo */ + int sp = getCaliValue(); + int sa = getCaliValue(); + int sx = getCaliValue(); + int sy = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int dp = getCaliValue(); + int da = getCaliValue(); + int dx = getCaliValue(); + int dy = getCaliValue(); + int x, y, u; + + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + switch(sa) { + case 1: + u = *UNITMAP_UNITNUMBER(sp, sx + x, sy + y); break; + case 2: + u = *UNITMAP_VARIABLE(sp, sx + x, sy + y) ; break; + case 3: + u = *UNITMAP_WALKPAINT(sp, sx + x, sy + y) ; break; + case 4: + u = *UNITMAP_WALKRESULT(sp, sx + x, sy + y); break; + default: + WARNING("VT unknown type %d\n", sa); u = 0; + } + switch(da) { + case 1: + *UNITMAP_UNITNUMBER(dp, dx + x, dy + y) = u; break; + case 2: + *UNITMAP_VARIABLE(dp, dx + x, dy + y) = u; break; + case 3: + *UNITMAP_WALKPAINT(dp, dx + x, dy + y) = u; break; + case 4: + *UNITMAP_WALKRESULT(dp, dx + x, dy + y) = u; break; + } + } + } + + DEBUG_COMMAND("VT %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", sp, sa, sx, sy, width, height, dp, da, dx, dy); +} + +void commandVB() { + int page = getCaliValue(); + int type = getCaliValue(); + int x_pos = getCaliValue(); + int y_pos = getCaliValue(); + int x_size = getCaliValue(); + int y_size = getCaliValue(); + int data = getCaliValue(); + + DEBUG_COMMAND_YET("VB %d,%d,%d,%d,%d,%d,%d:\n", page, type, x_pos, y_pos, x_size, y_size, data); +} + +void commandVIC() { /* from Panyo */ + int sx = getCaliValue(); + int sy = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + int unit, unit_x, unit_y; + int x, y, i; + UnitMapSrcImg *img; + + DEBUG_COMMAND("VIC %d,%d,%d,%d:\n", sx, sy, width, height); + + for (i = 0; i < nPageNum; i++) { + img = &srcimg[i]; + if (img->fEnable == FALSE) continue; + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + unit = *UNITMAP_UNITNUMBER(i, sx + x, sy + y); + if (img->useTTP == TRUE && img->TTPunit == unit) continue; + //printf("i = %d, xx = %d, yy = %d, unit no = %d\n", i, xx, yy, unit); + unit_x = unit % img->nxUnit; + unit_y = unit / img->nxUnit; + ags_copyAreaSP(img->x0Unit + cxUnit * unit_x, + img->y0Unit + cyUnit * unit_y, + cxUnit, cyUnit, + x0Map + (sx + x) * cxUnit, + y0Map + (sy + y) * cyUnit, img->bSpCol); + } + } + } + ags_updateArea(x0Map + sx * cxUnit, y0Map + sy * cyUnit, width * cxUnit, height * cyUnit); +} + +void commandVIP() { + int x = getCaliValue(); + int y = getCaliValue(); + int width = getCaliValue(); + int height = getCaliValue(); + + DEBUG_COMMAND_YET("VIP %d,%d,%d,%d:\n", x, y, width, height); +} + +void commandVJ() { + /* 重み付き歩数ペイント */ + int page = getCaliValue(); + int x = getCaliValue(); + int y = getCaliValue(); + int max = getCaliValue(); + + DEBUG_COMMAND_YET("VJ %d,%d,%d,%d:\n", page, x, y, max); +} + +void commandVA() { /* from Panyo */ + static boolean startedItimer = FALSE; + int no = sys_getc(); + int p1 = getCaliValue(); + int p2, p3; + int *var1, *var2; + + if (no >= 10) { + var1 = getCaliVariable(); + var2 = getCaliVariable(); + DEBUG_COMMAND("VA %d,%d,%p,%p:\n", no, p1, var1, var2); + } else { + p2 = getCaliValue(); + p3 = getCaliValue(); + DEBUG_COMMAND("VA %d,%d,%d,%d:\n", no, p1, p2, p3); + } + + if (p1 > VACMD_MAX) { + WARNING("VA p1 is too lagrge %d\n", p1); + return; + } + + p1--; + switch(no) { + case 0: + if (p2 == 0) { + /* 停止 */ + inAnimation = TRUE; + VAcmd[p1].state = VA_STOPPED; + VAcmd[p1].draw = TRUE; + if (p3 == 0) { + /* ユニット消し */ + va_restoreUnit(p1); + va_updatePreArea(p1); + } else { + /* ユニット書く */ + va_drawUnit(p1); + va_updateUnit(p1); + } + VAcmd[p1].draw = FALSE; + } else { + /* 開始 (p3=コマ数,0:無限(開始位置==終了位置のとき))*/ + inAnimation = TRUE; + VAcmd[p1].elaspCut = 0; + VAcmd[p1].quantmsec = 0; + VAcmd[p1].totalCut = p3; + + if (p3 == 0) { + VAcmd[p1].nomove = TRUE; + } else { + if (VAcmd[p1].startX == VAcmd[p1].endX && VAcmd[p1].startY == VAcmd[p1].endY) { + VAcmd[p1].nomove = TRUE; + } else { + VAcmd[p1].nomove = FALSE; + } + } + /* animation start */ + if (startedItimer) { + va_unpause_itimer(); + } else { + startedItimer = TRUE; + va_init_itimer(); + } + + VAcmd[p1].state = VA_RUNNING; + VAcmd[p1].draw = TRUE; + va_drawUnit(p1); + va_updateUnit(p1); + if (p2 == 2) { + VAcmd[p1].rewrite = TRUE; + /* キー抜け無し ,p3=0は指定不可 */ + while(VAcmd[p1].state == VA_RUNNING) { + va_animationAlone(p1); + usleep(10*1000); + } + va_drawUnit(p1); + va_updateUnit(p1); + } else if (p2 == 3) { + /* キー抜けあり ,p3=0は指定不可*/ + int key = 0; + VAcmd[p1].rewrite = TRUE; + while(VAcmd[p1].state == VA_RUNNING) { + va_animationAlone(p1); + usleep(10*1000); + key = sys_getInputInfo(); + if (key != 0) { + sysVar[0] = key; + break; + } + + } + va_drawUnit(p1); + va_updateUnit(p1); + } else { + /* すぐに制御を戻す */ + } + } + break; + case 1: + /* 表示位置 */ + VAcmd[p1].curX = VAcmd[p1].preX = VAcmd[p1].startX = p2; + VAcmd[p1].curY = VAcmd[p1].preY = VAcmd[p1].startY = p3; break; + case 2: + /* 移動先(終ったら自動的に停止 */ + VAcmd[p1].endX = p2; + VAcmd[p1].endY = p3; break; + case 3: + /* サイズ */ + VAcmd[p1].unitWidth = p2; + VAcmd[p1].unitHeight = p3; break; + case 4: + /* パターン数・描替間隔(1/100sec) */ + VAcmd[p1].patternNum = p2; + VAcmd[p1].intervaltime = p3; break; + case 5: + /* 取得位置 */ + VAcmd[p1].srcX = p2; + VAcmd[p1].srcY = p3; break; + case 6: + /* 背景退避位置 */ + VAcmd[p1].saveX = p2; + VAcmd[p1].saveY = p3; break; + case 7: + /* スプライト方法・色 */ + VAcmd[p1].spType = p2; /* p2=0:通常コピー , p2=1:色指定スプライト, p2=2:影データスプライト */ + VAcmd[p1].spCol = p3; break; + case 10: + /* 状態取得(var1=0:停止1:動,var2=番号) */ + *var1 = VAcmd[p1].state == 0 ? 0 : 1; + *var2 = VAcmd[p1].elaspCut; break; + case 11: + /* 位置取得 */ + *var1 = VAcmd[p1].curX; + *var2 = VAcmd[p1].curY; break; + default: + WARNING("Unknown VA command %d\n", no); + } +} + +static boolean vh_checkImmovableArea(int page, int x, int y, int w, int h) { + int _x, _y; + + if (x + w > cxMap) return TRUE; + + if (y + h > cyMap) return TRUE; + + for (_y = y; _y < (y+h); _y++) { + for (_x = x; _x < (x+w); _x++) { + if (*UNITMAP_WALKRESULT(page, _x, _y) == 255) return TRUE; + } + } + + return FALSE; +} + +static void vh_append_pos(int x, int y) { + /* x, y を list に追加 */ + (vh_dst + vh_cnt_dst)->x = x; + (vh_dst + vh_cnt_dst)->y = y; + vh_cnt_dst++; +} + +static void vh_copy_to_src() { + VhMark *tmp; + + /* src list と dst list の入れ換え */ + tmp = vh_src; + vh_src = vh_dst; + vh_dst = tmp; + + vh_cnt_src = vh_cnt_dst; + vh_cnt_dst = 0; +} + +static void vh_check_udlr(int n, int nPage, int x, int y) { + /* 上下左右が未踏地なら値をセットしてlistに追加 */ + if (x > 0) { + if (*UNITMAP_WALKRESULT(nPage, x -1, y) == 0) { + *UNITMAP_WALKRESULT(nPage, x -1, y) = n; + vh_append_pos(x -1, y); + } + } + if (x < (cxMap-1)) { + if (*UNITMAP_WALKRESULT(nPage, x +1, y) == 0) { + *UNITMAP_WALKRESULT(nPage, x +1, y) = n; + vh_append_pos(x +1, y); + } + } + if (y > 0) { + if (*UNITMAP_WALKRESULT(nPage, x, y -1) == 0) { + *UNITMAP_WALKRESULT(nPage, x, y -1) = n; + vh_append_pos(x, y -1); + } + } + if (y < (cyMap-1)) { + if (*UNITMAP_WALKRESULT(nPage, x, y +1) == 0) { + *UNITMAP_WALKRESULT(nPage, x, y +1) = n; + vh_append_pos(x, y +1); + } + } +} + +static void va_drawUnit(int no) { + int unitno = VAcmd[no].elaspCut % VAcmd[no].patternNum; + int unitX = unitno % 10; /* し〜らないっと :-p */ + int unitY = unitno / 10; + + /* save */ + ags_copyArea(VAcmd[no].curX, VAcmd[no].curY, VAcmd[no].unitWidth, VAcmd[no].unitHeight, + VAcmd[no].saveX, VAcmd[no].saveY); + /* drawUnit */ + if (VAcmd[no].spType == 0) { + ags_copyArea(VAcmd[no].srcX + VAcmd[no].unitWidth * unitX, + VAcmd[no].srcY + VAcmd[no].unitHeight * unitY, + VAcmd[no].unitWidth, VAcmd[no].unitHeight, + VAcmd[no].curX, VAcmd[no].curY); + } else if (VAcmd[no].spType == 1) { + ags_copyAreaSP(VAcmd[no].srcX + VAcmd[no].unitWidth * unitX, + VAcmd[no].srcY + VAcmd[no].unitHeight * unitY, + VAcmd[no].unitWidth, VAcmd[no].unitHeight, + VAcmd[no].curX, VAcmd[no].curY, + VAcmd[no].spCol); + } +} + +static void va_restoreUnit(int no) { + ags_copyArea(VAcmd[no].saveX, VAcmd[no].saveY, VAcmd[no].unitWidth, VAcmd[no].unitHeight, + VAcmd[no].preX, VAcmd[no].preY); +} + +static void va_updateUnit(int i) { + ags_updateArea(VAcmd[i].curX, VAcmd[i].curY, VAcmd[i].unitWidth, VAcmd[i].unitHeight); +} + +static void va_updatePreArea(int i) { + ags_updateArea(VAcmd[i].preX, VAcmd[i].preY, VAcmd[i].unitWidth, VAcmd[i].unitHeight); +} + +void va_animation() { + int i; + int x, y, w, h; + + inAnimation = TRUE; + + for (i = 0; i < VACMD_MAX; i++) { + if (VAcmd[i].state == VA_STOPPED) continue; + if (!VAcmd[i].rewrite) continue; + if (VAcmd[i].draw) va_restoreUnit(i); + if (VAcmd[i].draw) va_drawUnit(i); + x = min(VAcmd[i].curX, VAcmd[i].preX); + y = min(VAcmd[i].curY, VAcmd[i].preY); + w = max(VAcmd[i].curX + VAcmd[i].unitWidth, VAcmd[i].preX + VAcmd[i].unitWidth) - x; + h = max(VAcmd[i].curY + VAcmd[i].unitHeight, VAcmd[i].preY + VAcmd[i].unitHeight) - y; + ags_updateArea(x, y, w, h); + // printf("x = %d, y = %d, w = %d, h = %d\n", x, y, w, h); + VAcmd[i].rewrite = FALSE; + } + + inAnimation = FALSE; +} + +static void va_animationAlone(int i) { + int x, y, w, h; /* update region */ + + if (!VAcmd[i].rewrite) return; + + inAnimation = TRUE; + + va_restoreUnit(i); + va_drawUnit(i); + + x = min(VAcmd[i].curX, VAcmd[i].preX); + y = min(VAcmd[i].curY, VAcmd[i].preY); + w = max(VAcmd[i].curX + VAcmd[i].unitWidth, VAcmd[i].preX + VAcmd[i].unitWidth) - x; + h = max(VAcmd[i].curY + VAcmd[i].unitHeight, VAcmd[i].preY + VAcmd[i].unitHeight) - y; + ags_updateArea(x, y, w, h); + + VAcmd[i].rewrite = FALSE; + inAnimation = FALSE; +} + +static void va_interval_process() { + boolean proceeding = FALSE; + int i; + + for (i = 0; i < VACMD_MAX; i++) { + if (VAcmd[i].state == VA_RUNNING) { + proceeding = TRUE; + VAcmd[i].quantmsec++; + + if (VAcmd[i].quantmsec >= VAcmd[i].intervaltime) { + /* まだ更新していない場合はskip */ + if (VAcmd[i].rewrite) continue; + VAcmd[i].rewrite = TRUE; + VAcmd[i].quantmsec = 0; + VAcmd[i].elaspCut++; + /* 古い場所 */ + VAcmd[i].preX = VAcmd[i].curX; + VAcmd[i].preY = VAcmd[i].curY; + /* 全コマ終ったら終了 */ + if (VAcmd[i].elaspCut >= VAcmd[i].totalCut) { + VAcmd[i].state = VA_STOPPED; + continue; + } + /* 移動なしの場合は skip */ + if (VAcmd[i].nomove) continue; + /* 新しい場所 */ + VAcmd[i].curX = VAcmd[i].startX + VAcmd[i].elaspCut * (VAcmd[i].endX - VAcmd[i].startX) / VAcmd[i].totalCut; + VAcmd[i].curY = VAcmd[i].startY + VAcmd[i].elaspCut * (VAcmd[i].endY - VAcmd[i].startY) / VAcmd[i].totalCut; + } + } + } + /* 更新するものが無い場合は、タイマーを止めて、アニメーションストップ */ + if (!proceeding) { + va_pause_itimer(); + nact->is_va_animation = FALSE; + } +} + +static void alarmHandler() { + if (!inAnimation) { + va_interval_process(); + } +} + +static void va_init_itimer() { + sys_set_signalhandler(SIGALRM, alarmHandler); + va_unpause_itimer(); +} + +static void va_pause_itimer() { + struct itimerval value; + + value.it_interval.tv_sec = 0; + value.it_interval.tv_usec = 0; + value.it_value.tv_sec = 0; + value.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &value, NULL); +} + +static void va_unpause_itimer() { + struct itimerval value; + + value.it_interval.tv_sec = 0; + value.it_interval.tv_usec = 10 * 1000; + value.it_value.tv_sec = 0; + value.it_value.tv_usec = 10 * 1000; + setitimer(ITIMER_REAL, &value, NULL); + nact->is_va_animation = TRUE; +} diff --git a/src/cmdw.c b/src/cmdw.c new file mode 100644 index 0000000..5ac57a1 --- /dev/null +++ b/src/cmdw.c @@ -0,0 +1,86 @@ +/* + * cmdw.c SYSTEM35 W command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdw.c,v 1.15 2003/01/25 01:34:50 chikama Exp $ */ + +#include +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" + +void commandWW() { + int x_size,y_size,color; + x_size = getCaliValue(); + y_size = getCaliValue(); + color = getCaliValue(); + + ags_setWorldSize(x_size, y_size, color); + + DEBUG_COMMAND("WW %d,%d,%d:\n",x_size, y_size, color); +} + +void commandWV() { + int start_x, start_y, size_x, size_y; + start_x = getCaliValue(); + start_y = getCaliValue(); + size_x = getCaliValue(); + size_y = getCaliValue(); + + ags_setViewArea(start_x, start_y, size_x, size_y); + ags_updateFull(); + + DEBUG_COMMAND("WV %d,%d,%d,%d:\n",start_x,start_y,size_x, size_y); +} + +void commandWZ() { + int p1 = sys_getc(); + int sw = getCaliValue(); + + switch(p1) { + case 0: + ags_setExposeSwitch(sw == 0 ? FALSE : TRUE); + if (sw == 1) { + /* う〜ん こんな処理いれなあかんのかぁ〜 (T_T) */ + if (nact->sys_world_depth == 8) nact->sys_pal_changed = TRUE; + ags_updateFull(); + } + break; + case 1: + ags_setExposeSwitch(sw == 0 ? FALSE : TRUE); + break; + default: + break; + } + DEBUG_COMMAND("WZ %d,%d:\n", p1, sw); +} + +void commandWX() { + int x0, y0, cx, cy; + x0 = getCaliValue(); + y0 = getCaliValue(); + cx = getCaliValue(); + cy = getCaliValue(); + + ags_setExposeSwitch(TRUE); + ags_updateArea(x0, y0, cx, cy); + + DEBUG_COMMAND("WX %d,%d,%d,%d:\n", x0, y0, cx, cy); +} diff --git a/src/cmdy.c b/src/cmdy.c new file mode 100644 index 0000000..bcc6de6 --- /dev/null +++ b/src/cmdy.c @@ -0,0 +1,78 @@ +/* + * cmdy.c SYSTEM35 Y command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdy.c,v 1.26 2001/04/29 23:30:25 chikama Exp $ */ + +#include +#include +#include +#include "portab.h" +#include "xsystem35.h" +#include "randMT.h" +#include "message.h" +#include "imput.h" + +boolean Y3waitCancel = TRUE; + +void commandY() { + int i; + unsigned int p1 = getCaliValue(); + unsigned int p2 = getCaliValue(); + + if (p1 == 1) { + if (p2 == 0) { + /* メッセージ領域の初期化と、文字の表示位置を左上端にセットする */ + msg_nextPage(TRUE); + } else if (p2 == 1) { + /* メッセージ領域の文字の表示位置を左上端にセットする */ + msg_nextPage(FALSE); + } + } else if (p1 == 2) { + /*システム変数 D01〜D20 までを初期化する */ + for (i = 0; i < 20; i++) { + sysVar[i + 1] = 0; + } + } else if (p1 == 3) { + if (p2 == 10000) { + /* 以降のウェイトではキー入力を受けつけなくなる */ + Y3waitCancel = FALSE; + } else if (p2 == 10001) { + /* 以降のウェイトではキー入力を受けつける(初期設定)*/ + Y3waitCancel = TRUE; + } else if (p2 == 0) { + sysVar[0] = sys_getInputInfo(); /* thanx TOTOさん */ + } else { + /* WAIT (1/60秒) × n だけウェイトをかける。*/ + if (get_skipMode()) return; + sysVar[0] = sys_keywait(16 * p2, Y3waitCancel); + } + } else if (p1 == 4) { + /* 1 〜 n までの乱数を RND に返す。*/ + if (p2 == 0 || p2 == 1) { + sysVar[0] = p2; + } else { + sysVar[0] = (int)(genrand() * p2) +1; + } + } else { + WARNING("Y undefined command %d\n", p1); + } + DEBUG_COMMAND("Y %d,%d:\n",p1,p2); +} diff --git a/src/cmdz.c b/src/cmdz.c new file mode 100644 index 0000000..e4fd99a --- /dev/null +++ b/src/cmdz.c @@ -0,0 +1,521 @@ +/* + * cmdz.c SYSTEM35 Z command + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: cmdz.c,v 1.35 2003/01/12 10:48:50 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" +#include "scenario.h" +#include "counter.h" +#include "randMT.h" +#include "selection.h" +#include "message.h" +#include "imput.h" +#include "nact.h" + +void commandZC() { + /* システムの使用環境を変更する */ + int m = getCaliValue(); + int n = getCaliValue(); + + switch(m) { + case 0: cg_vspPB = n; break; + case 1: nact->msg.MsgFontColor = n; break; + case 2: nact->sel.MsgFontColor = n; break; + case 3: nact->sel.WinFrameColor = n; break; + case 4: nact->sel.WinBackgroundColor = n; break; + case 5: nact->msg.WinFrameColor = n; break; + case 6: nact->msg.WinBackgroundColor = n; break; + case 7: nact->msg.HitAnyKeyMsgColor = n; break; + case 10: nact->sel.EncloseType = n; break; + case 11: nact->sel.SelectedElementColor = n; break; + case 13: nact->msg.WinBackgroundTransparent = n; break; + case 14: nact->sel.WinBackgroundTransparent = n; break; + case 15: sel_setDefaultElement(n); break; + default: + WARNING("commandZC(): Unknown Command (%d)", m); break; + } + + DEBUG_COMMAND("ZC %d,%d:\n",m,n); +} + +void commandZM() { + /* シナリオメッセージのフォントサイズを指定する。*/ + int size = getCaliValue(); + + if (size > 100) { + WARNING("msg font size force to 100 from %d\n", size); + size = 100; + } + + nact->msg.MsgFontSize = size; + + DEBUG_COMMAND("ZM %d:\n",size); +} + +void commandZS() { + /* 選択肢のフォントサイズを指定する */ + int size = getCaliValue(); + + nact->sel.MsgFontSize = size; + + DEBUG_COMMAND("ZS %d:\n",size); +} + +void commandZB() { + /* メッセージ文字を太さを設定 */ + int size = getCaliValue(); + + nact->msg.MsgFontBoldSize = size; + + DEBUG_COMMAND("ZB %d:\n",size); +} + +void commandZH() { + /* 全角半角切替え */ + int sw = getCaliValue(); + + sys_setHankakuMode(sw); + + DEBUG_COMMAND("ZH %d:\n",sw); +} + +void commandZW() { + /* CAPS 状態の内部的制御を変更する。 */ + int sw = getCaliValue(); + + if (sw < 256) { + nact->messagewait_enable_save = + nact->messagewait_enable = ((sw & 0xff) <= 1) ? FALSE : TRUE; + } else { + nact->messagewait_time = sw & 0xff; + nact->messagewait_cancel = (sw & 0x200) ? TRUE : FALSE; + } + + DEBUG_COMMAND("ZW %d:\n", sw); +} + +void commandZL() { + /* メッセージ領域の文字の縦方向行間ドット数を指定する。*/ + int line = getCaliValue(); + + nact->msg.LineIncrement = line; + + DEBUG_COMMAND("ZL %d:\n",line); +} + +void commandZE() { + /* 選択肢を選んだらメッセージ領域を初期化するかどうかを指定する */ + int sw = getCaliValue(); + + nact->sel.ClearMsgWindow = sw == 0 ? FALSE : TRUE; + + DEBUG_COMMAND("ZE %d:\n", sw); +} + +void commandZF() { + /* 選択肢枠サイズを可変にするか固定にするかを指定 */ + int sw = getCaliValue(); + + switch(sw) { + case 0: + nact->sel.WinResizeHeight = TRUE; break; + case 1: + nact->sel.WinResizeHeight = FALSE; break; + case 2: + nact->sel.WinResizeWidth = FALSE; break; + case 3: + nact->sel.WinResizeWidth = TRUE; break; + } + + DEBUG_COMMAND("ZF %d:\n", sw); +} + +void commandZD() { + /* デバッグモード時のデバッグメッセージの出力 ON/OFF/PAUSE */ + int c0 = sys_getc(); + int sw = 0, *var; + + switch(c0) { + case 0: + case 1: + sw = getCaliValue(); + break; + case 2: + sw = getCaliValue(); + DEBUG_MESSAGE("(ZD2)%s\n", v_str(sw -1)); + break; + case 3: + sw = getCaliValue(); break; + case 4: + var = getCaliVariable(); *var = 0; break; + } + + DEBUG_COMMAND("ZD %d,%d:\n", c0, sw); +} + +void commandZT0() { + /* 現在の日時を var0〜var6 の変数列に返す。*/ + time_t time_now = time(NULL); + struct tm *lc; + int sv = sl_getIndex(); + int c1, c2; + int *var; + + /* ZT 0,1対策 for DALK */ + c1 = sl_getc(); + c2 = sl_getc(); + if (c1 == 0x41 && c2 == 0x7f) { + reset_counter(0); + return; + } else { + sl_jmpNear(sv); + var = getCaliVariable(); + } + + lc = localtime(&time_now); + *var = 1900 + lc->tm_year; + *(var + 1) = 1 + lc->tm_mon; + *(var + 2) = lc->tm_mday; + *(var + 3) = lc->tm_hour; + *(var + 4) = lc->tm_min; + *(var + 5) = lc->tm_sec; + *(var + 6) = 1 + lc->tm_wday; + + DEBUG_COMMAND("ZT0 %p:\n", var); +} + +void commandZT1() { + /* タイマーを n の数値でクリアする */ + int n = getCaliValue(); + + reset_counter(n); + + DEBUG_COMMAND("ZT1 %d:\n", n); +} + +void commandZT2() { + /* タイマーを var に取得する 1/10 sec */ + int *var = getCaliVariable(); + int val = get_counter(100); + + if (val > 65535) val = 65535; + *var = val; + + DEBUG_COMMAND("ZT2 %p:\n", var); +} + +void commandZT3() { + /* タイマーを var に取得する 1/30 sec */ + int *var = getCaliVariable(); + int val = get_counter(33); + + if (val > 65535) val = 65535; + *var = val; + + DEBUG_COMMAND("ZT3 %p:\n", var); +} + +void commandZT4() { + /* タイマーを var に取得する 1/60 sec */ + int *var = getCaliVariable(); + int val = get_counter(17); + + if (val > 65535) val = 65535; + *var = val; + + DEBUG_COMMAND("ZT4 %p:\n", var); +} + +void commandZT5() { + /* タイマーを var に取得する */ + int *var = getCaliVariable(); + int val = get_counter(10); + + if (val > 65535) val = 65535; + *var = val; + + DEBUG_COMMAND("ZT5 %d:\n", val); +} + +void commandZT10() { + /* 高精度タイマー 設定 */ + int num = getCaliValue(); + int base = getCaliValue(); + int count = getCaliValue(); + + reset_counter_high(num, base ? base : 1, count); + + DEBUG_COMMAND("ZT10 %d,%d,%d:\n", num, base, count); +} + +void commandZT11() { + /* 高精度タイマー取得 */ + int num = getCaliValue(); + int *var = getCaliVariable(); + int val = get_high_counter(num); + + *var = val; + + DEBUG_COMMAND("ZT11 %d,%d,%d:\n", num, val, *var); +} + +void commandZT20() { + /* ??? wait? */ + int p1 = getCaliValue(); + + sysVar[0] = sys_keywait(p1, FALSE); + DEBUG_COMMAND("ZT20 %d:\n",p1); +} + +void commandZT21() { + /* ??? wait? */ + int p1 = getCaliValue(); + + sysVar[0] = sys_keywait(p1, TRUE); + + DEBUG_COMMAND("ZT21 %d:\n",p1); +} + +void commandZZ0() { + /* SYSTEM3.5を終了する */ + int sw = getCaliValue(); + + DEBUG_COMMAND("ZZ0 %d:\n",sw); + + if (sw == 0) { + sys_exit(sysVar[0]); + } else if (sw == 1) { + while (TRUE) { + usleep(1000*1000); + sys_getInputInfo(); + } + } +} + +void commandZZ1() { + /* 現在の動作機種コードを var に返す */ + int *var = getCaliVariable(); +#if 1 + *var = 1; +#else +#if defined(linux) + *var = 5; +#elif defined(__FreeBSD__) + *var = 6; +#endif +#endif + DEBUG_COMMAND("ZZ1 %p:",var); +} + +void commandZZ2() { + /* 機種文字列を文字列領域 num に返す(MAX12文字)*/ + int num = getCaliValue(); +#if defined(linux) + static BYTE str[] = {0x82, 0x6B, 0x82, 0x89, 0x82, 0x8E, 0x82, 0x95, 0x82, 0x98, 0}; +#elif defined(__FreeBSD__) + static BYTE str[] = {0x82, 0x65, 0x82, 0x92, 0x82, 0x85, 0x82, 0x85, 0x82, 0x61, 0x82, 0x72, 0x82, 0x63, 0}; +#elif defined(__OpenBSD__) + static BYTE str[] = {0x82, 0x6E, 0x82, 0x90, 0x82, 0x85, 0x82, 0x8E, 0x82, 0x61, 0x82, 0x72, 0x82, 0x63, 0}; +#elif defined(__NetBSD__) + static BYTE str[] = {0x82, 0x6D, 0x82, 0x85, 0x82, 0x94, 0x82, 0x61, 0x82, 0x72, 0x82, 0x63, 0}; +#elif defined(sun) + static BYTE str[] = {0x82, 0x72, 0x82, 0x95, 0x82, 0x8E, 0x82, 0x6E, 0x82, 0x72, 0}; +#elif defined(__osf__) + static BYTE str[] = {0x82, 0x63, 0x82, 0x89, 0x82, 0x87, 0x82, 0x89, 0x82, 0x94, 0x82, 0x81, 0x82, 0x8C, 0x82, 0x74, 0x82, 0x6D, 0x82, 0x68, 0x82, 0x77, 0}; +#elif defined(sgi) + static BYTE str[] = {0x82, 0x68, 0x82, 0x71, 0x82, 0x68, 0x82, 0x77, 0}; +#else + static BYTE str[] = {0x82, 0x74, 0x82, 0x8e, 0x82, 0x8b, 0x82, 0x8e, 0x82, 0x8f, 0x82, 0x97, 0x82, 0x8e, 0}; +#endif + v_strcpy(num -1, str); + + DEBUG_COMMAND("ZZ2 %d:\n",num); +} + +void commandZZ3() { + /* WINDOWSの全画面サイズや表示色数を変数列に返す */ + int *var = getCaliVariable(); + DispInfo info; + + ags_getWindowInfo(&info); + *var = info.width; + *(var + 1) = info.height; + *(var + 2) = info.depth; + + DEBUG_COMMAND("ZZ3 %p:\n",var); +} + +void commandZZ4() { + /* DIB の全画面 サイズや色数を変数列に返す */ + int *var = getCaliVariable(); + DispInfo info; + + ags_getDIBInfo(&info); + *var = info.width; + *(var + 1) = info.height; + *(var + 2) = info.depth; + + DEBUG_COMMAND("ZZ4 %p:\n",var); +} + +void commandZZ5() { + /* SYSTEM3.5用表示画面 の サイズや色数を変数列に返す */ + int *var = getCaliVariable(); + DispInfo info; + + ags_getViewAreaInfo(&info); + *var = info.width; + *(var + 1) = info.height; + *(var + 2) = info.depth; + + DEBUG_COMMAND("ZZ5 %p:\n",var); +} + +void commandZZ7() { + // セーブドライブの残りディスク容量を得る + int *var = getCaliVariable(); + + *var = 65535; + + DEBUG_COMMAND("ZZ7 %p:\n",var); +} + +void commandZZ8() { + // メモリオンバッファの残り容量を得る + int *var = getCaliVariable(); + + DEBUG_COMMAND_YET("ZZ8 %p:\n",var); +} + +void commandZZ9() { + /* 起動時のスクリーンサイズを取得する */ + int *var = getCaliVariable(); + DispInfo info; + + ags_getWindowInfo(&info); + *var = info.width; + *(var + 1) = info.height; + *(var + 2) = info.depth; + + DEBUG_COMMAND("ZZ9 %p:\n",var); +} + +void commandZZ10() { + /* スクリーンモードを取得する */ + int *var = getCaliVariable(); + + *var = nact->sys_fullscreen_on ? 1 : 0; + + DEBUG_COMMAND("ZZ10 %d:\n",*var); +} + +void commandZZ13() { + /* 表示フォントを設定する */ + int num = getCaliValue(); + + nact->msg.MsgFont = num; + + DEBUG_COMMAND("ZZ13 %d:\n",num); +} + +void commandZZ14() { + int no = getCaliValue(); + char *lname=getlogin(); + + if (no <= 0) return; + if (lname) { + v_strcpy(no -1, lname); + } else { + char s[256]; + sprintf(s, "%d", getuid()); + v_strcpy(no -1, s); + } + + DEBUG_COMMAND("ZZ14 %d:\n", no); +} + +void commandZG() { + /* CGのロードした回数をリンク番号毎に配列に書き込む配列を設定 */ + int *var = getCaliVariable(); + + cg_loadCountVar = var; + + DEBUG_COMMAND("ZG %p:\n",var); +} + +void commandZI() { /* T2 */ + /* Aコマンドのキー入力待ち時の各キーの動作の指定 */ + int key = getCaliValue(); + int mode = getCaliValue(); + + set_hak_keymode(key, mode); + + DEBUG_COMMAND("ZI %d,%d:\n", key, mode); +} + +void commandZA() { /* T2 */ + /* 文字飾りの種類を指定する */ + int p1 = sys_getc(); + int p2 = getCaliValue(); + + switch(p1) { + case 0: + msg_setStringDecorationType(p2); break; + case 1: + msg_setStringDecorationColor(p2); break; + case 2: + case 3: + nact->msg.AutoPageChange = (p2 == 0 ? FALSE : TRUE); break; + default: + WARNING("Unknown ZA comannd %d, %d\n", p1, p2); + } + + DEBUG_COMMAND("ZA %d,%d:\n", p1, p2); +} + +void commandZK() { + // ディスクの入れ替えを促す + int p1 = getCaliValue(); + int p2 = getCaliValue(); + char *str = sys_getString(':'); + + DEBUG_COMMAND("ZK %d,%d,%s:\n", p1, p2, str); +} + +void commandZR() { + /* 1 〜 num までの乱数を発生して変数に返す。 */ + int num = getCaliValue(); + int *var = getCaliVariable(); + + if (num == 0 || num == 1) { + *var = num; + } else { + *var = (int)(genrand() * num) +1; + } + + DEBUG_COMMAND("ZR %d,%d:\n", num, *var); +} diff --git a/src/counter.c b/src/counter.c new file mode 100644 index 0000000..e63d837 --- /dev/null +++ b/src/counter.c @@ -0,0 +1,89 @@ +/* + * counter.c 内部カウンタ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * +*/ +/* $Id: counter.c,v 1.10 2000/11/25 13:09:03 chikama Exp $ */ + +#include +#include +#include +#include +#include "counter.h" + +#define HICOUNTER_MAX (256 + EXTER_HIGHTCOUNTER_NUM) +static struct timeval tv_base; +static int counter_init = 0; + +static int counter_init_high[HICOUNTER_MAX]; +static struct timeval tv_high[HICOUNTER_MAX]; +static int division_high[HICOUNTER_MAX] = { [0 ...( HICOUNTER_MAX-1 )]=1}; + +int get_counter(int division) { + long sec, usec, usec2; + struct timeval tv; + + gettimeofday(&tv, NULL); + sec = tv.tv_sec - tv_base.tv_sec; + usec = tv.tv_usec - tv_base.tv_usec; + usec2 = sec * 1000l + usec / 1000l; + return counter_init + (int)(usec2 / division); +} + +/* カウンタ〜を valでリセット */ +/* 初期化時に一度呼んでおく */ +void reset_counter(int val) { + counter_init = val; + gettimeofday(&tv_base, NULL); +} + + +int get_high_counter(int num) { + long sec, usec, usec2; + struct timeval tv; + struct timeval tv_base = tv_high[num -1]; + int division = division_high[num -1]; + + gettimeofday(&tv, NULL); + sec = tv.tv_sec - tv_base.tv_sec; + usec = tv.tv_usec - tv_base.tv_usec; + usec2 = sec * (1000l/division)+ usec / 1000l /division; + return counter_init_high[num -1] + usec2; +} + +/* 高精度カウンタ〜 thanx tajiri@wizard */ +/* カウンタ〜を valでリセット */ +/* 初期化時に一度呼んでおく */ +void reset_counter_high(int num,int division,int val) { + if (num == 0) { + int i; + for (i = 0; i < 256; i++) { + counter_init_high[i] = val; + gettimeofday(&tv_high[i], NULL); + division_high[i]=division; + } + } else { + counter_init_high[num -1] = val; + gettimeofday(&tv_high[num -1], NULL); + division_high[num -1]=division; + } +} + + diff --git a/src/counter.h b/src/counter.h new file mode 100644 index 0000000..8553505 --- /dev/null +++ b/src/counter.h @@ -0,0 +1,39 @@ +/* + * counter.h 内部カウンタ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: counter.h,v 1.7 2000/11/25 13:09:03 chikama Exp $ */ + +#ifndef __COUNTER__ +#define __COUNTER__ + +#define EXTER_HIGHTCOUNTER_NUM 5 +#define SYSTEMCOUNTER_MP3 (256 + 1) +#define SYSTEMCOUNTER_MIDI (256 + 2) +#define SYSTEMCOUNTER_MAINLOOP (256 + 3) +#define SYSTEMCOUNTER_FADE (256 + 4) +#define SYSTEMCOUNTER_MSEC (256 + 5) /* 1msec no reset counter */ + +extern int get_counter(int division); +extern void reset_counter(int val); +extern int get_high_counter(int num); +extern void reset_counter_high(int num, int division, int val); + +#endif /* !__COUNTER__ */ diff --git a/src/cp932tojis0213.c b/src/cp932tojis0213.c new file mode 100644 index 0000000..2c5bb64 --- /dev/null +++ b/src/cp932tojis0213.c @@ -0,0 +1,611 @@ +int cp932tosjis0213(int code) { + int ret; + + switch(code){ + case 0x8160: ret = 0x81b0; break; + case 0x8161: ret = 0x81d2; break; + case 0x817c: ret = 0x81af; break; + case 0x8790: ret = 0x81e0; break; + case 0x8791: ret = 0x81df; break; + case 0x8792: ret = 0x81e7; break; + case 0x8795: ret = 0x81e3; break; + case 0x8796: ret = 0x81db; break; + case 0x8797: ret = 0x81da; break; + case 0x879a: ret = 0x81e6; break; + case 0x879b: ret = 0x81bf; break; + case 0x879c: ret = 0x81be; break; + case 0xed40: ret = 0xedb5; break; + case 0xed41: ret = 0xee8e; break; + case 0xed42: ret = 0xef58; break; + case 0xed43: ret = 0xef4d; break; + case 0xed44: ret = 0xf8d3; break; + case 0xed45: ret = 0x87b7; break; + case 0xed46: ret = 0xf580; break; + case 0xed47: ret = 0xeb54; break; + case 0xed48: ret = 0xeb89; break; + case 0xed49: ret = 0xfb42; break; + case 0xed4a: ret = 0xeb56; break; + case 0xed4b: ret = 0xeab8; break; + case 0xed4c: ret = 0x87a2; break; + case 0xed4d: ret = 0x87a6; break; + case 0xed4f: ret = 0xf05e; break; + case 0xed50: ret = 0x87a9; break; + case 0xed52: ret = 0x87ae; break; + case 0xed53: ret = 0xf06c; break; + case 0xed54: ret = 0x87b3; break; + case 0xed55: ret = 0xf06d; break; + case 0xed56: ret = 0x87b4; break; + case 0xed58: ret = 0x87bf; break; + case 0xed59: ret = 0xf07c; break; + case 0xed5b: ret = 0xf07b; break; + case 0xed5c: ret = 0xf080; break; + case 0xed5d: ret = 0xf087; break; + case 0xed5e: ret = 0xf07e; break; + case 0xed5f: ret = 0x87c2; break; + case 0xed62: ret = 0x87cd; break; + case 0xed64: ret = 0x87d2; break; + case 0xed67: ret = 0x87db; break; + case 0xed69: ret = 0xf162; break; + case 0xed6b: ret = 0x87e5; break; + case 0xed6c: ret = 0x87e9; break; + case 0xed6d: ret = 0x87ea; break; + case 0xed6e: ret = 0xf16d; break; + case 0xed70: ret = 0x87f0; break; + case 0xed71: ret = 0x87f2; break; + case 0xed74: ret = 0x87f6; break; + case 0xed75: ret = 0xf18c; break; + case 0xed76: ret = 0x8840; break; + case 0xed77: ret = 0x8842; break; + case 0xed78: ret = 0x8849; break; + case 0xed7b: ret = 0xf1ea; break; + case 0xed7c: ret = 0x886e; break; + case 0xed7d: ret = 0x886d; break; + case 0xed7e: ret = 0x886a; break; + case 0xed80: ret = 0x8876; break; + case 0xed81: ret = 0x887c; break; + case 0xed83: ret = 0xf259; break; + case 0xed85: ret = 0xf264; break; + case 0xed86: ret = 0x8889; break; + case 0xed88: ret = 0x888d; break; + case 0xed8a: ret = 0x9875; break; + case 0xed8b: ret = 0xf0a2; break; + case 0xed8c: ret = 0xecc7; break; + case 0xed8d: ret = 0x9878; break; + case 0xed8e: ret = 0x9879; break; + case 0xed8f: ret = 0x987b; break; + case 0xed90: ret = 0xf0c1; break; + case 0xed91: ret = 0x9889; break; + case 0xed93: ret = 0x9891; break; + case 0xed94: ret = 0x9895; break; + case 0xed95: ret = 0x9892; break; + case 0xed96: ret = 0xf0d3; break; + case 0xed97: ret = 0x9897; break; + case 0xed98: ret = 0x989c; break; + case 0xed99: ret = 0xf0e5; break; + case 0xed9c: ret = 0xeab4; break; + case 0xed9d: ret = 0xeabc; break; + case 0xed9e: ret = 0xeac3; break; + case 0xed9f: ret = 0xeac5; break; + case 0xeda2: ret = 0xf2cb; break; + case 0xeda4: ret = 0xead3; break; + case 0xeda6: ret = 0xf2d6; break; + case 0xeda8: ret = 0xead9; break; + case 0xeda9: ret = 0xead8; break; + case 0xedaa: ret = 0xf2e7; break; + case 0xedac: ret = 0xf341; break; + case 0xedad: ret = 0xeaf2; break; + case 0xedae: ret = 0xeaf8; break; + case 0xedaf: ret = 0xf36f; break; + case 0xedb0: ret = 0xeafa; break; + case 0xedb2: ret = 0xeb4b; break; + case 0xedb3: ret = 0xeb4d; break; + case 0xedb5: ret = 0xeb4c; break; + case 0xedb7: ret = 0xeb4e; break; + case 0xedb8: ret = 0xeb51; break; + case 0xedb9: ret = 0xeb5d; break; + case 0xedba: ret = 0xf39e; break; + case 0xedbb: ret = 0xeb5a; break; + case 0xedbd: ret = 0xeb5e; break; + case 0xedbe: ret = 0xf3ab; break; + case 0xedbf: ret = 0xeb63; break; + case 0xedc0: ret = 0xeb64; break; + case 0xedc1: ret = 0xf3b1; break; + case 0xedc2: ret = 0xeb6b; break; + case 0xedc4: ret = 0xeb6d; break; + case 0xedc5: ret = 0xeb6f; break; + case 0xedc6: ret = 0xeb77; break; + case 0xedc7: ret = 0xeb7d; break; + case 0xedc8: ret = 0xeb79; break; + case 0xedc9: ret = 0xeb7c; break; + case 0xedca: ret = 0xf3dd; break; + case 0xedcb: ret = 0xf3fb; break; + case 0xedcc: ret = 0xf3f7; break; + case 0xedcd: ret = 0xeb98; break; + case 0xedce: ret = 0xeb9a; break; + case 0xedcf: ret = 0xf455; break; + case 0xedd0: ret = 0xeba0; break; + case 0xedd1: ret = 0xf460; break; + case 0xedd2: ret = 0xebae; break; + case 0xedd3: ret = 0xf472; break; + case 0xedd4: ret = 0xebaf; break; + case 0xedd5: ret = 0xf479; break; + case 0xedd7: ret = 0xebb6; break; + case 0xedd8: ret = 0xebc9; break; + case 0xedd9: ret = 0xf4b3; break; + case 0xedda: ret = 0xebd0; break; + case 0xeddb: ret = 0xebd5; break; + case 0xeddd: ret = 0xf4c2; break; + case 0xedde: ret = 0xebdf; break; + case 0xeddf: ret = 0xebe9; break; + case 0xede2: ret = 0xebed; break; + case 0xede3: ret = 0xf4e6; break; + case 0xede6: ret = 0xebf4; break; + case 0xede8: ret = 0xebf8; break; + case 0xede9: ret = 0xf4ee; break; + case 0xedea: ret = 0xf4f1; break; + case 0xedeb: ret = 0xf543; break; + case 0xedec: ret = 0xec4e; break; + case 0xeded: ret = 0xf560; break; + case 0xedee: ret = 0xec5a; break; + case 0xedef: ret = 0xec5b; break; + case 0xedf0: ret = 0xf569; break; + case 0xedf1: ret = 0xec5d; break; + case 0xedf2: ret = 0xec64; break; + case 0xedf3: ret = 0xec66; break; + case 0xedf4: ret = 0xec6b; break; + case 0xedf5: ret = 0xf58b; break; + case 0xedf6: ret = 0xec76; break; + case 0xedf7: ret = 0xec71; break; + case 0xedf8: ret = 0xec72; break; + case 0xedf9: ret = 0xec79; break; + case 0xedfa: ret = 0xec7d; break; + case 0xedfb: ret = 0xec81; break; + case 0xedfc: ret = 0xf5bb; break; + case 0xee40: ret = 0xec89; break; + case 0xee42: ret = 0xec8f; break; + case 0xee43: ret = 0xf5d5; break; + case 0xee45: ret = 0xec99; break; + case 0xee46: ret = 0xec9b; break; + case 0xee47: ret = 0xec9d; break; + case 0xee49: ret = 0xec9f; break; + case 0xee4b: ret = 0xeca4; break; + case 0xee4c: ret = 0xeca6; break; + case 0xee4e: ret = 0xeca9; break; + case 0xee4f: ret = 0xecb1; break; + case 0xee50: ret = 0xecb6; break; + case 0xee51: ret = 0xecb9; break; + case 0xee52: ret = 0xecc5; break; + case 0xee53: ret = 0xecc8; break; + case 0xee55: ret = 0xf68f; break; + case 0xee56: ret = 0xece1; break; + case 0xee57: ret = 0xecdf; break; + case 0xee58: ret = 0xece2; break; + case 0xee5a: ret = 0xecf0; break; + case 0xee5b: ret = 0xf163; break; + case 0xee5c: ret = 0xf6c1; break; + case 0xee5d: ret = 0xed41; break; + case 0xee5e: ret = 0xf6c4; break; + case 0xee60: ret = 0xf6dc; break; + case 0xee62: ret = 0xed5b; break; + case 0xee63: ret = 0xed5c; break; + case 0xee64: ret = 0xf6e5; break; + case 0xee65: ret = 0xed60; break; + case 0xee66: ret = 0xf6e8; break; + case 0xee67: ret = 0xf758; break; + case 0xee68: ret = 0xf759; break; + case 0xee6a: ret = 0xed77; break; + case 0xee6b: ret = 0xed83; break; + case 0xee6d: ret = 0xeda0; break; + case 0xee6e: ret = 0xeda2; break; + case 0xee6f: ret = 0xf7c5; break; + case 0xee70: ret = 0xeda6; break; + case 0xee71: ret = 0xedaa; break; + case 0xee72: ret = 0xedb3; break; + case 0xee73: ret = 0xedb7; break; + case 0xee76: ret = 0xedea; break; + case 0xee77: ret = 0xedeb; break; + case 0xee78: ret = 0xf8b1; break; + case 0xee79: ret = 0xedfb; break; + case 0xee7b: ret = 0xee47; break; + case 0xee7c: ret = 0xee4e; break; + case 0xee7d: ret = 0xf8ef; break; + case 0xee7e: ret = 0xee57; break; + case 0xee81: ret = 0xee59; break; + case 0xee82: ret = 0xee5f; break; + case 0xee83: ret = 0xf957; break; + case 0xee84: ret = 0xf964; break; + case 0xee86: ret = 0xee8d; break; + case 0xee87: ret = 0xee9d; break; + case 0xee88: ret = 0xeea0; break; + case 0xee89: ret = 0xeea6; break; + case 0xee8a: ret = 0xeea7; break; + case 0xee8b: ret = 0xf9de; break; + case 0xee8c: ret = 0xeea9; break; + case 0xee8d: ret = 0xeeac; break; + case 0xee8e: ret = 0xeeab; break; + case 0xee90: ret = 0xf9ed; break; + case 0xee91: ret = 0xfa4f; break; + case 0xee92: ret = 0xeeb8; break; + case 0xee93: ret = 0xeebc; break; + case 0xee97: ret = 0xfa8e; break; + case 0xee9a: ret = 0xeee5; break; + case 0xee9b: ret = 0xeee8; break; + case 0xee9c: ret = 0xeeea; break; + case 0xee9d: ret = 0xeeee; break; + case 0xee9e: ret = 0xfacc; break; + case 0xee9f: ret = 0xeefa; break; + case 0xeea1: ret = 0xef41; break; + case 0xeea2: ret = 0xfad0; break; + case 0xeea3: ret = 0xeefc; break; + case 0xeea4: ret = 0xef40; break; + case 0xeea6: ret = 0xef44; break; + case 0xeea7: ret = 0xfad2; break; + case 0xeea8: ret = 0xef47; break; + case 0xeea9: ret = 0xef49; break; + case 0xeeaa: ret = 0xef48; break; + case 0xeeab: ret = 0xfada; break; + case 0xeeac: ret = 0xfadd; break; + case 0xeead: ret = 0xfadb; break; + case 0xeeae: ret = 0xef46; break; + case 0xeeaf: ret = 0xfae1; break; + case 0xeeb0: ret = 0xfaed; break; + case 0xeeb2: ret = 0xef4c; break; + case 0xeeb3: ret = 0xfafa; break; + case 0xeeb4: ret = 0xfaf7; break; + case 0xeeb5: ret = 0xfaf8; break; + case 0xeeb6: ret = 0xfaf6; break; + case 0xeeb9: ret = 0xef52; break; + case 0xeeba: ret = 0xef51; break; + case 0xeebb: ret = 0xef57; break; + case 0xeebc: ret = 0xef56; break; + case 0xeebd: ret = 0xfb43; break; + case 0xeebf: ret = 0xfb48; break; + case 0xeec0: ret = 0xef53; break; + case 0xeec1: ret = 0xfb47; break; + case 0xeec2: ret = 0xfb44; break; + case 0xeec3: ret = 0xef5e; break; + case 0xeec4: ret = 0xfb4f; break; + case 0xeec6: ret = 0xef62; break; + case 0xeec7: ret = 0xef63; break; + case 0xeeca: ret = 0xfb6c; break; + case 0xeecd: ret = 0xef7c; break; + case 0xeecf: ret = 0xef7d; break; + case 0xeed0: ret = 0xfb8c; break; + case 0xeed1: ret = 0xef86; break; + case 0xeed2: ret = 0xef87; break; + case 0xeed4: ret = 0xef88; break; + case 0xeed5: ret = 0xef8a; break; + case 0xeed7: ret = 0xfb9c; break; + case 0xeed8: ret = 0xef9f; break; + case 0xeed9: ret = 0xefa3; break; + case 0xeede: ret = 0xefa9; break; + case 0xeedf: ret = 0xefb1; break; + case 0xeee1: ret = 0xfc51; break; + case 0xeee2: ret = 0xefc2; break; + case 0xeee3: ret = 0xefc1; break; + case 0xeee4: ret = 0xefc5; break; + case 0xeee5: ret = 0xfc69; break; + case 0xeee7: ret = 0xefcd; break; + case 0xeee8: ret = 0xefdc; break; + case 0xeee9: ret = 0xfcb2; break; + case 0xeeeb: ret = 0xfccd; break; + case 0xeeec: ret = 0xeff0; break; + case 0xeeef: ret = 0x86b3; break; + case 0xeef0: ret = 0x86b4; break; + case 0xeef1: ret = 0x86b5; break; + case 0xeef2: ret = 0x86b6; break; + case 0xeef3: ret = 0x86b7; break; + case 0xeef4: ret = 0x86b8; break; + case 0xeef5: ret = 0x86b9; break; + case 0xeef6: ret = 0x86ba; break; + case 0xeef7: ret = 0x86bb; break; + case 0xeef8: ret = 0x86bc; break; + case 0xeefb: ret = 0x81ad; break; + case 0xeefc: ret = 0x81ae; break; + case 0xfa40: ret = 0x86b3; break; + case 0xfa41: ret = 0x86b4; break; + case 0xfa42: ret = 0x86b5; break; + case 0xfa43: ret = 0x86b6; break; + case 0xfa44: ret = 0x86b7; break; + case 0xfa45: ret = 0x86b8; break; + case 0xfa46: ret = 0x86b9; break; + case 0xfa47: ret = 0x86ba; break; + case 0xfa48: ret = 0x86bb; break; + case 0xfa49: ret = 0x86bc; break; + case 0xfa4a: ret = 0x8754; break; + case 0xfa4b: ret = 0x8755; break; + case 0xfa4c: ret = 0x8756; break; + case 0xfa4d: ret = 0x8757; break; + case 0xfa4e: ret = 0x8758; break; + case 0xfa4f: ret = 0x8759; break; + case 0xfa50: ret = 0x875a; break; + case 0xfa51: ret = 0x875b; break; + case 0xfa52: ret = 0x875c; break; + case 0xfa53: ret = 0x875d; break; + case 0xfa56: ret = 0x81ad; break; + case 0xfa57: ret = 0x81ae; break; + case 0xfa58: ret = 0x878a; break; + case 0xfa59: ret = 0x8782; break; + case 0xfa5a: ret = 0x8784; break; + case 0xfa5b: ret = 0x81e6; break; + case 0xfa5c: ret = 0xedb5; break; + case 0xfa5d: ret = 0xee8e; break; + case 0xfa5e: ret = 0xef58; break; + case 0xfa5f: ret = 0xef4d; break; + case 0xfa60: ret = 0xf8d3; break; + case 0xfa61: ret = 0x87b7; break; + case 0xfa62: ret = 0xf580; break; + case 0xfa63: ret = 0xeb54; break; + case 0xfa64: ret = 0xeb89; break; + case 0xfa65: ret = 0xfb42; break; + case 0xfa66: ret = 0xeb56; break; + case 0xfa67: ret = 0xeab8; break; + case 0xfa68: ret = 0x87a2; break; + case 0xfa69: ret = 0x87a6; break; + case 0xfa6b: ret = 0xf05e; break; + case 0xfa6c: ret = 0x87a9; break; + case 0xfa6e: ret = 0x87ae; break; + case 0xfa6f: ret = 0xf06c; break; + case 0xfa70: ret = 0x87b3; break; + case 0xfa71: ret = 0xf06d; break; + case 0xfa72: ret = 0x87b4; break; + case 0xfa74: ret = 0x87bf; break; + case 0xfa75: ret = 0xf07c; break; + case 0xfa77: ret = 0xf07b; break; + case 0xfa78: ret = 0xf080; break; + case 0xfa79: ret = 0xf087; break; + case 0xfa7a: ret = 0xf07e; break; + case 0xfa7b: ret = 0x87c2; break; + case 0xfa7e: ret = 0x87cd; break; + case 0xfa81: ret = 0x87d2; break; + case 0xfa84: ret = 0x87db; break; + case 0xfa86: ret = 0xf162; break; + case 0xfa88: ret = 0x87e5; break; + case 0xfa89: ret = 0x87e9; break; + case 0xfa8a: ret = 0x87ea; break; + case 0xfa8b: ret = 0xf16d; break; + case 0xfa8d: ret = 0x87f0; break; + case 0xfa8e: ret = 0x87f2; break; + case 0xfa91: ret = 0x87f6; break; + case 0xfa92: ret = 0xf18c; break; + case 0xfa93: ret = 0x8840; break; + case 0xfa94: ret = 0x8842; break; + case 0xfa95: ret = 0x8849; break; + case 0xfa98: ret = 0xf1ea; break; + case 0xfa99: ret = 0x886e; break; + case 0xfa9a: ret = 0x886d; break; + case 0xfa9b: ret = 0x886a; break; + case 0xfa9c: ret = 0x8876; break; + case 0xfa9d: ret = 0x887c; break; + case 0xfa9f: ret = 0xf259; break; + case 0xfaa1: ret = 0xf264; break; + case 0xfaa2: ret = 0x8889; break; + case 0xfaa4: ret = 0x888d; break; + case 0xfaa6: ret = 0x9875; break; + case 0xfaa7: ret = 0xf0a2; break; + case 0xfaa8: ret = 0xecc7; break; + case 0xfaa9: ret = 0x9878; break; + case 0xfaaa: ret = 0x9879; break; + case 0xfaab: ret = 0x987b; break; + case 0xfaac: ret = 0xf0c1; break; + case 0xfaad: ret = 0x9889; break; + case 0xfaaf: ret = 0x9891; break; + case 0xfab0: ret = 0x9895; break; + case 0xfab1: ret = 0x9892; break; + case 0xfab2: ret = 0xf0d3; break; + case 0xfab3: ret = 0x9897; break; + case 0xfab4: ret = 0x989c; break; + case 0xfab5: ret = 0xf0e5; break; + case 0xfab8: ret = 0xeab4; break; + case 0xfab9: ret = 0xeabc; break; + case 0xfaba: ret = 0xeac3; break; + case 0xfabb: ret = 0xeac5; break; + case 0xfabe: ret = 0xf2cb; break; + case 0xfac0: ret = 0xead3; break; + case 0xfac2: ret = 0xf2d6; break; + case 0xfac4: ret = 0xead9; break; + case 0xfac5: ret = 0xead8; break; + case 0xfac6: ret = 0xf2e7; break; + case 0xfac8: ret = 0xf341; break; + case 0xfac9: ret = 0xeaf2; break; + case 0xfaca: ret = 0xeaf8; break; + case 0xfacb: ret = 0xf36f; break; + case 0xfacc: ret = 0xeafa; break; + case 0xface: ret = 0xeb4b; break; + case 0xfacf: ret = 0xeb4d; break; + case 0xfad1: ret = 0xeb4c; break; + case 0xfad3: ret = 0xeb4e; break; + case 0xfad4: ret = 0xeb51; break; + case 0xfad5: ret = 0xeb5d; break; + case 0xfad6: ret = 0xf39e; break; + case 0xfad7: ret = 0xeb5a; break; + case 0xfad9: ret = 0xeb5e; break; + case 0xfada: ret = 0xf3ab; break; + case 0xfadb: ret = 0xeb63; break; + case 0xfadc: ret = 0xeb64; break; + case 0xfadd: ret = 0xf3b1; break; + case 0xfade: ret = 0xeb6b; break; + case 0xfae0: ret = 0xeb6d; break; + case 0xfae1: ret = 0xeb6f; break; + case 0xfae2: ret = 0xeb77; break; + case 0xfae3: ret = 0xeb7d; break; + case 0xfae4: ret = 0xeb79; break; + case 0xfae5: ret = 0xeb7c; break; + case 0xfae6: ret = 0xf3dd; break; + case 0xfae7: ret = 0xf3fb; break; + case 0xfae8: ret = 0xf3f7; break; + case 0xfae9: ret = 0xeb98; break; + case 0xfaea: ret = 0xeb9a; break; + case 0xfaeb: ret = 0xf455; break; + case 0xfaec: ret = 0xeba0; break; + case 0xfaed: ret = 0xf460; break; + case 0xfaee: ret = 0xebae; break; + case 0xfaef: ret = 0xf472; break; + case 0xfaf0: ret = 0xebaf; break; + case 0xfaf1: ret = 0xf479; break; + case 0xfaf3: ret = 0xebb6; break; + case 0xfaf4: ret = 0xebc9; break; + case 0xfaf5: ret = 0xf4b3; break; + case 0xfaf6: ret = 0xebd0; break; + case 0xfaf7: ret = 0xebd5; break; + case 0xfaf9: ret = 0xf4c2; break; + case 0xfafa: ret = 0xebdf; break; + case 0xfafb: ret = 0xebe9; break; + case 0xfb41: ret = 0xebed; break; + case 0xfb42: ret = 0xf4e6; break; + case 0xfb45: ret = 0xebf4; break; + case 0xfb47: ret = 0xebf8; break; + case 0xfb48: ret = 0xf4ee; break; + case 0xfb49: ret = 0xf4f1; break; + case 0xfb4a: ret = 0xf543; break; + case 0xfb4b: ret = 0xec4e; break; + case 0xfb4c: ret = 0xf560; break; + case 0xfb4d: ret = 0xec5a; break; + case 0xfb4e: ret = 0xec5b; break; + case 0xfb4f: ret = 0xf569; break; + case 0xfb50: ret = 0xec5d; break; + case 0xfb51: ret = 0xec64; break; + case 0xfb52: ret = 0xec66; break; + case 0xfb53: ret = 0xec6b; break; + case 0xfb54: ret = 0xf58b; break; + case 0xfb55: ret = 0xec76; break; + case 0xfb56: ret = 0xec71; break; + case 0xfb57: ret = 0xec72; break; + case 0xfb58: ret = 0xec79; break; + case 0xfb59: ret = 0xec7d; break; + case 0xfb5a: ret = 0xec81; break; + case 0xfb5b: ret = 0xf5bb; break; + case 0xfb5c: ret = 0xec89; break; + case 0xfb5e: ret = 0xec8f; break; + case 0xfb5f: ret = 0xf5d5; break; + case 0xfb61: ret = 0xec99; break; + case 0xfb62: ret = 0xec9b; break; + case 0xfb63: ret = 0xec9d; break; + case 0xfb65: ret = 0xec9f; break; + case 0xfb67: ret = 0xeca4; break; + case 0xfb68: ret = 0xeca6; break; + case 0xfb6a: ret = 0xeca9; break; + case 0xfb6b: ret = 0xecb1; break; + case 0xfb6c: ret = 0xecb6; break; + case 0xfb6d: ret = 0xecb9; break; + case 0xfb6e: ret = 0xecc5; break; + case 0xfb6f: ret = 0xecc8; break; + case 0xfb71: ret = 0xf68f; break; + case 0xfb72: ret = 0xece1; break; + case 0xfb73: ret = 0xecdf; break; + case 0xfb74: ret = 0xece2; break; + case 0xfb76: ret = 0xecf0; break; + case 0xfb77: ret = 0xf163; break; + case 0xfb78: ret = 0xf6c1; break; + case 0xfb79: ret = 0xed41; break; + case 0xfb7a: ret = 0xf6c4; break; + case 0xfb7c: ret = 0xf6dc; break; + case 0xfb7e: ret = 0xed5b; break; + case 0xfb80: ret = 0xed5c; break; + case 0xfb81: ret = 0xf6e5; break; + case 0xfb82: ret = 0xed60; break; + case 0xfb83: ret = 0xf6e8; break; + case 0xfb84: ret = 0xf758; break; + case 0xfb85: ret = 0xf759; break; + case 0xfb87: ret = 0xed77; break; + case 0xfb88: ret = 0xed83; break; + case 0xfb8a: ret = 0xeda0; break; + case 0xfb8b: ret = 0xeda2; break; + case 0xfb8c: ret = 0xf7c5; break; + case 0xfb8d: ret = 0xeda6; break; + case 0xfb8e: ret = 0xedaa; break; + case 0xfb8f: ret = 0xedb3; break; + case 0xfb90: ret = 0xedb7; break; + case 0xfb93: ret = 0xedea; break; + case 0xfb94: ret = 0xedeb; break; + case 0xfb95: ret = 0xf8b1; break; + case 0xfb96: ret = 0xedfb; break; + case 0xfb98: ret = 0xee47; break; + case 0xfb99: ret = 0xee4e; break; + case 0xfb9a: ret = 0xf8ef; break; + case 0xfb9b: ret = 0xee57; break; + case 0xfb9d: ret = 0xee59; break; + case 0xfb9e: ret = 0xee5f; break; + case 0xfb9f: ret = 0xf957; break; + case 0xfba0: ret = 0xf964; break; + case 0xfba2: ret = 0xee8d; break; + case 0xfba3: ret = 0xee9d; break; + case 0xfba4: ret = 0xeea0; break; + case 0xfba5: ret = 0xeea6; break; + case 0xfba6: ret = 0xeea7; break; + case 0xfba7: ret = 0xf9de; break; + case 0xfba8: ret = 0xeea9; break; + case 0xfba9: ret = 0xeeac; break; + case 0xfbaa: ret = 0xeeab; break; + case 0xfbac: ret = 0xf9ed; break; + case 0xfbad: ret = 0xfa4f; break; + case 0xfbae: ret = 0xeeb8; break; + case 0xfbaf: ret = 0xeebc; break; + case 0xfbb3: ret = 0xfa8e; break; + case 0xfbb6: ret = 0xeee5; break; + case 0xfbb7: ret = 0xeee8; break; + case 0xfbb8: ret = 0xeeea; break; + case 0xfbb9: ret = 0xeeee; break; + case 0xfbba: ret = 0xfacc; break; + case 0xfbbb: ret = 0xeefa; break; + case 0xfbbd: ret = 0xef41; break; + case 0xfbbe: ret = 0xfad0; break; + case 0xfbbf: ret = 0xeefc; break; + case 0xfbc0: ret = 0xef40; break; + case 0xfbc2: ret = 0xef44; break; + case 0xfbc3: ret = 0xfad2; break; + case 0xfbc4: ret = 0xef47; break; + case 0xfbc5: ret = 0xef49; break; + case 0xfbc6: ret = 0xef48; break; + case 0xfbc7: ret = 0xfada; break; + case 0xfbc8: ret = 0xfadd; break; + case 0xfbc9: ret = 0xfadb; break; + case 0xfbca: ret = 0xef46; break; + case 0xfbcb: ret = 0xfae1; break; + case 0xfbcc: ret = 0xfaed; break; + case 0xfbce: ret = 0xef4c; break; + case 0xfbcf: ret = 0xfafa; break; + case 0xfbd0: ret = 0xfaf7; break; + case 0xfbd1: ret = 0xfaf8; break; + case 0xfbd2: ret = 0xfaf6; break; + case 0xfbd5: ret = 0xef52; break; + case 0xfbd6: ret = 0xef51; break; + case 0xfbd7: ret = 0xef57; break; + case 0xfbd8: ret = 0xef56; break; + case 0xfbd9: ret = 0xfb43; break; + case 0xfbdb: ret = 0xfb48; break; + case 0xfbdc: ret = 0xef53; break; + case 0xfbdd: ret = 0xfb47; break; + case 0xfbde: ret = 0xfb44; break; + case 0xfbdf: ret = 0xef5e; break; + case 0xfbe0: ret = 0xfb4f; break; + case 0xfbe2: ret = 0xef62; break; + case 0xfbe3: ret = 0xef63; break; + case 0xfbe6: ret = 0xfb6c; break; + case 0xfbe9: ret = 0xef7c; break; + case 0xfbeb: ret = 0xef7d; break; + case 0xfbec: ret = 0xfb8c; break; + case 0xfbed: ret = 0xef86; break; + case 0xfbee: ret = 0xef87; break; + case 0xfbf0: ret = 0xef88; break; + case 0xfbf1: ret = 0xef8a; break; + case 0xfbf3: ret = 0xfb9c; break; + case 0xfbf4: ret = 0xef9f; break; + case 0xfbf5: ret = 0xefa3; break; + case 0xfbfa: ret = 0xefa9; break; + case 0xfbfb: ret = 0xefb1; break; + case 0xfc40: ret = 0xfc51; break; + case 0xfc41: ret = 0xefc2; break; + case 0xfc42: ret = 0xefc1; break; + case 0xfc43: ret = 0xefc5; break; + case 0xfc44: ret = 0xfc69; break; + case 0xfc46: ret = 0xefcd; break; + case 0xfc47: ret = 0xefdc; break; + case 0xfc48: ret = 0xfcb2; break; + case 0xfc4a: ret = 0xfccd; break; + case 0xfc4b: ret = 0xeff0; break; + default: ret = code; break; + } + + return ret; +} diff --git a/src/cursor.c b/src/cursor.c new file mode 100644 index 0000000..5e03638 --- /dev/null +++ b/src/cursor.c @@ -0,0 +1,386 @@ +/* + * cursor.c カーソル処理(general) + * + * Copyright (C) 2000- TAJIRI Yasuhiro + * + * 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 + * +*/ +/* $Id: cursor.c,v 1.6 2001/04/04 21:55:39 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "cursor.h" +#include "LittleEndian.h" +#include "ald_manager.h" +#include "graphicsdevice.h" + +static CursorHeader cursorHeader; +static TCursorDirEntry cursordirentry; +static CursorImage cursorImage; +static AnimationCursorHeader anicurHeader; +static AniCursorImage anicurImage; + +typedef struct RIFFchunk { + int size; + char *data; +} RIFFchunk_t; + +static boolean search_chunk(BYTE *src, char *key1, char *key2, RIFFchunk_t *c) { + if (0 == strncmp(src, key1, 4)) { + c->size = LittleEndian_getW(src, 4); + if (key2) { + if (0 == strncmp(src+8, key2, 4)) { + c->data = src + 12; + return TRUE; + } + return FALSE; + } + c->data = src + 8; + return TRUE; + } + return FALSE; +} + +static boolean is_riff(BYTE *data) { + if (0 == strncmp(data, "RIFF", 4)) { + return TRUE; + } + return FALSE; +} + +static boolean check_iconheader(BYTE *data) { + + /* read Reserved bit, abort if not 0 */ + cursorHeader.idReserved = LittleEndian_getW(data, 0); + if (cursorHeader.idReserved != 0) { + return FALSE; + } + + data += 2; + + /* read Resource Type, 2 is for cursors, abort if different */ + cursorHeader.idType = LittleEndian_getW(data, 0); + if (cursorHeader.idType != 2) { + return FALSE; + } + + data += 2; + + /* read Number of images, abort if invalid value (0) */ + cursorHeader.idCount = LittleEndian_getW(data, 0); + + data += 2; + + /* Number of images (>0) */ + if (cursorHeader.idCount == 0) { + WARNING("Cursor: no images in file!\n"); + return FALSE; + } + + if (cursorHeader.idCount > 1) { + WARNING("Cursor: warning: too much images in file!\n"); + } + return TRUE; +} + +static int read_direntries(BYTE* data) { + BYTE *p = data; + + /* read Width, in pixels */ + cursordirentry.bWidth = *data; + data++; + + /* read Height, in pixels */ + cursordirentry.bHeight = *data; + data++; + + /* and validate data */ + NOTICE("Cursor: bWidth==%d bHeight==%d\n", + (int)cursordirentry.bWidth, + (int)cursordirentry.bHeight); + + if (cursordirentry.bWidth == 0 || cursordirentry.bHeight == 0) { + return -1; + } + + /* Bits per pixel, not used, 0 */ + cursordirentry.dwBytesInRes = LittleEndian_getW(data, 0); + data += 2; + + cursordirentry.wxHotspot = LittleEndian_getW(data, 0); + data += 2; + + cursordirentry.wyHotspot = LittleEndian_getW(data, 0); + data += 2; + + /* size of image data, in bytes */ + cursordirentry.dwBytesInRes = LittleEndian_getDW(data, 0); + data += 4; + + /* size of image data, in bytes */ + cursordirentry.dwImageOffset = LittleEndian_getDW(data, 0); + data += 4; + + if (cursordirentry.dwImageOffset == 0) { + return 0; + } + + NOTICE("Cursor: x==%d y==%d\n", + (int)cursordirentry.wxHotspot, + (int)cursordirentry.wyHotspot); + + + NOTICE("Width: %d\n", (int)(cursordirentry.bWidth)); + NOTICE("Height: %d\n", (int)(cursordirentry.bHeight)); + NOTICE("Bit Count (unused): %d\n", (int)(cursordirentry.dwBytesInRes)); + NOTICE("Total bytes: %ld\n", (long)(cursordirentry.dwBytesInRes)); + + return (int)(data - p); +} + +static int read_bitmapinfo(BYTE* data) { + BYTE* p = data; + +#define ih cursorImage.icHeader + /* read bitmap info an perform some primitive sanity checks */ + + /* sizeof(TBitmapInfoHeader) */ + ih.biSize = LittleEndian_getDW(data, 0); + data += 4; + + /* width of bitmap */ + ih.biWidth = LittleEndian_getDW(data, 0); + data += 4; + + /* height of bitmap, see notes (icon.h) */ + ih.biHeight=LittleEndian_getDW(data,0); + data += 4; + + NOTICE("Cursor: biWidth==%d biHeight==%d\n", (int)ih.biWidth, (int)ih.biHeight); + + if (ih.biWidth == 0 || ih.biHeight == 0) { + return 0; + } + + /* planes, always 1 */ + ih.biPlanes = LittleEndian_getW(data, 0); + data += 2; + + /* number of color bits (2,4,8) */ + ih.biBitCount = LittleEndian_getW(data, 0); + if (ih.biBitCount != 1) { + WARNING("Cursor: %d not supported color bit\n", ih.biBitCount); + return 0; + } + data += 2; + + /* compression used, 0 */ + ih.biCompression = LittleEndian_getDW(data, 0); + data += 4; + + if (ih.biCompression != 0) { + WARNING("Cursor: invalid compression value of %d\n", (int)ih.biCompression); + return 0; + } + + /* size of the pixel data, see icon.h */ + ih.biSizeImage = LittleEndian_getDW(data, 0); + data += 4; + + NOTICE("Cursor: biSizeImage==%d\n", (int)ih.biSizeImage); + + ih.biXPelsPerMeter = LittleEndian_getDW(data, 0); + data += 4; + + /* not used, 0 */ + ih.biYPelsPerMeter = LittleEndian_getDW(data, 0); + data += 4; + + /* # of colors used, set to 0 */ + ih.biClrUsed = LittleEndian_getDW(data, 0); + data += 4; + + /* important colors, set to 0 */ + ih.biClrImportant = LittleEndian_getDW(data, 0); + data += 4; + +#undef ih + + return (int)(data - p); +} + +static int read_rgbquad(BYTE* data) { + int j; + int colors=2; + BYTE* p = data; + + cursorImage.icColors = g_new(TRGBQuad, colors); + + if (cursorImage.icColors == NULL) { /* shouldn't happen */ + NOMEMERR(); + } + +#define cc cursorImage.icColors + + for (j = 0; j < colors; j++) { + cc[j].rgbBlue = *data; + data++; + cc[j].rgbGreen = *data; + data++; + cc[j].rgbRed = *data; + data++; + cc[j].rgbReserved = *data; + data++; + NOTICE("#%d: Red: %d Green: %d Blue: %d\n", j, + cc[j].rgbRed, + cc[j].rgbGreen, + cc[j].rgbBlue); + } + +#undef cc + return (int)(data - p); +} + +static boolean cursor_load_mono(BYTE *d, int no) { + int pos = 6, p1; + + /* check header information */ + if (check_iconheader(d) == FALSE) { + WARNING("check_iconhdader fail\n"); + return FALSE; + } + + /* read dentries */ + if ((pos += read_direntries(d + pos)) <= 6) { + WARNING("read dentries fail\n"); + return FALSE; + } + + /* read bitmap info */ + p1 = read_bitmapinfo(d + pos); + if (p1 == 0) { + WARNING("unable to read bitmap info\n"); + return FALSE; + } + + pos += p1; + + /* read rgb quad */ + p1 = read_rgbquad(d + pos); + if (p1 == 0) { + WARNING("unable to read palette table\n"); + return FALSE; + } + + pos += p1; + + /* read pixedl data */ + if (CursorNew(d + pos, no, &cursorImage, &cursordirentry) == FALSE) { + WARNING("unable to read pixel data\n"); + return FALSE; + } + return TRUE; +} + +static boolean cursor_load_anim(BYTE *data, int no) { + BYTE *b = data; + int riffsize; + RIFFchunk_t c; + + if (!search_chunk(b, "RIFF", "ACON", &c)) { + WARNING("Not animation icon format"); + return FALSE; + } + + riffsize = c.size; + // printf("size = %d\n", c.size); + b = c.data; + + while (b < (data + riffsize)) { + if (search_chunk(b, "LIST", "INFO", &c)) { + NOTICE("LIST(INFO) ignore size = %d\n", c.size); + b += c.size + 8; + } else if (search_chunk(b, "anih", NULL, &c)) { + BYTE *src = c.data; + NOTICE("anih size = %d\n", c.size); + anicurHeader.cbSizeof = LittleEndian_getW(src, 0); + anicurHeader.cFrames = LittleEndian_getW(src, 4); + anicurHeader.cSteps = LittleEndian_getW(src, 8); + anicurHeader.cx = LittleEndian_getW(src, 12); + anicurHeader.cy = LittleEndian_getW(src, 16); + anicurHeader.cBitCount = LittleEndian_getW(src, 20); + anicurHeader.cPlanes = LittleEndian_getW(src, 24); + anicurHeader.jiffRate = LittleEndian_getW(src, 28); + anicurHeader.fl = LittleEndian_getW(src, 32); + + anicurImage.header = &anicurHeader; + + b += c.size + 8; + } else if (search_chunk(b, "rate", NULL, &c)) { + BYTE *src = c.data; + NOTICE("rate size = %d\n", c.size); + if (anicurHeader.fl & 0x01) { + int i; + anicurHeader.rate = g_new(int, anicurHeader.cSteps); + for (i = 0; i < anicurHeader.cSteps; i++) { + anicurHeader.rate[i] = LittleEndian_getW(src, i*4); + // printf("rate %d, %d\n", i, anicurHeader.rate[i]); + } + } + b += c.size + 8; + } else if (search_chunk(b, "icon", NULL, &c)) { + NOTICE("icon size = %d\n", c.size); + cursor_load_mono(c.data, no); /* last pattern is uesd */ + b += c.size + 8; + } else if (search_chunk(b, "LIST", "frame", &c)) { + NOTICE("LIST(frame) size = %d\n", c.size); + b += 12; + } else { + WARNING("UnKnown chunk"); + b += c.size + 8; + } + } + return TRUE; +} + +void cursor_load(int no, int linkno) { + dridata *dfile; + + /* no must be from 100 to 255 */ + if (no < 100 || no > 256){ + WARNING("wrong cursor number(%d)\n", no); + } + + /* load data */ + if (NULL == (dfile = ald_getdata(DRIFILE_RSC, linkno -1))) { + WARNING("ald_getdata fail\n"); + return; + } + + if (is_riff(dfile->data)) { + cursor_load_anim(dfile->data, no); + } else { + cursor_load_mono(dfile->data, no); + } + + ald_freedata(dfile); + + return; +} diff --git a/src/cursor.h b/src/cursor.h new file mode 100644 index 0000000..7e4fb22 --- /dev/null +++ b/src/cursor.h @@ -0,0 +1,106 @@ +/* + * cursor.h カーソル処理(general) + * + * Copyright (C) 2000- TAJIRI Yasuhiro + * + * 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 + * +*/ +/* $Id: cursor.h,v 1.3 2001/03/30 19:16:38 chikama Exp $ */ + +#ifndef __CURSOR_H__ +#define __CURSOR_H__ + +#define BitSet(byte, bit) (((byte) & (bit)) == (bit)) + +typedef struct { + short idReserved; /* always set to 0 */ + short idType; /* always set to 1 */ + short idCount; /* number of cursor images,always set to 1 */ + /* immediately followed by idCount TCursorDirEntries */ +} CursorHeader; + +typedef struct { + unsigned char bWidth; /* Width */ + unsigned char bHeight; /* Height */ + unsigned char bColorCount; + unsigned char bReserved; + unsigned short wxHotspot; + unsigned short wyHotspot; + unsigned long dwBytesInRes; /* total number of bytes in image */ + unsigned long dwImageOffset; +} TCursorDirEntry; + +typedef struct { + long biSize; /* sizeof(TBitmapInfoHeader) */ + long biWidth; /* width of bitmap */ + long biHeight; /* height of bitmap, see notes */ + short biPlanes; /* planes, always 1 */ + short biBitCount; /* number of color bits */ + long biCompression; /* compression used, 0 */ + long biSizeImage; /* size of the pixel data, see notes */ + long biXPelsPerMeter; /* not used, 0 */ + long biYPelsPerMeter; /* not used, 0 */ + long biClrUsed; /* # of colors used, set to 0 */ + long biClrImportant; /* important colors, set to 0 */ + short hotX; + short hotY; +} TBitmapInfoHeader; + +/* + biHeight=2*TIconDirEntry.bHeight; + biSizeImage=ANDmask + XORmask; + + XORmask=(TIconDirEntry.bWidth * TIconDirEntry.bHeight * biBitCount)/8; + ANDmask=(TIconDirEntry.bWidth * TIconDirEntry.bHeight)/8; + */ + +typedef struct { + unsigned char rgbBlue; /* blue component of color */ + unsigned char rgbGreen; /* green component of color */ + unsigned char rgbRed; /* red component of color */ + unsigned char rgbReserved; /* reserved, 0 */ +} TRGBQuad; + +typedef struct { + TBitmapInfoHeader icHeader; /* image header info */ + TRGBQuad *icColors; /* image palette */ + int xormasklen; + int andmasklen; +} CursorImage; + +typedef struct { + int cbSizeof; + int cFrames; + int cSteps; + int cx; + int cy; + int cBitCount; + int cPlanes; + int jiffRate; + int fl; + + int *rate; + int *seq; +} AnimationCursorHeader ; + +typedef struct { + AnimationCursorHeader *header; + CursorImage *images; +} AniCursorImage; + +extern void cursor_load(int no, int linkno); + +#endif /* __CURSOR_H__ */ diff --git a/src/dri.c b/src/dri.c new file mode 100644 index 0000000..7e0f8ec --- /dev/null +++ b/src/dri.c @@ -0,0 +1,276 @@ +/* + * dri.c: dri loader + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: dri.c,v 1.21 2004/10/31 04:18:06 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "portab.h" +#include "system.h" +#include "LittleEndian.h" +#include "dri.h" + +/* + * static maethods +*/ +static long getfilesize(FILE *fp); +static boolean filecheck (FILE *fp); +static void get_filemap(drifiles *d, FILE *fp); +static void get_fileptr(drifiles *d, FILE *fp, int disk); + +/* + * Get file size of FILE + * fp: FILE pointer + * return: filesize in byte +*/ +static long getfilesize(FILE *fp) { + fseek(fp, 0L, SEEK_END); + return ftell(fp); +} + +/* + * Check whether dri file type or not + * fp: FILE pointer + * return: TRUE if it's dri file +*/ +static boolean filecheck (FILE *fp) { + BYTE b[6]; + int mapsize, ptrsize; + long filesize; + + /* get filesize / 256 */ + filesize = (getfilesize(fp) + 255) >> 8; + + /* read top 6bytes */ + fseek(fp, 0L, SEEK_SET); + fread(b, 1, 6, fp); + + /* get ptrsize and mapsize */ + ptrsize = LittleEndian_get3B(b, 0); + mapsize = LittleEndian_get3B(b, 3) - ptrsize; + + /* must lager than 0 */ + if (ptrsize < 0 || mapsize < 0) return FALSE; + + /* must smaller than filesize */ + if (ptrsize > (int)filesize || mapsize > (int)filesize ) { + return FALSE; + } + + return TRUE; +} + +/* + * Get file map + * d : drifile object + * fp: FILE object +*/ +static void get_filemap(drifiles *d, FILE *fp) { + BYTE b[6], *_b; + int mapsize, ptrsize, i; + + /* read top 6bytes */ + fseek(fp, 0L, SEEK_SET); + fread(b, 1, 6, fp); + + /* get ptrsize and mapsize */ + ptrsize = LittleEndian_get3B(b, 0); + mapsize = LittleEndian_get3B(b, 3) - ptrsize; + + /* allocate read buffer */ + _b = g_new(char, mapsize << 8); + + /* read filemap */ + fseek(fp, ptrsize << 8L , SEEK_SET); + fread(_b, 256, mapsize, fp); + + /* get max file number from mapdata */ + d->maxfile = (mapsize << 8) / 3; + + /* map of disk */ + d->map_disk = g_new(char , d->maxfile); + /* map of data in disk */ + d->map_ptr = g_new(short, d->maxfile); + + for (i = 0; i < d->maxfile; i++) { + /* map_disk[?] and map_ptr[?] are from 0 */ + *(d->map_disk + i) = _b[i * 3] - 1; + *(d->map_ptr + i) = LittleEndian_getW(_b, i * 3 + 1) - 1; + } + + g_free(_b); + return; +} + +/* + * Get data pointer in file + * d : drifile object + * fp : FILE object + * disk: no in drifile object +*/ +static void get_fileptr(drifiles *d, FILE *fp, int disk) { + char b[6], *_b; + int ptrsize, filecnt, i; + + /* read top 6bytes */ + fseek(fp, 0L, SEEK_SET); + fread(b, 1, 6, fp); + + /* get pinter size */ + ptrsize = LittleEndian_get3B(b,0); + + /* estimate file number in file */ + filecnt = (ptrsize << 8) / 3; + + /* allocate read buffer */ + _b = g_new(char, ptrsize << 8); + + /* read pointers */ + fseek(fp, 0L, SEEK_SET); + fread(_b, 256, ptrsize, fp); + + /* allocate pointers buffer */ + d->fileptr[disk] = g_new0(int, filecnt); + + /* store pointers */ + for (i = 0; i < filecnt; i++) { + *(d->fileptr[disk] + i) = (LittleEndian_get3B(_b, i * 3 + 3) << 8); + } + + g_free(_b); + return; +} + +/* + * Initilize drifile object and check file + * file : file name array + * cnt : number in file name array + * mmapping: mmap file or not + * return: drifile object +*/ +drifiles *dri_init(char **file, int cnt, boolean mmapping) { + drifiles *d = g_new0(drifiles, 1); + FILE *fp; + int i; + boolean gotmap = FALSE; + long filesize; + char **filetop = file; + + for (i = 0; i < cnt; i++) { + if (*(file + i) == NULL) continue; + /* open check */ + if (NULL == (fp = fopen(*(file + i), "r"))) { + SYSERROR("File %s is not found\n", *(file + i)); + } + /* check is drifile or noe */ + if (!filecheck(fp)) { + SYSERROR("File %s is not dri file\n", *(file + i)); + } + /* get file map */ + if (!gotmap) { + get_filemap(d, fp); + gotmap = TRUE; + } + /* get pointer */ + get_fileptr(d, fp, i); + /* get file size for mmap */ + filesize = getfilesize(fp); + /* copy filenme */ + d->fnames[i] = strdup(*(file + i)); + /* close */ + fclose(fp); + /* mmap */ + if (mmapping) { + int fd; + if (0 > (fd = open(*(file + i), O_RDONLY))) { + SYSERROR("open: %s\n", strerror(errno)); + } + if (MAP_FAILED == (d->mmapadr[i] = mmap(0, filesize, PROT_READ, MAP_SHARED, fd, 0))) { + WARNING("mmap: %s\n", strerror(errno)); + close(fd); + mmapping = d->mmapped = FALSE; + i = 0; file = filetop; /* retry */ + continue; + } + d->mmapped = TRUE; + } + } + return d; +} + +/* + * Get data + * d : drifile object + * no: drifile no ( >= 0 ) + * return: dridata obhect + */ +dridata *dri_getdata(drifiles *d, int no) { + BYTE *data; + dridata *dfile; + int disk, ptr, dataptr, dataptr2, size; + + /* check no is lager than files which contains */ + if (no > d->maxfile) return NULL; + + /* check disk & ptr are negative, if negative, file does not exist */ + disk = d->map_disk[no]; + ptr = d->map_ptr[no]; + if (disk < 0 || ptr < 0) return NULL; + + /* no file registered */ + if (d->fileptr[disk] == NULL) return NULL; + + /* get pointer in file and size */ + dataptr = *(d->fileptr[disk] + ptr); + dataptr2 = *(d->fileptr[disk] + ptr + 1); + if (dataptr == 0 || dataptr2 == 0) return NULL; + + /* get data top */ + if (d->mmapped) { + data = d->mmapadr[disk] + dataptr; + } else { + int readsize = dataptr2 - dataptr; + FILE *fp; + data = g_new(char, readsize); + fp = fopen(d->fnames[disk], "r"); + fseek(fp, dataptr, SEEK_SET); + fread(data, 1, readsize, fp); + fclose(fp); + } + + /* get real data and size */ + ptr = LittleEndian_getDW(data, 0); + size = LittleEndian_getDW(data, 4); + + dfile = g_new0(dridata, 1); + dfile->data_raw = data; /* dri data header */ + dfile->data = data + ptr; /* real data */ + dfile->size = size; + dfile->a = d; /* archive file */ + return dfile; +} diff --git a/src/dri.h b/src/dri.h new file mode 100644 index 0000000..9160b21 --- /dev/null +++ b/src/dri.h @@ -0,0 +1,61 @@ +/* + * dri.h: dri loader + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: dri.h,v 1.8 2001/04/02 21:00:44 chikama Exp $ */ + +#ifndef __DRI__ +#define __DRI__ + +#include "portab.h" + +#define DRIFILEMAX 255 /* maximum file number for one data type */ +#define DRIDATAMAX 65535 /* maximum file number in one file */ + +struct _drifiles { + /* for mmap */ + boolean mmapped; + void *mmapadr[DRIFILEMAX]; + /* for file access */ + char *fnames[DRIFILEMAX]; + /* max file number in files */ + int maxfile; + /* file mapping */ + char *map_disk; + short *map_ptr; + /* pointers in file */ + int *fileptr[DRIFILEMAX]; +}; +typedef struct _drifiles drifiles; + +struct _dridata { + int size; /* size of real data */ + char *data_raw; /* dri header pointer */ + char *data; /* real data */ + char *name; /* not used */ + boolean in_use; /* dont remove from cache if TRUE */ + drifiles *a; /* archive file obj */ +}; +typedef struct _dridata dridata; + +extern drifiles *dri_init(char **file, int cnt, boolean mmapping); +extern dridata *dri_getdata(drifiles *d, int no); + +#endif /* !__DRI__ */ diff --git a/src/ecopy.c b/src/ecopy.c new file mode 100644 index 0000000..e5c6ff0 --- /dev/null +++ b/src/ecopy.c @@ -0,0 +1,1545 @@ +/* + * ecopy.c copyarea with effect + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: ecopy.c,v 1.20 2001/08/11 20:05:55 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "imput.h" +#include "ags.h" +#include "system.h" +#include "nact.h" +#include "counter.h" + +/* saved parameter */ +struct ecopyparam { + int sx; + int sy; + int w; + int h; + int dx; + int dy; + int sw; + int opt; + boolean cancel; + int spCol; + int extp[10]; +}; +typedef struct ecopyparam ecopyparam_t; +static ecopyparam_t ecp; + +#define EC_WAIT \ + if ((key |= sys_getInputInfo()) && ecp.cancel) break; \ + key = sys_keywait(cnt - get_ecounter(), ecp.cancel); + + +static int get_ecounter(void) { + return get_high_counter(SYSTEMCOUNTER_MSEC); +} + +static void eCopyUpdateArea(int sx, int sy, int w, int h, int dx, int dy) { + MyRectangle src; + MyPoint dst; + + src.x = sx; + src.y = sy; + src.width = w; + src.height = h; + dst.x = dx - nact->sys_view_area.x; + dst.y = dy - nact->sys_view_area.y; + + UpdateArea(&src, &dst); +} + +static int eCopyArea1(int dx, int dy, int w, int h, int opt) { + int y, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + + cnt = get_ecounter(); + for (y = 0; y < h - 24; y += 24) { + cnt += waitcnt; + eCopyUpdateArea(dx, dy + h - y, w, y, dx, dy); + EC_WAIT; + } + + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea2(int dx, int dy, int w, int h, int opt) { + int y, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + + cnt = get_ecounter(); + for (y = 0; y < h - 24; y += 24) { + cnt += waitcnt; + eCopyUpdateArea(dx, dy , w, y, dx, dy + h - y); + EC_WAIT; + } + + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea3(int dx, int dy, int w, int h, int opt) { + int y1, y2, key = 0, cnt; + int waitcnt = opt == 0 ? 3 : opt; + + if (h % 2) { + h--; + eCopyUpdateArea(dx , dy + h, w, 1, dx, dy + h); + } + y1 = dy; + y2 = dy + h - 1; + cnt = get_ecounter(); + while (h > 0) { + cnt += waitcnt; + eCopyUpdateArea(dx, y1, w, 1, dx, y1); + eCopyUpdateArea(dx, y2, w, 1, dx, y2); + y1 += 2; + y2 -= 2; + h -= 2; + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea4(int dx, int dy, int w, int h, int opt) { + int x1,x2, key = 0, cnt; + int waitcnt = opt == 0 ? 3 : opt; + + if (w % 2) { + w--; + eCopyUpdateArea(dx + w , dy, 1, h, dx + w, dy); + } + x1 = dx; + x2 = dx + w - 1; + cnt = get_ecounter(); + while (w > 0) { + cnt += waitcnt; + eCopyUpdateArea(x1, dy, 1, h, x1, dy); + eCopyUpdateArea(x2, dy, 1, h, x2, dy); + x1 += 2; + x2 -= 2; + w -= 2; + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea5(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i, x, y, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + static int hx[16]={ 0,32,16,48, 0,32,16,48,16,48, 0,32,16,48, 0,32}; + static int hy[16]={ 0, 0,16,16,32,32,48,48, 0, 0,16,16,32,32,48,48}; + + cnt = get_ecounter(); + for (i = 0; i < 16; i++) { + cnt += waitcnt; + for (y = 0; y < (h -63); y += 64) { + for (x = 0; x < (w -63); x += 64) { + ags_copyArea(sx + x + hx[i], sy + y + hy[i], 16, 16, + dx + x + hx[i], dy + y + hy[i]); + } + } + ags_updateArea(dx, dy, w, h); + EC_WAIT; + } + ags_copyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +static int eCopyArea6(int dx, int dy, int w, int h, int opt) { + int i, x, y, key = 0, cnt; + int waitcnt = opt == 0 ? 30 : opt; + + cnt = get_ecounter(); + for (i = 0; i < 7; i++) { + cnt += waitcnt; + for (x = 0; x < (w -63); x += 64) { + eCopyUpdateArea(dx+x+i*4, dy, 4, h, dx+x+i*4, dy); + eCopyUpdateArea(dx+x+(60-i*4),dy, 4, h, dx+x+(60-i*4), dy); + } + for (y = 0; y < (h -63); y += 64) { + eCopyUpdateArea(dx+4, dy+y+i*4, w-8, 4, dx+4, dy+y+i*4); + eCopyUpdateArea(dx+4, dy+y+(60-i*4), w-8, 4, dx+4, dy+y+(60-i*4)); + } + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +#define E7_8X 24 +static int eCopyArea7(int dx, int dy, int w, int h, int opt) { + int i, key = 0, cnt; + int waitcnt = opt == 0 ? 40 : opt; + + cnt = get_ecounter(); + for (i = 0; i < (w/2 - E7_8X+1); i+=E7_8X) { + cnt += waitcnt; + eCopyUpdateArea(dx, dy+i*h/w, w, E7_8X*h/w, dx, dy+i*h/w); + eCopyUpdateArea(dx, dy+(h-(i+E7_8X)*h/w), w, E7_8X*h/w, dx, dy+(h-(i+E7_8X)*h/w)); + eCopyUpdateArea(dx+i, dy, E7_8X, h, dx+i, dy); + eCopyUpdateArea(dx+(w-i-E7_8X), dy, E7_8X, h, dx+(w-i-E7_8X), dy); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea8(int dx, int dy, int w, int h, int opt) { + int i, key = 0, cnt; + int waitcnt = opt == 0 ? 40 : opt; + + cnt = get_ecounter(); + for (i = E7_8X; i < (w/2 -E7_8X+1); i+=E7_8X) { + cnt += waitcnt; + eCopyUpdateArea(dx+ w/2 - i , dy + h/2 - i*h/w, 2*i, 2*i*h/w ,dx+ w/2-i, dy + h/2 - i*h/w); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea9(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i, x, y, key = 0, cnt; + int waitcnt = opt == 0 ? 80 : opt; + static int hintX[4] = {0,8,0,8}; + static int hintY[4] = {0,8,8,0}; + + + cnt = get_ecounter(); + for (i = 0; i < 4; i++) { + cnt+=waitcnt; + for (y = 0; y < h -15; y+=16) { + for (x = 0; x < (w -7); x+=16) { + CopyArea(sx + x + hintX[i],sy + y + hintY[i], 8, 8, dx + x + hintX[i], dy + y + hintY[i]); + } + } + ags_updateArea(dx, dy, w, h); + EC_WAIT; + } + CopyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +static void eCopyArea10(int step) { + if (step == 0) { + return; + } + if (step == 64) { + CopyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + ags_scaledCopyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, + ecp.dx + ecp.w * (64 - step) / 128, ecp.dy + ecp.h * (64 - step) / 128, + ecp.w * step / 64, ecp.h * step / 64, 0); + ags_updateArea(ecp.dx + ecp.w * (64 - step) / 128, ecp.dy + ecp.h * (64 - step) / 128, + ecp.w * step / 64, ecp.h * step / 64); +} + +static int eCopyArea11(int dx, int dy, int w, int h, int opt) { + int i, j, y, key = 0, cnt; + int waitcnt = opt == 0 ? 40 : opt; + +#define ECA11_SLICE 16 + cnt = get_ecounter(); + for (i = 0; i < ECA11_SLICE + h / ECA11_SLICE -1; i++) { + cnt += waitcnt; + for (j = 0; j < min(i+1, ECA11_SLICE); j++) { + y = j + ECA11_SLICE*(i-j); + if (y < 0 || y >= h) continue; + eCopyUpdateArea(dx, dy + y, w, 1, dx, dy + y); + } + EC_WAIT; + } + + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea12(int dx, int dy, int w, int h, int opt) { + int x, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + + cnt = get_ecounter(); + for (x = 0; x < (w -7); x += 8) { + cnt += waitcnt; + eCopyUpdateArea(dx + x, dy, 8, h, dx + x, dy); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea13(int dx, int dy, int w, int h, int opt) { + int x, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + + cnt = get_ecounter(); + for (x = (w -8); x > 8; x -= 8) { + cnt +=waitcnt; + eCopyUpdateArea(dx + x, dy, 8, h, dx + x, dy); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea14(int dx, int dy, int w, int h, int opt) { + int y, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + + cnt = get_ecounter(); + for (y = 0; y < (h -7); y += 8) { + cnt += waitcnt; + eCopyUpdateArea(dx, dy + y, w, 8, dx, dy + y); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea15(int dx, int dy, int w, int h, int opt) { + int y, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + + cnt = get_ecounter(); + for (y = (h -8); y > 8; y -= 8) { + cnt += waitcnt; + eCopyUpdateArea(dx, dy + y, w, 8, dx, dy + y); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea16(int dx, int dy, int w, int h, int opt) { + int i, x, key = 0, cnt; + int waitcnt = opt == 0 ? 30 : opt; + + cnt = get_ecounter(); + for (i = 0; i < 8; i++) { + cnt += waitcnt; + for (x = 0; x < (w -15); x += 16) { + eCopyUpdateArea(dx + x + (7-i), dy, 1, h, dx + x + (7-i), dy); + eCopyUpdateArea(dx + x + (8+i), dy, 1, h, dx + x + (8+i), dy); + } + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea17(int dx, int dy, int w, int h, int opt) { + int i, y, key = 0, cnt; + int waitcnt = opt == 0 ? 30 : opt; + +#define E17X 18 + cnt = get_ecounter(); + for (i = 0; i < E17X; i++) { + cnt += waitcnt; + for (y = 0; y < (h - E17X + 1); y += E17X) { + eCopyUpdateArea(dx, dy + y + i, w, 1, dx, dy + y + i); + } + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea18(int dx, int dy, int w, int h, int opt) { + int x, key = 0, cnt; + int waitcnt = opt == 0 ? 30 : opt; + + cnt = get_ecounter(); + for (x = 0; x < (w/2 -7); x += 8) { + cnt += waitcnt; + eCopyUpdateArea(dx + w/2 - x - 8, dy, 8, h, dx + w/2 - x - 8, dy); + eCopyUpdateArea(dx + w/2 + x , dy, 8, h, dx + w/2 + x , dy); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea19(int dx, int dy, int w, int h, int opt) { + int x, key = 0, cnt; + int waitcnt = opt == 0 ? 30 : opt; + + cnt = get_ecounter(); + for (x = 0; x < (w/2 -7); x += 8) { + cnt += waitcnt; + eCopyUpdateArea(dx + x, dy, 8, h, dx + x, dy); + eCopyUpdateArea(dx + w - x - 8, dy, 8, h, dx + w - x - 8, dy); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea20(int dx, int dy, int w, int h, int opt) { + int y, key = 0, cnt; + int waitcnt = opt == 0 ? 30 : opt; + + cnt = get_ecounter(); + for (y = 0; y < (h/2 -7); y += 8) { + cnt += waitcnt; + eCopyUpdateArea(dx, dy + h/2 - y - 8, w, 8, dx, dy + h/2 - y - 8); + eCopyUpdateArea(dx, dy + h/2 + y , w, 8, dx, dy + h/2 + y ); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea21(int dx, int dy, int w, int h, int opt) { + int y, key = 0, cnt; + int waitcnt = opt == 0 ? 30 : opt; + + cnt = get_ecounter(); + for (y = 0; y < (h/2 -7); y += 8) { + cnt += waitcnt; + eCopyUpdateArea(dx, dy + y , w, 8, dx, dy + y); + eCopyUpdateArea(dx, dy + h - y - 8, w, 8, dx, dy + h - y - 8); + EC_WAIT; + } + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea22(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i, x, y, key = 0, cnt; + int waitcnt = opt == 0 ? 80 : opt; + + cnt = get_ecounter(); + for (i = 0; i < 2; i++) { + cnt += waitcnt; + for (y = 0; y < (h -3); y+=4) { + for (x = 0; x < (w -3); x+=4) { + ags_copyArea(sx + x + (i == 0 ? 0 : 2), sy + y + (i == 0 ? 0 : 2), 2, 2, + dx + x + (i == 0 ? 0 : 2), dy + y + (i == 0 ? 0 : 2)); + ags_copyArea(sx + x + (i == 0 ? 2 : 0), sy + y + (i == 0 ? 0 : 2), 2, 2, + dx + x + (i == 0 ? 2 : 0), dy + y + (i == 0 ? 0 : 2)); + } + } + ags_updateArea(dx, dy, w, h); + EC_WAIT; + } + ags_copyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +static int eCopyArea23(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i, x, y, key = 0, cnt; + int waitcnt = opt == 0 ? 80 : opt; + static int hintX[4] = {0,2,2,0}; + static int hintY[4] = {0,2,0,2}; + + cnt = get_ecounter(); + for (i = 0; i < 4; i++) { + cnt += waitcnt; + for (y = 0; y < (h -3); y+=4) { + for (x = 0; x < (w -3); x+=4) { + CopyArea(sx + x + hintX[i], sy + y + hintY[i], 2, 2, + dx + x + hintX[i], dy + y + hintY[i]); + } + } + ags_updateArea(dx, dy, w, h); + EC_WAIT; + } + ags_copyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +static int eCopyArea24(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i, key = 0, cnt; + int waitcnt = opt == 0 ? 100 : opt; + static int slices[8]={80,70,60,48,32,16,8,4}; + + cnt = get_ecounter(); + for (i = 0; i < 8; i++ ) { + cnt += waitcnt; + Mosaic(sx, sy, w, h, dx, dy, slices[i]); + ags_updateArea(dx, dy, w, h); + EC_WAIT; + } + ags_copyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +#define SCA25_6_SLICE 10 +static int eCopyArea25(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int r, rr, x, xx, y, yy, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + int w2=w/2,h2=h/2,h1=h-1,mr=(int)(sqrt(w2*w2+h2*h2)); + int ux=0,uy=0,ux_y=h2-1,uw,uh; + + cnt = get_ecounter(); + for (r = SCA25_6_SLICE; r < mr; r += SCA25_6_SLICE ) { + cnt += waitcnt; + rr=r*r; + uw=uh=0; + for (y = 0; y < h2; y++) { + yy=h2-y; + xx=rr-yy*yy; + if (xx > 0) { + x=(int)(sqrt(xx)); + x=(w2>x)?x:w2; + xx=w2-x; + ux=dx+xx; + uw=x*2; + if (uh == 0) { + uh=(h2-y)*2; + uy=dy+y; + } + if (xx == 0) { + ags_copyArea(sx+xx, sy+y, uw, ux_y-y+1, ux, dy+y); + ags_copyArea(sx+xx, sy+h1-ux_y, uw, ux_y-y+1, ux, dy+h1-ux_y); + ux_y=y; + break; + } + ags_copyArea(sx+xx, sy+y , uw, 1, ux, dy+y ); + ags_copyArea(sx+xx, sy+h1-y, uw, 1, ux, dy+h1-y); + } + } + ags_updateArea(ux,uy,uw,uh); + EC_WAIT; + } + + ags_copyArea(sx,sy,w,h,dx,dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +static int eCopyArea26(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int r, rr, x, xx=0, y, yy, key = 0, cnt; + int waitcnt = opt == 0 ? 20 : opt; + int w2=w/2,w1=w-1,h2=h/2,h1=h-1,mr=(int)(sqrt(w2*w2+h2*h2)); + int ux=0,uy=0,ux_y=0,uw,uh; + + cnt = get_ecounter(); + for (r = mr - SCA25_6_SLICE; r > 0; r -= SCA25_6_SLICE) { + cnt += waitcnt; + rr=r*r; + uy=ux_y; + uw=uh=0; + for (y = ux_y; y < h2; y++) { + yy=h2-y; + xx=rr-yy*yy; + if (xx < 0) { + uy++; + continue; + } + x=(int)(sqrt(xx)); + x=(w2>x)?x:w2; + xx=w2-x; + if (xx == 0) break; + if ((xx-ux) > uw) uw=xx-ux; + uh++; + ags_copyArea(sx+ux, sy+y, xx-ux, 1, dx+ux, dy+y); + ags_copyArea(sx+w1-xx, sy+y, xx-ux, 1, dx+w1-xx, dy+y); + ags_copyArea(sx+ux, sy+h1-y, xx-ux, 1, dx+ux, dy+h1-y); + ags_copyArea(sx+w1-xx, sy+h1-y, xx-ux, 1, dx+w1-xx, dy+h1-y); + } + if (uy != ux_y) { + ags_copyArea(sx, sy+ux_y,w,uy-ux_y,dx,dy+ux_y); + ags_updateArea(dx,dy+ux_y,w,uy-ux_y); + ags_copyArea(sx, sy+h-uy,w,uy-ux_y,dx,dy+h-uy); + ags_updateArea(dx,dy+h-uy,w,uy-ux_y); + ux_y=uy; + } + ags_updateArea(dx+ux, dy+uy, uw, uh); + ags_updateArea(dx+w1-ux-uw, dy+uy, uw, uh); + ags_updateArea(dx+ux, dy+h-uy-uh, uw, uh); + ags_updateArea(dx+w1-ux-uw, dy+h-uy-uh, uw, uh); + ux=xx; + EC_WAIT; + } + + ags_copyArea(sx,sy,w,h,dx,dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +static void eCopyArea27(int step) { + if (step == 0) { + return; + } + if (step == 64) { + ags_copyArea_alphaLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 255); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + ags_copyArea_alphaLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, step*4); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); +} + +static void eCopyArea28(int step) { + if (step == 0) { + return; + } + if (step == 64) { + ags_copyArea_whiteLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 0); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + ags_copyArea_whiteLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, (64-step)*4); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); +} + +static void eCopyArea29(int step) { + if (step == 0) { + return; + } + if (step == 64) { + ags_copyArea_alphaLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 0); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + ags_copyArea_alphaLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, (64-step)*4); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); +} + +static void eCopyArea30(int step) { + if (step == 0) { + return; + } + if (step == 64) { + ags_copyArea_whiteLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 255); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + ags_copyArea_whiteLevel(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, step*4); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); +} + +static void eCopyArea31(int step) { + static void *save; + if (step == 0) { + save = ags_saveRegion(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + if (step == 64) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + ags_putRegion(save, ecp.dx, ecp.dy); + ags_copyArea_alphaBlend(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, step*4); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); +} + +static void eCopyArea32(int step) { + static void *save; + static int slices[32]={4,8,12,16,20,28,36,40,44,48,56,64,72,80,88,96, + 88,80,72,64,56,48,44,40,36,28,24,20,16,12,8,4}; + + if (step == 0) { + save = ags_saveRegion(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + if (step == 64) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + ags_putRegion(save, ecp.dx, ecp.dy); + ags_copyArea_alphaBlend(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, step*4); + Mosaic(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, slices[step >> 1]); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); +} + +static int eCopyArea33(int dx, int dy, int w, int h, int opt) { + int i, j, y, key = 0, cnt,dyy=dy+h-1; + int waitcnt = opt == 0 ? 40 : opt; + + cnt = get_ecounter(); + for (i = 0; i < ECA11_SLICE + h / ECA11_SLICE -1; i++) { + cnt += waitcnt; + for (j = 0; j < min(i+1, ECA11_SLICE); j++) { + y = j + ECA11_SLICE*(i-j); + if (y < 0 || y >= h) continue; + eCopyUpdateArea(dx, dyy - y, w, 1, dx, dyy - y); + } + EC_WAIT; + } + + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea34(int dx, int dy, int w, int h, int opt) { + int i, j, y, key = 0, cnt,dyy=dy+h-1,h2=h/2; + int waitcnt = opt == 0 ? 40 : opt; + + cnt = get_ecounter(); + for (i = 0; i < ECA11_SLICE + h / ECA11_SLICE/2 -1; i++) { + cnt += waitcnt; + for (j = 0; j < min(i+1, ECA11_SLICE); j++) { + y = j + ECA11_SLICE*(i-j); + if (y < 0 || y >= h2 ) continue; + eCopyUpdateArea(dx, dy + y, w, 1, dx, dy + y); + eCopyUpdateArea(dx, dyy - y, w, 1, dx, dyy - y); + } + EC_WAIT; + } + + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +#define ECA35_D 256 +static void eCopyArea35(int step) { + int j, l; + int st_i, ed_i; + static int last_i = 0; + static void *save = NULL; + + if (step == 0) { + save = ags_saveRegion(ecp.dx, ecp.dy, ecp.w,ecp.h); + return; + } + + if (step == ECA35_D + ecp.h) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + + st_i = max(0, step - ECA35_D + 1); + ed_i = min(ecp.h - 1, step); + l = ed_i - st_i + 1; + + ags_copyRegion(save, 0, st_i, ecp.w, l, ecp.dx, ecp.dy+st_i); + ags_copyArea(ecp.sx, ecp.sy + st_i, ecp.w, 1, ecp.dx, ecp.dy + st_i); + for (j = st_i; j < ed_i; j++) { + ags_copyArea_alphaBlend(ecp.sx, ecp.sy + j, ecp.w, 1, ecp.dx, ecp.dy + j, step - j); + } + + if ((st_i - last_i) > 1) { + ags_copyArea(ecp.sx, ecp.sy + last_i, ecp.w, st_i - last_i, ecp.dx, ecp.dy + last_i); + ags_updateArea(ecp.dx, ecp.dy + last_i, ecp.w, st_i - last_i); + } + ags_updateArea(ecp.dx, ecp.dy+st_i, ecp.w, l); + + // if (st_i > 0) last_i = st_i; + last_i = st_i; +} + +static void eCopyArea36(int step) { + int j, l; + int st_i,ed_i; + static int last_i=0; + static void *save; + + int syy=ecp.sy+ecp.h-1,dyy=ecp.dy+ecp.h-1; + + if (step == 0) { + save = ags_saveRegion(ecp.dx, ecp.dy, ecp.w,ecp.h); + return; + } + if (step == ECA35_D + ecp.h) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + + st_i = max(0, step-ECA35_D+1); + ed_i = min(ecp.h -1, step); + l = ed_i - st_i+1; + ags_copyRegion(save,0,ecp.h -1 -ed_i,ecp.w,l,ecp.dx,dyy-ed_i); + + for (j = st_i; j <= ed_i; j++) { + ags_copyArea_alphaBlend(ecp.sx, syy-j, ecp.w, 1, ecp.dx, dyy-j, step-j); + } + + if ((st_i - last_i) > 1) { + ags_copyArea(ecp.sx,syy-st_i+1,ecp.w,st_i-last_i,ecp.dx,dyy-st_i+1); + ags_updateArea(ecp.dx, dyy-st_i+1, ecp.w, st_i-last_i); + } + ags_updateArea(ecp.dx, dyy-ed_i, ecp.w, l); + + // if (st_i > 0) last_i = st_i; + last_i = st_i; +} + +static void eCopyArea37(int step) { + int j, l; + int st_i,ed_i; + static int last_i=0; + static void *save = NULL; + + if (step == 0) { + save = ags_saveRegion(ecp.dx,ecp.dy,ecp.w,ecp.h); + return; + } + if (step == ECA35_D + ecp.w) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + + st_i=max(0,step-ECA35_D+1); + ed_i=min(ecp.w -1,step); + l=ed_i-st_i+1; + ags_copyRegion(save,st_i,0,l,ecp.h,ecp.dx+st_i,ecp.dy); + + for (j = st_i; j <= ed_i; j++) { + ags_copyArea_alphaBlend(ecp.sx+j, ecp.sy, 1, ecp.h, ecp.dx+j, ecp.dy, step-j); + } + + if ((st_i - last_i) > 1) { + ags_copyArea(ecp.sx+last_i, ecp.sy, st_i-last_i, ecp.h,ecp.dx+last_i, ecp.dy); + ags_updateArea(ecp.dx+last_i, ecp.dy, st_i-last_i, ecp.h); + } + ags_updateArea(ecp.dx+st_i, ecp.dy, l, ecp.h); + + //if (st_i > 0) last_i = st_i; + last_i = st_i; +} + +static void eCopyArea38(int step) { + int j, l; + int st_i, ed_i; + static int last_i=0; + static void *save; + int sxx=ecp.sx+ecp.w - 1,dxx=ecp.dx+ecp.w-1; + + if (step == 0) { + save = ags_saveRegion(ecp.dx, ecp.dy, ecp.w,ecp.h); + return; + } + if (step == ECA35_D + ecp.w) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + + st_i=max(0,step-ECA35_D+1); + ed_i=min(ecp.w - 1,step); + l=ed_i-st_i+1; + ags_copyRegion(save,ecp.w-1-ed_i,0,l,ecp.h,dxx-ed_i,ecp.dy); + + for (j = st_i; j<=ed_i; j++) { + ags_copyArea_alphaBlend(sxx-j, ecp.sy, 1, ecp.h, dxx-j, ecp.dy, step-j); + } + + if ((st_i - last_i) > 1) { + ags_copyArea(sxx-st_i+1, ecp.sy,st_i-last_i, ecp.h, dxx-st_i+1, ecp.dy); + ags_updateArea(dxx-st_i+1,ecp.dy, st_i-last_i, ecp.h); + } + ags_updateArea(dxx-ed_i, ecp.dy, l, ecp.h); + // if (st_i > 0) last_i=st_i; + last_i=st_i; +} + +static int eCopyArea39(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i,dy1,dy2,sy1,sy2, key = 0, cnt; + int waitcnt = opt == 0 ? 3 : opt; + int h2=h/2; + + dy1 = dy; + dy2 = dy+h-1; + sy1 = sy; + sy2 = sy+h-1; + cnt=get_ecounter(); + for (i = 0; i < h2; i++) { + cnt+=waitcnt; + ags_copyArea_alphaBlend(sx, sy1, w, 1, dx, dy1, 128); + ags_copyArea_alphaBlend(sx, sy2, w, 1, dx, dy2, 128); + ags_updateArea(dx, dy1, w, 1); + ags_updateArea(dx, dy2, w, 1); + dy1++; + sy1++; + dy2--; + sy2--; + EC_WAIT; + } + if (h & 1) { + eCopyUpdateArea(sx, sy1, w, 1, dx, dy1); + dy1++; + sy1++; + dy2--; + sy2--; + } + for (i = 0; i < h2; i++) { + cnt+=waitcnt; + eCopyUpdateArea(sx, sy1, w, 1, dx, dy1); + eCopyUpdateArea(sx, sy2, w, 1, dx, dy2); + dy1++; + sy1++; + dy2--; + sy2--; + EC_WAIT; + } + ags_copyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +static int eCopyArea40(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i,dx1,dx2,sx1,sx2, key = 0, cnt; + int waitcnt = opt == 0 ? 3 : opt; + int w2=w/2; + + dx1 = dx; + dx2 = dx+w-1; + sx1 = sx; + sx2 = sx+w-1; + cnt=get_ecounter(); + for (i = 0; i < w2; i++) { + cnt+=waitcnt; + ags_copyArea_alphaBlend(sx1, sy, 1, h, dx1, dy, 128); + ags_copyArea_alphaBlend(sx2, sy, 1, h, dx2, dy, 128); + ags_updateArea( dx1, dy, 1, h); + ags_updateArea( dx2, dy, 1, h); + dx1++; + sx1++; + dx2--; + sx2--; + EC_WAIT; + } + if (w & 1) { + eCopyUpdateArea(sx1, sy, 1, h, dx1, dy); + dx1++; + sx1++; + dx2--; + sx2--; + } + for (i = 0; i < w2; i++) { + cnt+=waitcnt; + eCopyUpdateArea( sx1, sy, 1, h, dx1, dy); + eCopyUpdateArea( sx2, sy, 1, h, dx2, dy); + dx1++; + sx1++; + dx2--; + sx2--; + EC_WAIT; + } + ags_copyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + return key; +} + +#define ECA41_D 128 +static void eCopyArea41(int step) { + int j, k, l; + int st_i,ed_i,w2=ecp.w/2,w21=ecp.w/2-1; + int sxx1=ecp.sx+w2,dxx1=ecp.dx+w2; + int sxx2=sxx1-1,dxx2=dxx1-1; + static int last_i = -1; + + static void *save= NULL; + + if (step == 0) { + save = ags_saveRegion(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + + if (step == ECA41_D + w21) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + + if (ecp.w & 1) { + sxx2++; + dxx2++; + } + + st_i=max(0,step-ECA41_D+1); + ed_i=min(w21,step); + l=ed_i-st_i+1; + ags_copyRegion(save,w2 +st_i, 0, l, ecp.h, dxx1+st_i, ecp.dy); + ags_copyRegion(save,w21-ed_i, 0, l, ecp.h, dxx2-ed_i, ecp.dy); + for (j = st_i; j <= ed_i; j++) { + k=(step-j+1)*2-1; + ags_copyArea_alphaBlend(sxx1+j, ecp.sy, 1, ecp.h, dxx1+j, ecp.dy, k); + ags_copyArea_alphaBlend(sxx2-j, ecp.sy, 1, ecp.h, dxx2-j, ecp.dy, k); + } + if ((st_i - last_i) > 1) { + if( last_i<0 ) last_i=0; + ags_copyArea(sxx1+last_i, ecp.sy, st_i-last_i, ecp.h,dxx1+last_i, ecp.dy); + ags_copyArea(sxx2-st_i+1, ecp.sy, st_i-last_i, ecp.h,dxx2-st_i+1, ecp.dy); + ags_updateArea( dxx1+last_i, ecp.dy, st_i-last_i, ecp.h); + ags_updateArea( dxx2-st_i+1, ecp.dy, st_i-last_i, ecp.h); + } + ags_updateArea(dxx1+st_i, ecp.dy, l, ecp.h); + ags_updateArea(dxx2-ed_i, ecp.dy, l, ecp.h); + if (st_i > 0) last_i=st_i; +} + +static void eCopyArea42(int step) { + int j, k, l; + int st_i,ed_i,h2=ecp.h/2,h21=ecp.h/2-1; + int syy1=ecp.sy+h2,dyy1=ecp.dy+h2; + int syy2=syy1-1,dyy2=dyy1-1; + static void *save; + static int last_i = -1; + + if (step == 0) { + save = ags_saveRegion(ecp.dx, ecp.dy, ecp.w, ecp.h); + return; + } + + if (step == ECA41_D + h21) { + ags_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); + ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); + ags_delRegion(save); + return; + } + + if( ecp.h&1 ) { + syy2++; + dyy2++; + } + + st_i=max(0,step-ECA41_D+1); + ed_i=min(h21,step); + l=ed_i-st_i+1; + ags_copyRegion(save, 0,h2 +st_i, ecp.w, l, ecp.dx, dyy1+st_i); + ags_copyRegion(save, 0,h21-ed_i, ecp.w, l, ecp.dx, dyy2-ed_i); + for( j=st_i ; j<=ed_i ; j++ ) { + k=(step-j+1)*2-1; + ags_copyArea_alphaBlend(ecp.sx, syy1+j, ecp.w, 1, ecp.dx, dyy1+j, k); + ags_copyArea_alphaBlend(ecp.sx, syy2-j, ecp.w, 1, ecp.dx, dyy2-j, k); + } + if( (st_i - last_i)>1 ) { + if( last_i<0 ) last_i=0; + ags_copyArea(ecp.sx, syy1+last_i, ecp.w, st_i-last_i, ecp.dx, dyy1+last_i); + ags_copyArea(ecp.sx, syy2-st_i+1, ecp.w, st_i-last_i, ecp.dx, dyy2-st_i+1); + ags_updateArea( ecp.dx, dyy1+last_i, ecp.w, st_i-last_i); + ags_updateArea( ecp.dx, dyy2-st_i+1, ecp.w, st_i-last_i); + } + ags_updateArea( ecp.dx, dyy1+st_i, ecp.w, l); + ags_updateArea( ecp.dx, dyy2-ed_i, ecp.w, l); + if( st_i > 0 ) last_i=st_i; +} + +static void eCopyArea43(int step) { + int deltax, deltay, deltaw, deltah; + int slice = max(ecp.w, ecp.h); + + if (step == 0) { + return; + } + if (step == slice) { + ags_scaledCopyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, + nact->sys_view_area.x, nact->sys_view_area.y, + nact->sys_view_area.width, nact->sys_view_area.height, 0); + ags_updateFull(); + return; + } + + deltax = (ecp.sx - nact->sys_view_area.x) * step / slice; + deltay = (ecp.sy - nact->sys_view_area.y) * step / slice; + deltaw = (nact->sys_view_area.width - ecp.w) * step / slice; + deltah = (nact->sys_view_area.height - ecp.h) * step / slice; + ags_zoom(nact->sys_view_area.x + deltax, + nact->sys_view_area.y + deltay, + nact->sys_view_area.width - deltaw, + nact->sys_view_area.height - deltah); +} + +static void eCopyArea44(int step) { + Maskupdate(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 44, step); +} + +static void eCopyArea45(int step) { + Maskupdate(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 45, step); +} + +static void eCopyArea46(int step) { + Maskupdate(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 46, step); +} + +static void eCopyArea47(int step) { + Maskupdate(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 47, step); +} + +static int eCopyArea48(int dx, int dy, int w, int h, int opt) { + int i, j, x, key = 0, cnt; + int waitcnt = opt == 0 ? 40 : opt; + + cnt = get_ecounter(); + for (i = 0; i < ECA11_SLICE + w / ECA11_SLICE -1; i++) { + cnt += waitcnt; + for (j = 0; j < min(i+1, ECA11_SLICE); j++) { + x = j + ECA11_SLICE*(i-j); + if (x < 0 || x >= w) continue; + eCopyUpdateArea( dx+x, dy, 1, h, dx+x, dy); + } + EC_WAIT; + } + + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static int eCopyArea49(int dx, int dy, int w, int h, int opt) { + int i, j, x, key = 0, cnt, dxx = dx + w - 1; + int waitcnt = opt == 0 ? 40 : opt; + + cnt = get_ecounter(); + for (i = 0; i < ECA11_SLICE + w / ECA11_SLICE -1; i++) { + cnt += waitcnt; + for (j = 0; j < min(i+1, ECA11_SLICE); j++) { + x = j + ECA11_SLICE*(i-j); + if (x < 0 || x >= w) continue; + eCopyUpdateArea(dxx - x, dy, 1, h, dxx - x, dy); + } + EC_WAIT; + } + + eCopyUpdateArea(dx, dy, w, h, dx, dy); + return key; +} + +static void eCopyArea50(int step) { + Maskupdate(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 50, step); +} + +static void eCopyArea51(int step) { + Maskupdate(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 51, step); +} + +static void eCopyArea52(int step) { + Maskupdate(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy, 52, step); +} + +static int eCopyArea1000(int sx, int sy, int w, int h, int dx, int dy, int opt, int spCol) { + /* XOR */ + return sys_getInputInfo(); +} + +static int eCopyArea1001(int sx, int sy, int w, int h, int dx, int dy, int opt, int spCol) { + /* パレットシフト */ + return sys_getInputInfo(); +} + +static int eCopyArea2000(int sx, int sy, int w, int h, int dx, int dy, int opt) { + FillRectangle(dx, dy, w, h, 0); + ags_copyArea_alphaLevel(sx, sy, w, h, dx, dy, opt); + ags_updateArea(dx, dy, w, h); + return sys_getInputInfo(); +} + +static int eCopyArea2001(int sx, int sy, int w, int h, int dx, int dy, int opt) { + ags_copyArea_alphaBlend(sx, sy, w, h, dx, dy, opt); + ags_updateArea(dx, dy, w, h); + return sys_getInputInfo(); +} + +static int eCopyArea5sp(int sx, int sy, int w, int h, int dx, int dy, int opt) { + int i, j, k, key = 0, cnt; + int st_i, ed_i; + int waitcnt = opt == 0 ? 50 : opt * 10; + int step[200]; + void *save = ags_saveRegion(dx - 50, dy, w + 100, h); + + for (i = 0; i < 200; i++) { + step[i] = 50 * sin((2 * M_PI * i) / 50); + } + + cnt = get_ecounter(); + + for (i = 150; i < h + 200; i++) { + cnt += waitcnt; + st_i = max(0, i - 200); + ed_i = h; + ags_copyRegion(save, 0, st_i, w + 100, ed_i - st_i, dx - 50, dy + st_i); + for (j = st_i, k = 0; j < ed_i; j++, k++) { + ags_copyArea_shadow(sx , sy + j, w, 1, + dx + step[(k + max(0, 200 - i)) % 200], + dy + j); + } + ags_updateArea(dx - 50, dy + st_i, w + 100, ed_i - st_i); + EC_WAIT; + } + + ags_delRegion(save); + + return key; +} + +void ags_eCopyArea(int sx, int sy, int w, int h, int dx, int dy, int sw, int opt, boolean cancel, int spCol) { + int ret = 0; + ags_faderinfo_t i; + + ags_sync(); +#if 0 + NOTICE("ec_area sx %d sy %d w %d h %d dx %d dy %d sw %d opt %d spc %d cancel %s\n", + sx, sy, w, h, dx, dy, sw, opt, spCol, cancel ? "True" : "False"); +#endif + if (!ags_check_param(&sx, &sy, &w, &h)) return; + if (!ags_check_param(&dx, &dy, &w, &h)) return; + + nact->waitcancel_key = 0; + + ecp.sx = sx; + ecp.sy = sy; + ecp.w = w; + ecp.h = h; + ecp.dx = dx; + ecp.dy = dy; + ecp.sw = sw; + ecp.opt = opt; + ecp.cancel = cancel; + ecp.spCol = spCol; + + switch(sw) { + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + case 8: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 33: + case 34: + case 48: + case 49: + case 53: + case 54: + if (spCol == -1) { + ags_copyArea(sx, sy, w, h, dx, dy); + } else { + ags_copyAreaSP(sx, sy, w, h, dx, dy, spCol); + } + { + MyRectangle r, update; + + r.x = dx; r.y = dy; r.width = w; r.height = h; + ags_intersection(&nact->sys_view_area, &r, &update); + w = update.width; + h = update.height; + } + } + + switch(sw) { + case 1: + ret = eCopyArea1(dx, dy, w, h, opt); + break; + case 2: + ret = eCopyArea2(dx, dy, w, h, opt); + break; + case 3: + ret = eCopyArea3(dx, dy, w, h, opt); + break; + case 4: + ret = eCopyArea4(dx, dy, w, h, opt); + break; + case 5: + if (spCol == -1) { + ret = eCopyArea5(sx, sy, w, h, dx, dy, opt); + } else { + ret = eCopyArea5sp(sx, sy, w, h, dx, dy, opt); + } + break; + case 6: + ret = eCopyArea6(dx, dy, w, h, opt); + break; + case 7: + ret = eCopyArea7(dx, dy, w, h, opt); + break; + case 8: + ret = eCopyArea8(dx, dy, w, h, opt); + break; + case 9: + ret = eCopyArea9(sx, sy, w, h, dx, dy, opt); + break; + case 10: + i.step_max = 64; + i.effect_time = opt == 0 ? 500 : opt * 64; + i.cancel = cancel; + i.callback = eCopyArea10; + ags_fader(&i); + return; + case 11: + ret = eCopyArea11(dx, dy, w, h, opt); + break; + case 12: + ret = eCopyArea12(dx, dy, w, h, opt); + break; + case 13: + ret = eCopyArea13(dx, dy, w, h, opt); + break; + case 14: + ret = eCopyArea14(dx, dy, w, h, opt); + break; + case 15: + ret = eCopyArea15(dx, dy, w, h, opt); + break; + case 16: + ret = eCopyArea16(dx, dy, w, h, opt); + break; + case 17: + ret = eCopyArea17(dx, dy, w, h, opt); + break; + case 18: + ret = eCopyArea18(dx, dy, w, h, opt); + break; + case 19: + ret = eCopyArea19(dx, dy, w, h, opt); + break; + case 20: + ret = eCopyArea20(dx, dy, w, h, opt); + break; + case 21: + ret = eCopyArea21(dx, dy, w, h, opt); + break; + case 22: + ret = eCopyArea22(sx, sy, w, h, dx, dy, opt); + break; + case 23: + ret = eCopyArea23(sx, sy, w, h, dx, dy, opt); + break; + case 24: + ret = eCopyArea24(sx, sy, w, h, dx, dy, opt); + break; + case 25: + ret = eCopyArea25(sx, sy, w, h, dx, dy, opt); + break; + case 26: + ret = eCopyArea26(sx, sy, w, h, dx, dy, opt); + break; + case 27: + i.step_max = 64; + i.effect_time = opt == 0 ? 1700 : opt * 32; + i.cancel = cancel; + i.callback = eCopyArea27; + ags_fader(&i); + return; + case 28: + i.step_max = 64; + i.effect_time = opt == 0 ? 1700 : opt * 32; + i.cancel = cancel; + i.callback = eCopyArea28; + ags_fader(&i); + return; + case 29: + i.step_max = 64; + i.effect_time = opt == 0 ? 1700 : opt * 32; + i.cancel = cancel; + i.callback = eCopyArea29; + ags_fader(&i); + return; + case 30: + i.step_max = 64; + i.effect_time = opt == 0 ? 1700 : opt * 32; + i.cancel = cancel; + i.callback = eCopyArea30; + ags_fader(&i); + return; + case 31: + i.step_max = 64; + i.effect_time = opt == 0 ? 2700 : opt * 256; + i.cancel = cancel; + i.callback = eCopyArea31; + ags_fader(&i); + return; + case 32: + i.step_max = 64; + i.effect_time = opt == 0 ? 1400 : opt * 256; + i.cancel = cancel; + i.callback = eCopyArea32; + ags_fader(&i); + return; + case 33: + ret = eCopyArea33(dx, dy, w, h, opt); + break; + case 34: + ret = eCopyArea34(dx, dy, w, h, opt); + break; + case 35: + i.step_max = ECA35_D + h; + i.effect_time = opt == 0 ? 1150 : opt * i.step_max; + i.cancel = cancel; + i.callback = eCopyArea35; + ags_fader(&i); + return; + case 36: + i.step_max = ECA35_D + h; + i.effect_time = opt == 0 ? 1150 : opt * i.step_max; + i.cancel = cancel; + i.callback = eCopyArea36; + ags_fader(&i); + return; + case 37: + i.step_max = ECA35_D + w; + i.effect_time = opt == 0 ? 1150 : opt * i.step_max; + i.cancel = cancel; + i.callback = eCopyArea37; + ags_fader(&i); + return; + case 38: + i.step_max = ECA35_D + w; + i.effect_time = opt == 0 ? 1150 : opt * i.step_max; + i.cancel = cancel; + i.callback = eCopyArea38; + ags_fader(&i); + return; + case 39: + ret = eCopyArea39(sx, sy, w, h, dx, dy, opt); + break; + case 40: + ret = eCopyArea40(sx, sy, w, h, dx, dy, opt); + break; + case 41: + i.step_max = ECA41_D + w/2 -1; + i.effect_time = opt == 0 ? 1300 : opt * i.step_max; + i.cancel = cancel; + i.callback = eCopyArea41; + ags_fader(&i); + return; + case 42: + i.step_max = ECA41_D + h/2 -1; + i.effect_time = opt == 0 ? 1300 : opt * i.step_max; + i.cancel = cancel; + i.callback = eCopyArea42; + ags_fader(&i); + return; + case 43: + i.step_max = max(w, h); + i.effect_time = opt == 0 ? 2000 : opt + 300; + i.cancel = cancel; + i.callback = eCopyArea43; + ags_fader(&i); + return; + + case 44: + i.step_max = 256; + i.effect_time = opt == 0 ? 1000 : opt; + i.cancel = cancel; + i.callback = eCopyArea44; + ags_fader(&i); + return; + + case 45: + i.step_max = 256; + i.effect_time = opt == 0 ? 1000 : opt; + i.cancel = cancel; + i.callback = eCopyArea45; + ags_fader(&i); + return; + + case 46: + i.step_max = 256; + i.effect_time = opt == 0 ? 1000 : opt; + i.cancel = cancel; + i.callback = eCopyArea46; + ags_fader(&i); + return; + + case 47: + i.step_max = 256; + i.effect_time = opt == 0 ? 1000 : opt; + i.cancel = cancel; + i.callback = eCopyArea47; + ags_fader(&i); + return; + + case 48: + ret = eCopyArea48(dx, dy, w, h, opt); + break; + case 49: + ret = eCopyArea49(dx, dy, w, h, opt); + break; + + case 50: + i.step_max = 256; + i.effect_time = opt == 0 ? 1000 : opt; + i.cancel = cancel; + i.callback = eCopyArea50; + ags_fader(&i); + return; + + case 51: + i.step_max = 256; + i.effect_time = opt == 0 ? 1000 : opt; + i.cancel = cancel; + i.callback = eCopyArea51; + ags_fader(&i); + return; + + case 52: + i.step_max = 256; + i.effect_time = opt == 0 ? 1000 : opt; + i.cancel = cancel; + i.callback = eCopyArea52; + ags_fader(&i); + return; + + case 1000: + if (nact->sys_world_depth != 8) return; + ret = eCopyArea1000(sx, sy, w, h, dx, dy, opt, spCol); + break; + case 1001: + if (nact->sys_world_depth != 8) return; + ret = eCopyArea1001(sx, sy, w, h, dx, dy, opt, spCol); + break; + case 2000: + if (nact->sys_world_depth == 8) return; + ret = eCopyArea2000(sx, sy, w, h, dx, dy, opt); + break; + case 2001: + if (nact->sys_world_depth == 8) return; + ret = eCopyArea2001(sx, sy, w, h, dx, dy, opt); + break; + default: + eCopyUpdateArea(dx, dy, w, h, dx, dy); + WARNING("effect %d is not presented.\n", sw); + break; + } + nact->waitcancel_key = ret; +} diff --git a/src/eucsjis.c b/src/eucsjis.c new file mode 100644 index 0000000..03d4250 --- /dev/null +++ b/src/eucsjis.c @@ -0,0 +1,180 @@ +/* + * eucsjis.c -- euc/sjis related function + * + * Copyright (C) 1997 Yutaka OIWA + * + * written for Satoshi KURAMOCHI's "eplaymidi" + * + * + * 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 + * +*/ +/* $Id: eucsjis.c,v 1.2 2000/09/20 10:33:16 chikama Exp $ */ + + +#include +#include +#include + +#include "portab.h" +#include "eucsjis.h" + +/* SJIS から EUC への変換 */ +BYTE *sjis2euc(BYTE *src) { + BYTE *dst , *_dst; + + dst = _dst = malloc(strlen(src) * 2 + 1); + if (dst == NULL) return NULL; + + while(*src) { + if (*src < 0x81) + *dst++ = *src++; + else if (*src >= 0xa0 && *src <= 0xdf) { + /* JIS X0201 katakana */ + *dst++ = 0x8e; /* ISO-2022 SS2 */ + *dst++ = *src++; + } else { + unsigned char c1, c2; + c1 = *src++; + if (!*src) { + *dst++ = '*'; + break; + } + c2 = *src++; + if (c1 >= 0xe0) + c1 -= 0x40; + c1 -= 0x81; + if (c2 >= 0x80) + c2--; + c2 -= 0x40; + + if (c2 >= 94*2 || c1 > 94/2) { + /* invalid code */ + *dst++ = '*'; + *dst++ = '*'; + continue; + } + c1 *= 2; + if (c2 >= 94) { + c2 -= 94; + c1++; + } + *dst++ = 0xa1 + c1; + *dst++ = 0xa1 + c2; + } + } + *dst = '\0'; + return _dst; +} + +static void _jis_shift(int *p1, int *p2) { + unsigned char c1 = *p1; + unsigned char c2 = *p2; + int rowOffset = c1 < 95 ? 112 : 176; + int cellOffset = c1 % 2 ? (c2 > 95 ? 32 : 31) : 126; + + *p1 = ((c1 + 1) >> 1) + rowOffset; + *p2 += cellOffset; +} + +/* EUC から SJIS への変換 */ +BYTE *euc2sjis(BYTE* src) { + BYTE *dst , *_dst; + + dst = _dst = malloc(strlen(src) +1); + if (dst == NULL) return NULL; + + while(*src) { + if (*src < 0x81) { + *dst++ = *src++; + } else if (*src == 0x8e) { + src++; + *dst++ = *src++; + } else { + int c1, c2; + c1 = *src++; + c2 = *src++; + c1 -= 128; + c2 -= 128; + _jis_shift(&c1, &c2); + *dst++= (char)c1; + *dst++= (char)c2; + } + } + *dst = '\0'; + return _dst; +} + +/* src 内に半角カナもしくはASCII文字があるかどうか */ +boolean sjis_has_hankaku(BYTE *src) { + while(*src) { + if (CHECKSJIS1BYTE(*src)) { + src++; + } else { + return TRUE; + } + src++; + } + return FALSE; +} + +/* src 内に 全角文字があるかどうか */ +boolean sjis_has_zenkaku(BYTE *src) { + while(*src) { + if (CHECKSJIS1BYTE(*src)) { + return TRUE; + } + src++; + } + return FALSE; +} + +/* src 中の文字数を数える 全角文字も1文字 */ +int sjis_count_char(BYTE *src) { + int c = 0; + + while(*src) { + if (CHECKSJIS1BYTE(*src)) { + src++; + } + c++; src++; + } + return c; +} + +/* SJIS(EUC) を含む文字列の ASCII を大文字化する */ +void sjis_toupper(BYTE *src) { + while(*src) { + if (CHECKSJIS1BYTE(*src)) { + src++; + } else { + if (*src >= 0x60 && *src <= 0x7a) { + *src &= 0xdf; + } + } + src++; + } +} + +/* SJIS を含む文字列の ASCII を大文字化する2 */ +BYTE *sjis_toupper2(BYTE *src) { + BYTE *dst; + + dst = malloc(strlen(src) +1); + if (dst == NULL) return NULL; + strcpy(dst, src); + sjis_toupper(dst); + return dst; +} diff --git a/src/eucsjis.h b/src/eucsjis.h new file mode 100644 index 0000000..ac99605 --- /dev/null +++ b/src/eucsjis.h @@ -0,0 +1,43 @@ +/* + * eucsjis.h -- euc/sjis related function + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: eucsjis.h,v 1.2 2000/09/20 10:33:16 chikama Exp $ */ + +#ifndef __EUCSJIS__ +#define __EUCSJIS__ + +#include "portab.h" + +/* for future */ +#define sjis2lang sjis2euc +#define lang2sjis euc2sjis + +#define CHECKSJIS1BYTE(b) ( ((b) & 0xe0) == 0x80 || ((b) & 0xe0) == 0xe0 ) + +extern BYTE* sjis2euc(BYTE *src); +extern BYTE* euc2sjis(BYTE *src); +extern boolean sjis_has_hankaku(BYTE *src); +extern boolean sjis_has_zenkaku(BYTE *src); +extern int sjis_count_char(BYTE *src); +extern void sjis_toupper(BYTE *src); +extern BYTE* sjis_toupper2(BYTE *src); + +#endif /* __EUCSJIS__ */ diff --git a/src/filecheck.c b/src/filecheck.c new file mode 100644 index 0000000..16a8083 --- /dev/null +++ b/src/filecheck.c @@ -0,0 +1,133 @@ +/* + * filecheck.c save/load file existance and kanjicode check + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: filecheck.c,v 1.5 2006/04/21 16:40:48 chikama Exp $ */ + +#include +#include +#include +#include +#include + +#include "eucsjis.h" + +struct fnametable { + char *realname; + char *transname; +}; + +#define FILEMAX 100 /* ???? */ +static struct fnametable tbl[FILEMAX]; +static int fnametable_cnt; +static boolean initilized = FALSE; +static boolean newfile_kanjicode_euc = TRUE; + +/* list up file in current directory */ +/* name : save/load directory */ +void fc_init(char *name) { + DIR *dir; + struct dirent *entry; + int c = 0; + + initilized = FALSE; + + if (NULL == (dir = opendir(name))) { + return; + } + + while(0 < (entry = readdir(dir))) { + if (c >= FILEMAX) { + fprintf(stderr, "Over " "FILEMAX" "files in savefile directry\n"); + break; + } + tbl[c].realname = strdup(entry->d_name); + tbl[c].transname = strdup(entry->d_name); + sjis_toupper(tbl[c].transname); + c++; + } + fnametable_cnt = c; + closedir(dir); + initilized = TRUE; +} + +/* req must sjis */ +char *fc_search(char *req) { + int i; + BYTE *b; + + if (!initilized) return req; + + for (i = 0; i < fnametable_cnt; i++) { + /* match exeactly */ + if (0 == strcmp(req, tbl[i].realname)) return req; + + /* capital match */ + b = sjis_toupper2(req); + if (0 == strcmp(b, tbl[i].transname)) { + free(b); + return tbl[i].realname; + } + + /* euc match */ + b = sjis2euc(req); + sjis_toupper(b); + if (0 == strcmp(b, tbl[i].transname)) { + free(b); + return tbl[i].realname; + } + free(b); + } + return NULL; +} + +/* add new file to entry */ +char *fc_add(char *req) { + BYTE *b; + + if (!initilized) return req; + + if (fnametable_cnt >= FILEMAX) { + fprintf(stderr, "Over " "FILEMAX" "files in savefile directry\n"); + return req; + } + + if (newfile_kanjicode_euc) { + tbl[fnametable_cnt].realname = sjis2euc(req); + } else { + tbl[fnametable_cnt].realname = strdup(req); + } + + b = sjis_toupper2(req); + tbl[fnametable_cnt].transname = b; + + b = tbl[fnametable_cnt].realname; + fnametable_cnt++; + return b; +} + +/* QE で新規ファイルをセーブする時のファイル名の漢字コード */ +void fc_set_default_kanjicode(int c) { + if (c == 0) { + newfile_kanjicode_euc = TRUE; + } else { + newfile_kanjicode_euc = FALSE; + } +} diff --git a/src/filecheck.h b/src/filecheck.h new file mode 100644 index 0000000..d721f0b --- /dev/null +++ b/src/filecheck.h @@ -0,0 +1,35 @@ +/* + * filecheck.c save/load file existance and kanjicode check + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: filecheck.h,v 1.2 2000/11/25 13:09:04 chikama Exp $ */ + +#ifndef __FILECHECK_H__ +#define __FILECHECK_H__ + +#define FILENAME_KANJI_CODE_EUC 0 +#define FILENAME_KANJI_CODE_SJIS 1 + +extern void fc_init(char *name); +extern char *fc_search(char *req); +extern char *fc_add(char *req); +extern void fc_set_default_kanjicode(int c); + +#endif /* !__FILECHECK_H__ */ diff --git a/src/flood.c b/src/flood.c new file mode 100644 index 0000000..fab056f --- /dev/null +++ b/src/flood.c @@ -0,0 +1,236 @@ +/* + * flood.c 塗りつぶし操作 + * + * Copyright (C) 1998- TAJIRI Yasuhiro + * 2000- + * + * 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 + * +*/ +/* $Id: flood.c,v 1.4 2006/04/21 16:40:48 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "flood.h" + +typedef struct shdw { + struct shdw *next; /* 次の影へのポインタ */ + int left, right; /* 端点 */ + int row, par; /* この影と親ラインの列 */ + boolean ok; /* 有効/無効 フラグ */ +} shadow; + +/* 影型の変数 */ + + +static int currentRow; /* 処理中の列 */ +static shadow *seedShadow; /* 処理中の影 */ +static shadow *rowHead; /* 列リストの先頭へのポインタ */ +static shadow *pendHead; /* スタックリストの先頭へのポインタ */ +static shadow *freeHead; /* 空リストの先頭へのポインタ */ + +/* 内部点をかどうか判定して色の変更をする関数ポインタ */ +static int (*isInterior)(int, int); + +/* エラー回復用 */ + +static jmp_buf errBuf; + +/*****************************************************/ + +/* リストを開放する */ + +static void free_shadows(shadow *s) { + shadow *t; + while(s){ + t=s->next; + free(s); + s=t; + } +} + +/* 両端点と列を指定して新しい影を作る */ +static void newshadow(int sleft, int sright, int srow, int prow) +{ + + shadow *new_list; + + if ((new_list = freeHead) != NULL) + freeHead = freeHead->next; + else if ((new_list= malloc(sizeof(shadow))) == NULL) { + free_shadows(rowHead); + free_shadows(pendHead); + longjmp(errBuf, !0); + } + + new_list->left = sleft; + new_list->right = sright; + new_list->row = srow; + new_list->par = prow; + new_list->ok = TRUE; + new_list->next = pendHead; + pendHead = new_list; +} + +/* 列リストを作る */ + +static void make_row(void) { + + shadow *s, *t; + + t = pendHead; + pendHead = NULL; + + while((s = t) != NULL) { + t = t->next; + if (s->ok) { + if (rowHead == NULL) { + currentRow = s->row; + s->next = NULL; + rowHead = s; + } + else if (s->row == currentRow) { + if (s->left <= rowHead->left) { + s->next = rowHead; + rowHead = s; + } + else { + shadow* u; + for (u = rowHead; u->next; u = u->next) + if (s->left <= u->next->left) + break; + s->next = u->next; + u->next = s; + } + } + else { + s->next = pendHead; + pendHead = s; + } + } + else { + s->next = freeHead; + freeHead = s; + } + } +} + +/* 影からラインに重ならない部分を抜きだし、新しい影とする */ + +static void clipshadow(int left, int right, int row, shadow *line) +{ + + if (left < (line->left - 1)) + newshadow(left, line->left - 2, row, line->row); + if (right > (line->right + 1)) + newshadow(line->right + 2, right, row, line->row); +} + +/* ラインに重なる影を修正/除去(無効のマークをつける)する */ + +static void removeoverlap(shadow *rw) { + + shadow *child; + + for (child = pendHead; child->row != rw->par; child = child->next) + ; + + clipshadow(child->left, child->right, child->row, rw); + if (rw->right > (child->right + 1)) + rw->left = child->right + 2; + else + rw->ok = FALSE; + child->ok = FALSE; + +} + +/* 子ラインから影を作る */ +static void make_shadows(int left, int right) { + + shadow *p; + + if (currentRow > seedShadow->par) { + newshadow(left, right, currentRow + 1, currentRow); + clipshadow(left, right, currentRow - 1, seedShadow); + } + else if (currentRow < seedShadow->par) { + newshadow(left, right, currentRow - 1, currentRow); + clipshadow(left, right, currentRow + 1, seedShadow); + } + else { + newshadow(left, right, currentRow + 1, currentRow); + newshadow(left, right, currentRow - 1, currentRow); + } + + for (p = rowHead; p && (p->left <= right); p = p->next) + if (p->ok) + removeoverlap(p); +} + +/* 影の中にある全ての未探索のラインを見つけ出す */ + +static void visitshadow(void) +{ + int col, left; + + for (col = seedShadow->left; col <= seedShadow->right; col++) + { + if ((*isInterior)(col, currentRow)) { + if ((left = col) == seedShadow->left) { + while ((*isInterior)(--left, currentRow)) + ; + left++; + } + while ((*isInterior)(++col, currentRow)) + ; + make_shadows(left, col - 1); + } + } +} + +/* 塗りつぶし */ +static void do_flood(int seedx, int seedy, int (*visit)(int, int)) +{ + + isInterior = visit; + pendHead = rowHead = freeHead = NULL; + + newshadow(seedx, seedx, seedy, seedy); + while (pendHead) { + make_row(); + while (rowHead) { + seedShadow = rowHead; + + rowHead = rowHead->next; + if (seedShadow->ok) + visitshadow(); + seedShadow->next = freeHead; + freeHead = seedShadow; + } + } + free_shadows(freeHead); +} + +/* ガード関数を使って塗りつぶし関数(flood)を実行する */ +int flood(int seed_x, int seed_y, int (*visit)(int, int)) +{ + if (setjmp(errBuf) != 0) + return(false); + do_flood(seed_x, seed_y, visit); + return(true); +} diff --git a/src/flood.h b/src/flood.h new file mode 100644 index 0000000..898c839 --- /dev/null +++ b/src/flood.h @@ -0,0 +1,30 @@ +/* + * flood.h 塗りつぶし操作 + * + * Copyright (C) 1998- 田尻さん + * + * 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 + * +*/ +/* $Id: flood.h,v 1.3 2006/04/21 16:40:48 chikama Exp $ */ + +#ifndef __FLOOD_H__ +#define __FLOOD_H__ + +int flood(int seedx, int seedy, int(*vist)(int, int)); + +#endif /* __FLOOD_H__ */ + + diff --git a/src/font.c b/src/font.c new file mode 100644 index 0000000..79e9e44 --- /dev/null +++ b/src/font.c @@ -0,0 +1,62 @@ +/* + * font.c font device selecter + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: font.c,v 1.1 2002/09/18 13:16:22 chikama Exp $ */ + +#include "config.h" + +#include "portab.h" +#include "nact.h" +#include "ags.h" +#include "font.h" + +void font_init(int dev) { + switch(dev) { +#ifdef ENAME_X11FONT + case FONT_X11: + nact->ags.font = font_x11_new(); + break; +#endif +#ifdef ENABLE_GTKFONT + case FONT_GTK: + nact->ags.font = font_gtk_new(); + break; +#endif +#ifdef ENABLE_TTF + case FONT_TTF: + nact->ags.font = font_ttf_new(); + break; +#endif +#ifdef ENABLE_FT2 + case FONT_FT2: + nact->ags.font = font_ft2_new(); + break; +#endif + default: +#ifdef ENABLE_SDL + nact->ags.font = font_gtk_new(); + break; +#else + nact->ags.font = font_x11_new(); + break; +#endif + } +} diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..c0ac8fd --- /dev/null +++ b/src/font.h @@ -0,0 +1,94 @@ +/* + * font.h header for access to fontdevice + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: font.h,v 1.9 2002/12/21 12:28:35 chikama Exp $ */ + +#ifndef __FONT_H__ +#define __FONT_H__ + +#include "config.h" +#include "portab.h" + +/* font の種類 */ +#define FONTTYPEMAX 2 + +/* fontの名前 */ +#define FONT_GOTHIC (0) +#define FONT_MINCHO (1) + +struct _FONT { + + boolean antialiase_on; + + char *name[FONTTYPEMAX]; + boolean isJISX0213[FONTTYPEMAX]; + char face[FONTTYPEMAX]; + + void (*sel_font)(int type, int size); + + void *(*get_glyph)(unsigned char *str); + + int (*draw_glyph)(int x, int y, unsigned char *str, int col); + + boolean (*self_drawable)(); + + int (*codeconv[FONTTYPEMAX])(unsigned char **msg); +}; + +typedef struct _FONT FONT; + +extern void font_init(int dev); + +#ifdef ENABLE_TTF +extern FONT *font_ttf_new(); +#endif + +#ifdef ENABLE_FT2 +extern FONT *font_ft2_new(); +#endif + +#ifdef ENABLE_SDLTTF +extern FONT *font_sdlttf_new(); +#endif + +#ifdef ENABLE_X11FONT +extern FONT *font_x11_new(); +#endif + +#ifdef ENABLE_GTKFONT +extern FONT *font_gtk_new(); +#endif + +/* デフォルトのフォント名 */ +#define FONT_DEFAULTNAME_X "-*-*-medium-r-normal--%d-*-*-*-c-*-jisx0208.1983-0,-*-*-medium-r-normal--%d-*-*-*-c-*-jisx0201.1976-0,*" + +#define FONT_DEFAULTNAME_TTF "/usr/share/fonts/TrueType/mincho.ttc" + +// +typedef enum { + FONT_X11, + FONT_GTK, + FONT_TTF, + FONT_FT2, + FONT_SDLTTF +} fontdev_t; + +#endif /* __FONT_H__ */ diff --git a/src/font_freetype2.c b/src/font_freetype2.c new file mode 100644 index 0000000..42af896 --- /dev/null +++ b/src/font_freetype2.c @@ -0,0 +1,334 @@ +/* + * font_freetype2.c access to ttf font device + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: font_freetype2.c,v 1.12 2004/10/31 04:18:06 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include +#include FT_FREETYPE_H +//#include + +#include "portab.h" +#include "system.h" +#include "font.h" +#include "ags.h" +#include "s2utbl.h" + +extern int cp932tosjis0213(int code); + +typedef struct { + int size; + int type; + FT_Face face; +} FontTable; + +#define FONTTABLEMAX 256 +static FontTable fonttbl[FONTTABLEMAX]; +static int fontcnt = 0; +static FT_Library eng; +static FontTable *fontset; + +#define GLYPH_PIXMAP_WIDTH 800 /* 文字イメージを取得する為のPixmapの大きさ */ +#define GLYPH_PIXMAP_HEIGHT 150 + +static agsurface_t img_glyph; + +static FONT *this; + +static void pixmap2comimg(BYTE *src, int x, int y, int w, int h, int src_bpl); +static void pixmapmono2comimg(BYTE *src, int x, int y, int w, int h, int src_bpl); + +static int toUnicode(unsigned char **msg) { + int code; + + if (**msg >= 0xa0 && **msg <= 0xdf) { + code = 0xff60 + (**msg) - 0xa0; (*msg)++; + } else if (**msg&0x80) { + code = s2u[**msg - 0x80][*(*msg+1) - 0x40]; + (*msg) += 2; + } else { + code = **msg; (*msg)++; + } + return code; +} + +static int toSJIS(unsigned char **msg) { + int code; + + if (**msg >= 0xa0 && **msg <= 0xdf) { + code = **msg; (*msg)++; + } else if (**msg & 0x80) { + code = (**msg << 8) + *(*msg+1); + (*msg) += 2; + } else { + code = **msg; (*msg)++; + } + return code; +} + +static int toSJIS0213(unsigned char **msg) { + int code; + + if (**msg >= 0xa0 && **msg <= 0xdf) { + code = **msg; (*msg)++; + } else if (**msg & 0x80) { + code = (**msg << 8) + *(*msg+1); + (*msg) += 2; + } else { + code = **msg; (*msg)++; + } + return cp932tosjis0213(code); +} + +static void select_charmap(FT_Face f, int type) { + int i; + + for (i = 0; i < f->num_charmaps; i++) { + FT_CharMap map = f->charmaps[i]; + if (map->encoding == ft_encoding_sjis) { + FT_Select_Charmap(f, ft_encoding_sjis); + this->codeconv[type] = (this->isJISX0213[type] ? + toSJIS0213 : toSJIS); + return; + } else if (map->encoding == ft_encoding_unicode) { + FT_Select_Charmap(f, ft_encoding_unicode); + this->codeconv[type] = toUnicode; + return; + } + } + SYSERROR("CharMap encoding is neither sjis nor unicode\n"); +} + +static void font_insert(int size, int type, FT_Face face) { + fonttbl[fontcnt].size = size; + fonttbl[fontcnt].type = type; + fonttbl[fontcnt].face = face; + + if (fontcnt >= (FONTTABLEMAX -1)) { + WARNING("Font table is full.\n"); + } else { + fontcnt++; + } +} + +static FontTable *font_lookup(int size, int type) { + int i; + + for (i = 0; i < fontcnt; i++) { + if (fonttbl[i].size == size && fonttbl[i].type == type) { + return &fonttbl[i]; + } + } + return NULL; +} + +static void font_ttf_sel_font(int type, int size) { + FontTable *tbl; + + // check too big size + if (size > (GLYPH_PIXMAP_HEIGHT - 10)) { + size = GLYPH_PIXMAP_HEIGHT - 10; + } + + if (NULL == (tbl = font_lookup(size, type))) { + char *name; + FT_Error err; + FT_Face face; + + if (type > FONTTYPEMAX) type = FONT_GOTHIC; + + name = this->name[type]; + + err = FT_New_Face(eng, name, this->face[type], &face); + if (err) { + WARNING("face %d is not found. retry 0", this->face[type]); + err = FT_New_Face(eng, name, 0, &face); + } + NOTICE("TTF open %s size %d\n", name, size); + if (err) { + WARNING("%s is not found\n", name); + return; + } + + select_charmap(face, type); + + err = FT_Set_Pixel_Sizes(face, 0, size); + if (err) { + WARNING("TTfont %s contains only fixed size(%d) font.\n",name, face->size); + return; + } + + font_insert(size, type, face); + fontset = &fonttbl[fontcnt -1]; + } else { + fontset = tbl; + } +} + +static void pixmap2comimg(BYTE *src, int x, int y, int w, int h, int src_bpl) { + int yy; + BYTE *dst = GETOFFSET_PIXEL(&img_glyph, x, y); + + for (yy = 0; yy < h; yy++) { + memcpy(dst, src, w); + src += src_bpl; + dst += img_glyph.bytes_per_line; + } +} + +static void pixmapmono2comimg(BYTE *src, int x, int y, int w, int h, int src_bpl) { + int i, xx, yy; + int w1,w2; + BYTE *dst = GETOFFSET_PIXEL(&img_glyph, x, y); + unsigned int ch; + + w1 = w / 8; + w2 = w % 8; + for (yy = 0; yy < h; yy++) { + ch = *src; + for (xx = 0; xx < w1; xx++){ + + for (i = 0; i < 8; i++){ + *(dst + i + xx * 8) = (ch & 0x80 ? 255 : 0); + ch <<= 1; + } + ch = *(src + xx + 1); + } + for (i = 0; i < w2; i++){ + *(dst + i + w1 * 8) = (ch & 0x80 ? 255 : 0); + ch <<= 1; + } + src += src_bpl; + dst += img_glyph.bytes_per_line; + } +} + +static void clear_canvas(void) { + memset(img_glyph.pixel, 0, GLYPH_PIXMAP_WIDTH * GLYPH_PIXMAP_HEIGHT); +} + +static void *font_ttf_get_glyph(unsigned char *_msg) { + FT_GlyphSlot slot; + FT_UShort code; + FT_Error err; + FT_Pixel_Mode pixelmode; + FT_Int loadflag; + int x = 0; + unsigned char *msg = _msg; + + if (fontset == NULL) return &img_glyph; + + clear_canvas(); + + while (*msg) { + code = this->codeconv[fontset->type](&msg); + + if (this->antialiase_on) { + loadflag = FT_LOAD_RENDER; + // if( 埋め込みビットマップを使いたくない時) + // loadglag |= FT_LOAD_NO_BITMAP; + } else { + loadflag = (FT_LOAD_RENDER | FT_LOAD_MONOCHROME); + } + + err = FT_Load_Char(fontset->face, code, loadflag); + /* gray scaleでもモノクロでもない埋め込みビットマップは使わず、 + アウトラインフォントを使用 */ + pixelmode = fontset->face->glyph->bitmap.pixel_mode ; + if (!err && + pixelmode != ft_pixel_mode_mono && + pixelmode != ft_pixel_mode_grays){ + WARNING("Not supported type embeded bitmap font!!!"); + err = FT_Load_Char(fontset->face, code, loadflag | FT_LOAD_NO_BITMAP); + pixelmode = fontset->face->glyph->bitmap.pixel_mode; + } + + if (err) continue; + + slot = fontset->face->glyph; + + // lazy check, but needed + if (x + fontset->size > GLYPH_PIXMAP_WIDTH) { + break; + } + + if (pixelmode == ft_pixel_mode_grays) { + pixmap2comimg(slot->bitmap.buffer, + x + slot->bitmap_left, + max(0, fontset->size * 0.9 - slot->metrics.horiBearingY/64), + slot->bitmap.width, + slot->metrics.height/64, + slot->bitmap.pitch); + } else if (pixelmode == ft_pixel_mode_mono) { + pixmapmono2comimg(slot->bitmap.buffer, + x + slot->bitmap_left, + max(0, fontset->size * 0.9 - slot->metrics.horiBearingY/64), + slot->bitmap.width, + slot->metrics.height/64, + slot->bitmap.pitch); + } + x += slot->metrics.horiAdvance/64; + } + + img_glyph.width = x; + img_glyph.height = fontset->size; + + return &img_glyph; +} + +static int font_ttf_draw_glyph(int x, int y, unsigned char *str, int col) { + return 0; +} + +static boolean drawable() { + return FALSE; +} + +FONT *font_ft2_new() { + int err; + FONT *f = g_new(FONT, 1); + + f->sel_font = font_ttf_sel_font; + f->get_glyph = font_ttf_get_glyph; + f->draw_glyph = font_ttf_draw_glyph; + f->self_drawable = drawable; + f->antialiase_on = FALSE; + + err = FT_Init_FreeType(&eng); + + img_glyph.width = GLYPH_PIXMAP_WIDTH; + img_glyph.height = GLYPH_PIXMAP_HEIGHT; + img_glyph.bytes_per_line = GLYPH_PIXMAP_WIDTH; + img_glyph.depth = 8; + img_glyph.bytes_per_pixel = 1; + img_glyph.pixel = g_malloc(GLYPH_PIXMAP_WIDTH * GLYPH_PIXMAP_HEIGHT); + + this = f; + + NOTICE("FontDevice freetype2\n"); + + return f; +} diff --git a/src/font_gtk.c b/src/font_gtk.c new file mode 100644 index 0000000..cc7c99a --- /dev/null +++ b/src/font_gtk.c @@ -0,0 +1,231 @@ +/* + * font_gtk.c access to gtk(gdk) font device + * + * Copyright (C) 2000- Fumihiko Murata + * (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * NOTE: + * sdl_core.c から移動。また、その際 sdl に依存しないようにした。 + * +*/ +/* $Id: font_gtk.c,v 1.8 2003/01/25 01:34:50 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "font.h" +#include "ags.h" +#include "eucsjis.h" +#include "antialiase.h" +#include "image.h" + +#ifndef GTK_CHECK_VERSION +#define GTK_CHECK_VERSION(major,minor,micro) \ +(GTK_MAJOR_VERSION > (major) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION > (minor)) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION == (minor) && \ + GTK_MICRO_VERSION >= (micro))) +#endif /* !GTK_CHECK_VERSION */ + +#if defined (GTK_CHECK_VERSION) && GTK_CHECK_VERSION (1,2,0) +#define GTKV12 +#else +#define GTKV10 +#endif + +/* fontset の為の情報 */ +typedef struct { + int size; + int type; + GdkFont *id; +} FontTable; + +#define FONTTABLEMAX 256 +static FontTable fonttbl[FONTTABLEMAX]; +static int fontcnt = 0; +static GdkFont *fontset; +static int font_ascent, font_descent; + +static GtkWidget *mainwin; +static int gdk_depth = 0; +static agsurface_t img_glyph; + +static FONT *this; + +#define GLYPH_PIXMAP_WIDTH 800 /* 文字イメージを取得する為のPixmapの大きさ */ +#define GLYPH_PIXMAP_HEIGHT 150 + +static void font_insert(int size, int type, GdkFont *fontset) { + fonttbl[fontcnt].size = size; + fonttbl[fontcnt].type = type; + fonttbl[fontcnt].id = fontset; + + if (fontcnt >= (FONTTABLEMAX -1)) { + WARNING("Font table is full.\n"); + } else { + fontcnt++; + } +} + +static FontTable *font_lookup(int size, int type) { + int i; + + for (i = 0; i < fontcnt; i++) { + if (fonttbl[i].size == size && fonttbl[i].type == type) { + return &fonttbl[i]; + } + } + return NULL; +} + +static void font_gtk_sel_font(int type, int size) { + FontTable *tbl; + + if (NULL == (tbl = font_lookup(size, type))) { + char name[256]; + + if (type > 3) type = FONT_GOTHIC; + + g_snprintf(name, sizeof(name), this->name[type], size, size); + + fontset = gdk_fontset_load(name); + if (fontset == NULL) { + SYSERROR("can't load font %s\n", name); + } + font_insert(size, type, fontset); + } else { + fontset = tbl->id; + } + + font_ascent = fontset->ascent; + font_descent = fontset->descent; +} + +static void *font_gtk_get_glyph(unsigned char *str) { + agsurface_t *dst; + int h, w, l; + BYTE *conv; + + GdkPixmap *pix_gdk; + GdkGC *gc_gdk; + GdkImage *img_gdk; + GdkColor col_gdk; + + + /* convert string code from sjis to euc (or LANG) */ + conv = sjis2lang(str); + + l = strlen(conv); + w = gdk_text_width(fontset, conv, l); + + if (w == 0) { + free(conv); + return NULL; + } + +#ifdef GTKV12 + h = gdk_text_height(fontset, conv, l); +#else + h = font_ascent + fontset->ascent; +#endif + + if (w > GLYPH_PIXMAP_WIDTH) w = GLYPH_PIXMAP_WIDTH; + if (h > GLYPH_PIXMAP_HEIGHT) h = GLYPH_PIXMAP_HEIGHT; + + pix_gdk = gdk_pixmap_new(mainwin->window, w, h, gdk_depth); + gc_gdk = gdk_gc_new(pix_gdk); + + /* color */ + col_gdk.pixel = 0; + gdk_gc_set_foreground(gc_gdk, &col_gdk); + // gdk_gc_set_background(gc_gdk, &col_gdk); + gdk_draw_rectangle(pix_gdk, gc_gdk, TRUE, 0, 0, w, h); + + col_gdk.pixel = 1; + gdk_gc_set_foreground(gc_gdk, &col_gdk); + gdk_draw_text(pix_gdk, fontset, gc_gdk, 0, fontset->ascent, conv, l); + + gdk_gc_destroy(gc_gdk); + img_gdk = gdk_image_get(&((GdkWindowPrivate *)pix_gdk)->window, + 0, 0, w, h); + gdk_pixmap_unref(pix_gdk); + + dst = g_new(agsurface_t, 1); + + dst->width = w; + dst->height = h; + dst->bytes_per_pixel = (img_gdk->bpp+1)/8; /* むーん */ + dst->bytes_per_line = img_gdk->bpl; + dst->pixel = img_gdk->mem; + + image_get_glyph(dst, &img_glyph); + + if (this->antialiase_on) { + aa_make(img_glyph.pixel, w, dst->height, img_glyph.bytes_per_line); + } + + img_glyph.width = w; + img_glyph.height = h; + + g_free(dst); + g_free(conv); + gdk_image_destroy(img_gdk); + + return &img_glyph; +} + +static int font_gtk_draw_glyph(int x, int y, unsigned char *str, int col) { + return 0; +} + +static boolean drawable() { + return FALSE; +} + +FONT *font_gtk_new() { + FONT *f = g_new(FONT, 1); + + f->sel_font = font_gtk_sel_font; + f->get_glyph = font_gtk_get_glyph; + f->draw_glyph = font_gtk_draw_glyph; + f->self_drawable = drawable; + f->antialiase_on = FALSE; + + mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gdk_depth = gdk_visual_get_best_depth(); + + img_glyph.width = GLYPH_PIXMAP_WIDTH; + img_glyph.height = GLYPH_PIXMAP_HEIGHT; + img_glyph.bytes_per_line = GLYPH_PIXMAP_WIDTH; + img_glyph.depth = 8; + img_glyph.bytes_per_pixel = 1; + img_glyph.pixel = g_malloc(GLYPH_PIXMAP_WIDTH * GLYPH_PIXMAP_HEIGHT); + + this = f; + + NOTICE("FontDevice gtk\n"); + + return f; +} diff --git a/src/font_sdlttf.c b/src/font_sdlttf.c new file mode 100644 index 0000000..82df508 --- /dev/null +++ b/src/font_sdlttf.c @@ -0,0 +1,120 @@ +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "font.h" + +typedef struct { + int size; + int type; + TTF_Font *id; +} FontTable; + +#define FONTTABLEMAX 256 +static FontTable fonttbl[FONTTABLEMAX]; +static int fontcnt = 0; + +static TTF_Font *fontset; + +static FONT *this; + +static void font_insert(int size, int type, ttfont *fontset) { + fonttbl[fontcnt].size = size; + fonttbl[fontcnt].type = type; + fonttbl[fontcnt].id = fontset; + + if (fontcnt >= (FONTTABLEMAX -1)) { + WARNING("Font table is full.\n"); + } else { + fontcnt++; + } +} + +static FontTable *font_lookup(int size, int type) { + int i; + + for (i = 0; i < fontcnt; i++) { + if (fonttbl[i].size == size && fonttbl[i].type == type) { + return &fonttbl[i]; + } + } + return NULL; +} + +static void font_ttf_sel_font(int type, int size) { + FontTable *tbl; + + + if (NULL == (tbl = font_lookup(size, type))) { + TTF_Font *fs; + + fs = TTF_OpenFont(this->name[type], size); + + if (fs == NULL) { + WARNING("%s is not found:\n", this->name[type]); + return; + } + + font_insert(size, type, fs); + fontset = fs; + } else { + fontset = tbl->id; + } +} + +static void *font_sdlttf_get_glyph(unsigned char *msg) { +} + +static int font_sdlttf_draw_glyph(int x, int y, unsigned char *str, int cl) { + SDL_Surface *fs; + SDL_Color fg; + SDL_Rect r_src, r_dst; + int w, h; + + fg = SDL_MapRGB(sdl_dib->format, + sdl_col[cl].r, sdl_col[cl].g, sdl_col[cl].b); + + if (this->antialiase_on) { + fs = TTF_RenderText_Shaded(fontset, str, cl); + } else { + fs = TTF_RenderText_Solid(fonset, str, cl); + } + + TTF_SizeText(fontset, str, &w, &h); + + setRect(r_src, 0, 0, w, h); + setRect(r_dst, x, y, w, h); + + SDL_LockSurface(sdl_dib); + SDL_BlitSurface(fs, &r_src, sdl_dib, &r_dst); + SDL_UnlockSurface(sdl_dib); + + return w; +} + +static boolean drawable() { + return TRUE; +} + +FONT *font_ttf_new() { + FONT *f = g_new(FONT, 1); + + f->sel_font = font_sdlttf_sel_font; + f->get_glyph = font_sdlttf_get_glyph; + f->draw_glyph = font_sdlttf_draw_glyph; + f->self_drawable = drawable; + f->antialiase_on = FALSE; + + for (i = 0; i < 4; i++) { + fontmaps[i].etype = -1; + } + + TTF_Init(); + + this = f; + + return f; +} diff --git a/src/font_ttf.c b/src/font_ttf.c new file mode 100644 index 0000000..0bda51f --- /dev/null +++ b/src/font_ttf.c @@ -0,0 +1,313 @@ +/* + * font_ttf.c access to ttf font device + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: font_ttf.c,v 1.6 2002/09/18 13:16:22 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#ifdef FREETYPE_HAVE_DIR +#include +#include +#else +#include +#include +#endif + +#include "portab.h" +#include "system.h" +#include "font.h" +#include "ags.h" +#include "s2utbl.h" + +typedef struct { + int fnn; + int size, ysize; + TT_Face face; + TT_Face_Properties pp; + TT_Glyph glyph; + TT_Instance inst; + TT_Matrix mat; + TT_Raster_Map r; +} ttfont; + +typedef struct { + int etype; /* font char map ... sjis:0, unicode:1 */ + TT_CharMap map; +} ttmap; + +typedef struct { + int size; + int type; + ttfont *id; +} FontTable; + +#define FONTTABLEMAX 256 +static FontTable fonttbl[FONTTABLEMAX]; +static int fontcnt = 0; +static TT_Engine eng; +static ttfont *fontset; +static ttmap fontmaps[4]; +static TT_Byte rpal_na[5]={ 0, 0, 0xff, 0xff, 0xff}; +static TT_Byte rpal_an[5]={0x20, 0x3f, 0xc0, 0xf0, 0xff}; + +#define GLYPH_PIXMAP_WIDTH 800 /* 文字イメージを取得する為のPixmapの大きさ */ +#define GLYPH_PIXMAP_HEIGHT 150 + +static agsurface_t img_glyph; + +static FONT *this; + +static void font_insert(int size, int type, ttfont *fontset) { + fonttbl[fontcnt].size = size; + fonttbl[fontcnt].type = type; + fonttbl[fontcnt].id = fontset; + + if (fontcnt >= (FONTTABLEMAX -1)) { + WARNING("Font table is full.\n"); + } else { + fontcnt++; + } +} + +static FontTable *font_lookup(int size, int type) { + int i; + + for (i = 0; i < fontcnt; i++) { + if (fonttbl[i].size == size && fonttbl[i].type == type) { + return &fonttbl[i]; + } + } + return NULL; +} + +static void font_ttf_sel_font(int type, int size) { + FontTable *tbl; + + + if (NULL == (tbl = font_lookup(size, type))) { + char *name; + ttfont *fs; + TT_Error err; + int i, map_sjis = 0, map_uni = 0; + TT_UShort platform, encoding; + TT_Instance_Metrics imt; + + if (type > 3) type = FONT_GOTHIC; + + name = this->name[type]; + + fs = g_new0(ttfont, 1); + fs->fnn = type; + fs->size = size; + + err = TT_Open_Face(eng, name, &fs->face); + NOTICE("TTF open %s size %d\n", name, size); + if (err) { + WARNING("%s is not found: %s\n", name, TT_ErrToString18(err)); + g_free(fs); + return; + } + + TT_Get_Face_Properties(fs->face, &fs->pp); + fs->ysize = (fs->pp.header->yMax * size) / (fs->pp.header->yMax - fs->pp.header->yMin + 1); + + err = TT_New_Glyph(fs->face, &fs->glyph); + if (err) { + WARNING("TTfont %s couldn't create glyph container: %s\n",name, TT_ErrToString18(err)); + g_free(fs); + return; + } + err = TT_New_Instance(fs->face, &fs->inst); + err = TT_Set_Instance_Resolutions(fs->inst, 76, 76); + err = TT_Set_Instance_CharSize(fs->inst, size*64); + + /* character map is sjis or unicode */ + if (fontmaps[type].etype < 0) { + for (i = 0; i < TT_Get_CharMap_Count(fs->face); i++) { + TT_Get_CharMap_ID(fs->face, i, &platform, &encoding); + if (platform == TT_PLATFORM_MICROSOFT) { + if (encoding == TT_MS_ID_SJIS) map_sjis = i + 1; + if (encoding == TT_MS_ID_UNICODE_CS) map_uni = i + 1; + } + } + if (map_sjis) { + fontmaps[type].etype = 0; + TT_Get_CharMap(fs->face, map_sjis -1, &fontmaps[type].map); + } else if (map_uni) { + fontmaps[type].etype = 1; + TT_Get_CharMap(fs->face, map_uni -1, &fontmaps[type].map); + } + } + + TT_Get_Instance_Metrics(fs->inst, &imt); + fs->r.rows = size; + fs->r.width = size; + fs->r.flow = TT_Flow_Up; + fs->r.cols = size + 3; + fs->r.size = fs->r.rows * fs->r.cols; + fs->r.bitmap = g_malloc((int)fs->r.size); + font_insert(size, type, fs); + fontset = fs; + } else { + fontset = tbl->id; + } +} + +static void pixmap2comimg(BYTE *src, int x, int y, int w, int h, int src_bpl) { + int yy; + BYTE *dst = GETOFFSET_PIXEL(&img_glyph, x, y + h - 2); /* must be -1 XXX */ + + for (yy = 0; yy < h; yy++) { + memcpy(dst, src, w); + src += src_bpl; + dst -= img_glyph.bytes_per_line; + } +} + +static void clear_canvas(void) { + memset(img_glyph.pixel, 0, GLYPH_PIXMAP_WIDTH * GLYPH_PIXMAP_HEIGHT); +} + +static void *font_ttf_get_glyph(unsigned char *msg) { + TT_UShort code; + guint16 w = 0; + int ww, hh; + int index; + TT_Glyph_Metrics mt; + TT_Error err; + int x = 0; + + boolean isHalfWidth = FALSE; /* half width character ? */ + + clear_canvas(); + + if (this->antialiase_on) { + TT_Set_Raster_Gray_Palette(eng, rpal_an); + } else { + TT_Set_Raster_Gray_Palette(eng, rpal_na); + } + + while(*msg) { + if (fontmaps[fontset->fnn].etype) { + /* sjis to unicode */ + if (*msg >= 0xa0 && *msg <= 0xdf) { + code = 0xff60 + *(msg++) - 0xa0; + isHalfWidth = TRUE; + } else if( *msg&0x80 ) { + code = s2u[msg[0] - 0x80][msg[1] - 0x40]; + msg+=2; + isHalfWidth = FALSE; + } else { + code = *(msg++); + isHalfWidth = TRUE; + } + } else { + if (*msg >= 0xa0 && *msg <= 0xdf) { + code = *(msg++); + isHalfWidth = TRUE; + } else if (*msg & 0x80) { + code = (msg[0] << 8) + msg[1]; + msg += 2; + isHalfWidth = FALSE; + } else { + code = *(msg++); + isHalfWidth = TRUE; + } + } + + index = TT_Char_Index(fontmaps[fontset->fnn].map, code); + if (!(err = TT_Load_Glyph(fontset->inst, fontset->glyph, index, TTLOAD_DEFAULT)) ) { + TT_Get_Glyph_Metrics(fontset->glyph, &mt); + + memset(fontset->r.bitmap, 0, fontset->r.size); + TT_Get_Glyph_Pixmap(fontset->glyph, &fontset->r, + -mt.bbox.xMin, -mt.bbox.yMin); + + ww = (mt.bbox.xMax - mt.bbox.xMin) / 64; + if (ww > fontset->r.cols) ww = fontset->size; + + hh = (mt.bbox.yMax - mt.bbox.yMin) / 64; + if (hh > fontset->r.rows) hh = fontset->size; + + pixmap2comimg(fontset->r.bitmap, + x + mt.bbox.xMin/64, fontset->size - mt.bbox.yMax/64, + ww, hh, fontset->r.cols); + + if (isHalfWidth) { + x += (fontset->size / 2); + w += (fontset->size / 2); + } else { + x += fontset->size; + w += fontset->size; + } + } + } + + img_glyph.width = x; + img_glyph.height = fontset->size; + + return &img_glyph; +} + +static int font_ttf_draw_glyph(int x, int y, unsigned char *str, int col) { + return 0; +} + +static boolean drawable() { + return FALSE; +} + +FONT *font_ttf_new() { + int err, i; + FONT *f = g_new(FONT, 1); + + f->sel_font = font_ttf_sel_font; + f->get_glyph = font_ttf_get_glyph; + f->draw_glyph = font_ttf_draw_glyph; + f->self_drawable = drawable; + f->antialiase_on = FALSE; + + for (i = 0; i < 4; i++) { + fontmaps[i].etype = -1; + } + err = TT_Init_FreeType(&eng); +#if 0 + if (err >= 0) { + TT_Set_Raster_Gray_Palette(eng, rpal); + } +#endif + + img_glyph.width = GLYPH_PIXMAP_WIDTH; + img_glyph.height = GLYPH_PIXMAP_HEIGHT; + img_glyph.bytes_per_line = GLYPH_PIXMAP_WIDTH; + img_glyph.depth = 8; + img_glyph.bytes_per_pixel = 1; + img_glyph.pixel = g_malloc(GLYPH_PIXMAP_WIDTH * GLYPH_PIXMAP_HEIGHT); + + this = f; + + NOTICE("FontDevice freetype 1.x\n"); + + return f; +} diff --git a/src/font_x11.c b/src/font_x11.c new file mode 100644 index 0000000..6a37629 --- /dev/null +++ b/src/font_x11.c @@ -0,0 +1,249 @@ +/* + * font_x11.c access to x11 font device + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: font_x11.c,v 1.11 2003/01/31 12:58:28 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "font.h" +#include "ags.h" +#include "xcore.h" +#include "xcore_private.h" +#include "eucsjis.h" +#include "antialiase.h" + +/* fontset の為の情報 */ +typedef struct { + int size; + int type; + XFontSet id; +} FontTable; + +#define FONTTABLEMAX 256 +static FontTable fonttbl[FONTTABLEMAX]; +static int fontcnt = 0; +static XFontSet fontset; +static int font_ascent, font_descent; + +/* Font Glyph を取得するためのPixmapとGC */ +static Pixmap pix_glyph; +static GC gc_pix_glyph; +static agsurface_t img_glyph; + +static FONT *this; + +#define GLYPH_PIXMAP_WIDTH 800 /* 文字イメージを取得する為のPixmapの大きさ */ +#define GLYPH_PIXMAP_HEIGHT 150 + +static void font_insert(int size, int type, XFontSet fontset) { + fonttbl[fontcnt].size = size; + fonttbl[fontcnt].type = type; + fonttbl[fontcnt].id = fontset; + + if (fontcnt >= (FONTTABLEMAX -1)) { + WARNING("Font table is full.\n"); + } else { + fontcnt++; + } +} + +static FontTable *font_lookup(int size, int type) { + int i; + + for (i = 0; i < fontcnt; i++) { + if (fonttbl[i].size == size && fonttbl[i].type == type) { + return &fonttbl[i]; + } + } + return NULL; +} + +static void font_x11_sel_font(int type, int size) { + XFontStruct **font_structs; + char **font_names; + int i, num_fonts; + FontTable *tbl; + + if (NULL == (tbl = font_lookup(size, type))) { + char name[256]; + char **miss, *def; + int n_miss; + XFontSet fs; + + if (type > 3) type = FONT_GOTHIC; + + /* set size */ + g_snprintf(name, sizeof(name), this->name[type], size, size); + + fs = XCreateFontSet(x11_display, name, &miss, &n_miss, &def); + if (n_miss > 0) { + for (i = 0; i < n_miss; i++) { + WARNING("can't load font %s\n", miss[i]); + } + XFreeStringList(miss); + SYSERROR("Font Load failed\n"); + } + font_insert(size, type, fs); + fontset = fs; + } else { + fontset = tbl->id; + } + + /* 最大のフォントの高さの取得 */ + num_fonts = XFontsOfFontSet(fontset, &font_structs, &font_names); + font_ascent = font_descent = 0; + for (i = 0; i < num_fonts; i++) { + font_ascent = max(font_ascent, font_structs[i]->ascent); + font_descent = max(font_descent, font_structs[i]->descent); + } +} + +static agsurface_t *get_drawn_glyph(const char *str, int w) { + XImage *src; + agsurface_t *dst; + + XSetForeground(x11_display, gc_pix_glyph, 0); + XFillRectangle(x11_display, pix_glyph, gc_pix_glyph, 0, 0, GLYPH_PIXMAP_WIDTH, GLYPH_PIXMAP_HEIGHT); + + XSetForeground(x11_display, gc_pix_glyph, 1); + XmbDrawString(x11_display, pix_glyph, fontset, gc_pix_glyph, 0, font_ascent, str, strlen(str)); + + src = XGetImage(x11_display, pix_glyph, 0, 0, w, font_ascent + font_descent, AllPlanes, ZPixmap); + + dst = g_new(agsurface_t, 1); + + dst->width = w; + dst->height = font_ascent + font_descent; + dst->bytes_per_line = src->bytes_per_line; + dst->pixel = (BYTE *)src->data; + dst->bytes_per_pixel = x11_workinfo->cimg.bytes_per_pixel; + + src->data = NULL; + XDestroyImage(src); + + return dst; +} + +static void *font_x11_get_glyph(unsigned char *str) { + agsurface_t *dst; + int w; + BYTE *conv; + + /* convert string code from sjis to euc (or LANG) */ + conv = sjis2lang(str); + + w = XmbTextEscapement(fontset, conv, strlen(conv)); + + if (w == 0) { + free(conv); + return NULL; + } + + dst = get_drawn_glyph(conv, w); + image_get_glyph(dst, &img_glyph); + + if (this->antialiase_on) { + aa_make(img_glyph.pixel, w, dst->height, img_glyph.bytes_per_line); + } + + img_glyph.width = dst->width; + img_glyph.height = dst->height; + + free(dst->pixel); + g_free(dst); + free(conv); + return &img_glyph; +} + +static int font_x11_draw_glyph(int x, int y, unsigned char *str, int col) { + int w; + BYTE *conv; + + /* convert string code from sjis to euc (or LANG) */ + conv = sjis2lang(str); + + w = XmbTextEscapement(fontset, conv, strlen(conv)); + + if (w == 0) { + free(conv); + return 0; + } + + if (!x11_dibinfo->shared) { + /* 一度 Pixmap に書いてからイメージを取得してDIBへ */ + agsurface_t *dst = get_drawn_glyph(conv, w); + + if (DIB_DEPTH == dib_depth_candidate) { + image_getGlyphImage(DIB, dst, x, y, PAL2PIC(col)); + } else { + image_getGlyphImageNto8(DIB, dst, x, y, col); + } + g_free(dst); + } else { + Xcore_setForeground(col); + XmbDrawString(x11_display, x11_pixmap, fontset, x11_gc_pix, x, y + font_ascent, conv, strlen(conv)); + x11_needSync = TRUE; + } + return w; +} + +static boolean drawable() { + return !this->antialiase_on; +} + + +FONT *font_x11_new() { + FONT *f = g_new(FONT, 1); + + f->sel_font = font_x11_sel_font; + f->get_glyph = font_x11_get_glyph; + f->draw_glyph = font_x11_draw_glyph; + f->self_drawable = drawable; + f->antialiase_on = FALSE; + + /* Glyph取得のためのPixmapとGCとagsurface_tを用意 */ + pix_glyph = XCreatePixmap(x11_display, x11_window, + GLYPH_PIXMAP_WIDTH, GLYPH_PIXMAP_HEIGHT, WIN_DEPTH); + gc_pix_glyph = XCreateGC(x11_display, pix_glyph, 0, 0); + + img_glyph.width = GLYPH_PIXMAP_WIDTH; + img_glyph.height = GLYPH_PIXMAP_HEIGHT; + img_glyph.bytes_per_line = GLYPH_PIXMAP_WIDTH; + img_glyph.depth = 8; + img_glyph.bytes_per_pixel = 1; + img_glyph.pixel = g_malloc(GLYPH_PIXMAP_WIDTH * GLYPH_PIXMAP_HEIGHT); + + this = f; + + NOTICE("FontDevice X11\n"); + + return f; +} diff --git a/src/gametitle.h b/src/gametitle.h new file mode 100644 index 0000000..6c23aea --- /dev/null +++ b/src/gametitle.h @@ -0,0 +1,4 @@ +#define GT_TOSHIN2 "���_�s�s�U�@�������@�v�����X�T�@" +#define GT_RANCE4 "�q���������S�@�|���c�����Y�|�@�e�����@�v�����X�T�@" +#define GT_RANCE5D "�����X�T�c�@�iSR�j" +#define GT_ESUKA "-BeatAngelEscalayer-" diff --git a/src/graphics.h b/src/graphics.h new file mode 100644 index 0000000..e909d45 --- /dev/null +++ b/src/graphics.h @@ -0,0 +1,63 @@ +/* + * graphics.h graphics related definition + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: graphics.h,v 1.24 2000/11/25 13:09:04 chikama Exp $ */ + +#ifndef __GRAPHICS__ +#define __GRAPHICS__ + +#include "portab.h" + +typedef struct { + BYTE red[256]; + BYTE green[256]; + BYTE blue[256]; +} Pallet256; + +typedef struct { + BYTE r,g,b; + DWORD pixel; +} Pallet; + +typedef struct { + int x; + int y; +} MyPoint; + +typedef struct { + int width; + int height; +} MyDimension; + +typedef struct { + int x; + int y; + int width; + int height; +} MyRectangle; + +typedef struct { + int width; + int height; + int depth; +} DispInfo; + +#endif /* !__GRAPHICS__ */ diff --git a/src/graphicsdevice.h b/src/graphicsdevice.h new file mode 100644 index 0000000..9bc0397 --- /dev/null +++ b/src/graphicsdevice.h @@ -0,0 +1,35 @@ +/* + * graphicdevice.h 実際の graphicデバイスのinclude + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: graphicsdevice.h,v 1.6 2006/04/21 16:40:48 chikama Exp $ */ + +#ifndef __GRAPHICDEVICE__ +#define __GRAPHICDEVICE__ + +#include "config.h" + +#if ENABLE_SDL +#include "sdl_core.h" +#else +#include "xcore.h" +#endif + +#endif /* !__GRAPHICDEVICE__ */ diff --git a/src/hankaku.c b/src/hankaku.c new file mode 100644 index 0000000..b3dca9d --- /dev/null +++ b/src/hankaku.c @@ -0,0 +1,674 @@ +/* + * hankaku.c 全角->半角変換 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * +*/ +/* $Id: hankaku.c,v 1.7 2001/03/22 11:10:13 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" + +/* defined by hankan2sjis.c */ +extern char *hankana2sjis(int index); + +static BYTE hankakutable[3][192][2] = {{ + {0x00, 0x20}, /* SPC */ + {0x00, 0xa4}, /* 、 */ + {0x00, 0xa2}, /* 。 */ + {0x00, 0x2c}, /* , */ + {0x00, 0x2e}, /* . */ + {0x00, 0xa5}, /* ・ */ + {0x00, 0x3a}, /* : */ + {0x00, 0x3b}, /* ; */ + {0x00, 0x3f}, /* ? */ + {0x00, 0x21}, /* ! */ + {0x00, 0xde}, /* ゛ */ + {0x00, 0xdf}, /* ゜ */ + {0x00, 0x27}, /* ' */ + {0x00, 0x60}, /* ` */ + {0x81, 0x4e}, + {0x00, 0x5d}, /* ^ */ + {0x00, 0x7e}, /* ~ */ + {0x00, 0x5f}, /* _ */ + {0x81, 0x52}, + {0x81, 0x53}, + {0x81, 0x54}, + {0x81, 0x55}, + {0x81, 0x56}, + {0x81, 0x57}, + {0x81, 0x58}, + {0x81, 0x59}, + {0x81, 0x5a}, + {0x00, 0xb0}, /* ー */ + {0x81, 0x5c}, + {0x81, 0x5d}, + {0x00, 0x2f}, /* / */ + {0x81, 0x5f}, + {0x81, 0x60}, + {0x81, 0x61}, + {0x00, 0x7c}, /* | */ + {0x81, 0x63}, + {0x81, 0x64}, + {0x81, 0x65}, + {0x00, 0x27}, /* ' */ + {0x81, 0x67}, + {0x00, 0x22}, /* ″ */ + {0x00, 0x28}, /* ( */ + {0x00, 0x29}, /* ) */ + {0x81, 0x6b}, + {0x81, 0x6c}, + {0x00, 0x5b}, /* [ */ + {0x00, 0x5d}, /* ] */ + {0x00, 0x7b}, /* { */ + {0x00, 0x7d}, /* } */ + {0x81, 0x71}, + {0x81, 0x72}, + {0x81, 0x73}, + {0x81, 0x74}, + {0x00, 0xa2}, /* 「 */ + {0x00, 0xa3}, /* 」 */ + {0x81, 0x77}, + {0x81, 0x78}, + {0x81, 0x79}, + {0x81, 0x7a}, + {0x00, 0x2b}, /* + */ + {0x00, 0x2d}, /* - */ + {0x81, 0x7d}, + {0x81, 0x7e}, + {0x81, 0x7f}, + {0x81, 0x80}, + {0x00, 0x3d}, /* = */ + {0x81, 0x82}, + {0x00, 0x3c}, /* < */ + {0x00, 0x3e}, /* > */ + {0x81, 0x85}, + {0x81, 0x86}, + {0x81, 0x87}, + {0x81, 0x88}, + {0x81, 0x89}, + {0x81, 0x8a}, + {0x81, 0x8b}, + {0x81, 0x8c}, + {0x81, 0x8d}, + {0x81, 0x8e}, + {0x00, 0x5c}, /* ¥ */ + {0x00, 0x24}, /* $ */ + {0x81, 0x91}, + {0x81, 0x92}, + {0x00, 0x25}, /* % */ + {0x00, 0x23}, /* # */ + {0x00, 0x26}, /* & */ + {0x00, 0x2a}, /* * */ + {0x00, 0x40}, /* @ */ + {0x81, 0x98}, + {0x81, 0x99}, + {0x81, 0x9a}, + {0x81, 0x9b}, + {0x81, 0x9c}, + {0x81, 0x9d}, + {0x81, 0x9e}, + {0x81, 0x9f}, + {0x81, 0xa0}, + {0x81, 0xa1}, + {0x81, 0xa2}, + {0x81, 0xa3}, + {0x81, 0xa4}, + {0x81, 0xa5}, + {0x81, 0xa6}, + {0x81, 0xa7}, + {0x81, 0xa8}, + {0x81, 0xa9}, + {0x81, 0xaa}, + {0x81, 0xab}, + {0x81, 0xac}, + {0x81, 0xad}, + {0x81, 0xae}, + {0x81, 0xaf}, + {0x81, 0xb0}, + {0x81, 0xb1}, + {0x81, 0xb2}, + {0x81, 0xb3}, + {0x81, 0xb4}, + {0x81, 0xb5}, + {0x81, 0xb6}, + {0x81, 0xb7}, + {0x81, 0xb8}, + {0x81, 0xb9}, + {0x81, 0xba}, + {0x81, 0xbb}, + {0x81, 0xbc}, + {0x81, 0xbd}, + {0x81, 0xbe}, + {0x81, 0xbf}, + {0x81, 0xc0}, + {0x81, 0xc1}, + {0x81, 0xc2}, + {0x81, 0xc3}, + {0x81, 0xc4}, + {0x81, 0xc5}, + {0x81, 0xc6}, + {0x81, 0xc7}, + {0x81, 0xc8}, + {0x81, 0xc9}, + {0x81, 0xca}, + {0x81, 0xcb}, + {0x81, 0xcc}, + {0x81, 0xcd}, + {0x81, 0xce}, + {0x81, 0xcf}, + {0x81, 0xd0}, + {0x81, 0xd1}, + {0x81, 0xd2}, + {0x81, 0xd3}, + {0x81, 0xd4}, + {0x81, 0xd5}, + {0x81, 0xd6}, + {0x81, 0xd7}, + {0x81, 0xd8}, + {0x81, 0xd9}, + {0x81, 0xda}, + {0x81, 0xdb}, + {0x81, 0xdc}, + {0x81, 0xdd}, + {0x81, 0xde}, + {0x81, 0xdf}, + {0x81, 0xe0}, + {0x81, 0xe1}, + {0x81, 0xe2}, + {0x81, 0xe3}, + {0x81, 0xe4}, + {0x81, 0xe5}, + {0x81, 0xe6}, + {0x81, 0xe7}, + {0x81, 0xe8}, + {0x81, 0xe9}, + {0x81, 0xea}, + {0x81, 0xeb}, + {0x81, 0xec}, + {0x81, 0xed}, + {0x81, 0xee}, + {0x81, 0xef}, + {0x81, 0xf0}, + {0x81, 0xf1}, + {0x81, 0xf2}, + {0x81, 0xf3}, + {0x81, 0xf4}, + {0x81, 0xf5}, + {0x81, 0xf6}, + {0x81, 0xf7}, + {0x81, 0xf8}, + {0x81, 0xf9}, + {0x81, 0xfa}, + {0x81, 0xfb}, + {0x81, 0xfc}, + {0x81, 0xfd}, + {0x81, 0xfe}, + {0x81, 0xff} +},{ + {0x82, 0x40}, + {0x82, 0x41}, + {0x82, 0x42}, + {0x82, 0x43}, + {0x82, 0x44}, + {0x82, 0x45}, + {0x82, 0x46}, + {0x82, 0x47}, + {0x82, 0x48}, + {0x82, 0x49}, + {0x82, 0x4a}, + {0x82, 0x4b}, + {0x82, 0x4c}, + {0x82, 0x4d}, + {0x82, 0x4e}, + {0x00, 0x30}, /* 0 */ + {0x00, 0x31}, /* 1 */ + {0x00, 0x32}, /* 2 */ + {0x00, 0x33}, /* 3 */ + {0x00, 0x34}, /* 4 */ + {0x00, 0x35}, /* 5 */ + {0x00, 0x36}, /* 6 */ + {0x00, 0x37}, /* 7 */ + {0x00, 0x38}, /* 8 */ + {0x00, 0x39}, /* 9 */ + {0x82, 0x59}, + {0x82, 0x5a}, + {0x82, 0x5b}, + {0x82, 0x5c}, + {0x82, 0x5d}, + {0x82, 0x5e}, + {0x82, 0x5f}, + {0x00, 0x41}, /* A */ + {0x00, 0x42}, /* B */ + {0x00, 0x43}, /* C */ + {0x00, 0x44}, /* D */ + {0x00, 0x45}, /* E */ + {0x00, 0x46}, /* F */ + {0x00, 0x47}, /* G */ + {0x00, 0x48}, /* H */ + {0x00, 0x49}, /* I */ + {0x00, 0x4a}, /* J */ + {0x00, 0x4b}, /* K */ + {0x00, 0x4c}, /* L */ + {0x00, 0x4d}, /* M */ + {0x00, 0x4e}, /* N */ + {0x00, 0x4f}, /* O */ + {0x00, 0x50}, /* P */ + {0x00, 0x51}, /* Q */ + {0x00, 0x52}, /* R */ + {0x00, 0x53}, /* S */ + {0x00, 0x54}, /* T */ + {0x00, 0x55}, /* U */ + {0x00, 0x56}, /* V */ + {0x00, 0x57}, /* W */ + {0x00, 0x58}, /* X */ + {0x00, 0x59}, /* Y */ + {0x00, 0x5a}, /* Z */ + {0x82, 0x7a}, + {0x82, 0x7b}, + {0x82, 0x7c}, + {0x82, 0x7d}, + {0x82, 0x7e}, + {0x82, 0x7f}, + {0x82, 0x80}, + {0x00, 0x61}, /* a */ + {0x00, 0x62}, /* b */ + {0x00, 0x63}, /* c */ + {0x00, 0x64}, /* d */ + {0x00, 0x65}, /* e */ + {0x00, 0x66}, /* f */ + {0x00, 0x67}, /* g */ + {0x00, 0x68}, /* h */ + {0x00, 0x69}, /* i */ + {0x00, 0x6a}, /* j */ + {0x00, 0x6b}, /* k */ + {0x00, 0x6c}, /* l */ + {0x00, 0x6d}, /* m */ + {0x00, 0x6e}, /* n */ + {0x00, 0x6f}, /* o */ + {0x00, 0x70}, /* p */ + {0x00, 0x71}, /* q */ + {0x00, 0x72}, /* r */ + {0x00, 0x73}, /* s */ + {0x00, 0x74}, /* t */ + {0x00, 0x75}, /* u */ + {0x00, 0x76}, /* v */ + {0x00, 0x77}, /* w */ + {0x00, 0x78}, /* x */ + {0x00, 0x79}, /* y */ + {0x00, 0x7a}, /* z */ + {0x82, 0x9b}, + {0x82, 0x9c}, + {0x82, 0x9d}, + {0x82, 0x9e}, + {0x82, 0x9f}, /* ぁ */ + {0x82, 0xa0}, /* あ */ + {0x82, 0xa1}, /* ぃ */ + {0x82, 0xa2}, /* い */ + {0x82, 0xa3}, /* ぅ */ + {0x82, 0xa4}, /* う */ + {0x82, 0xa5}, /* ぇ */ + {0x82, 0xa6}, /* え */ + {0x82, 0xa7}, /* ぉ */ + {0x82, 0xa8}, /* お */ + {0x82, 0xa9}, /* か */ + {0x82, 0xaa}, + {0x82, 0xab}, /* き */ + {0x82, 0xac}, + {0x82, 0xad}, /* く */ + {0x82, 0xae}, + {0x82, 0xaf}, /* け */ + {0x82, 0xb0}, + {0x82, 0xb1}, /* こ */ + {0x82, 0xb2}, + {0x82, 0xb3}, /* さ */ + {0x82, 0xb4}, + {0x82, 0xb4}, /* し */ + {0x82, 0xb6}, + {0x82, 0xb7}, /* す */ + {0x82, 0xb8}, + {0x82, 0xb9}, /* せ */ + {0x82, 0xba}, + {0x82, 0xbf}, /* そ */ + {0x82, 0xbc}, + {0x82, 0xbd}, /* た */ + {0x82, 0xbe}, + {0x82, 0xbf}, /* ち */ + {0x82, 0xc0}, + {0x82, 0xc1}, /* っ */ + {0x82, 0xc2}, /* つ */ + {0x82, 0xc3}, + {0x82, 0xc4}, /* て */ + {0x82, 0xc5}, + {0x82, 0xc6}, /* と */ + {0x82, 0xc7}, + {0x82, 0xc8}, /* な */ + {0x82, 0xc9}, /* に */ + {0x82, 0xca}, /* ぬ */ + {0x82, 0xcb}, /* ね */ + {0x82, 0xcc}, /* の */ + {0x82, 0xcd}, /* は */ + {0x82, 0xce}, + {0x82, 0xcf}, + {0x82, 0xd0}, /* ひ */ + {0x82, 0xd1}, + {0x82, 0xd2}, + {0x82, 0xd3}, /* ふ */ + {0x82, 0xd4}, + {0x82, 0xd5}, + {0x82, 0xd6}, /* へ */ + {0x82, 0xd7}, + {0x82, 0xd8}, + {0x82, 0xd9}, /* ほ */ + {0x82, 0xda}, + {0x82, 0xdb}, + {0x82, 0xdc}, /* ま */ + {0x82, 0xdd}, /* み */ + {0x82, 0xde}, /* む */ + {0x82, 0xdf}, /* め */ + {0x82, 0xe0}, /* も */ + {0x82, 0xe1}, /* ゃ */ + {0x82, 0xe2}, /* や */ + {0x82, 0xe3}, /* ゅ */ + {0x82, 0xe4}, /* ゆ */ + {0x82, 0xe5}, /* ょ */ + {0x82, 0xe6}, /* よ */ + {0x82, 0xe7}, /* ら */ + {0x82, 0xe8}, /* り */ + {0x82, 0xe9}, /* る */ + {0x82, 0xea}, /* れ */ + {0x82, 0xeb}, /* ろ */ + {0x82, 0xec}, + {0x82, 0xed}, /* わ */ + {0x82, 0xee}, + {0x82, 0xef}, + {0x82, 0xf0}, /* を */ + {0x82, 0xf1}, /* ん */ + {0x82, 0xf2}, + {0x82, 0xf3}, + {0x82, 0xf4}, + {0x82, 0xf5}, + {0x82, 0xf6}, + {0x82, 0xf7}, + {0x82, 0xf8}, + {0x82, 0xf9}, + {0x82, 0xfa}, + {0x82, 0xfb}, + {0x82, 0xfc}, + {0x82, 0xfd}, + {0x82, 0xfe}, + {0x82, 0xff} +},{ + {0x00, 0xa7}, /* ぁ */ + {0x00, 0xb1}, /* あ */ + {0x00, 0xa8}, /* ぃ */ + {0x00, 0xb2}, /* い */ + {0x00, 0xa9}, /* ぅ */ + {0x00, 0xb3}, /* う */ + {0x00, 0xaa}, /* ぇ */ + {0x00, 0xb4}, /* え */ + {0x00, 0xab}, /* ぉ */ + {0x00, 0xb5}, /* お */ + {0x00, 0xb6}, /* か */ + {0x83, 0x4b}, + {0x00, 0xb7}, /* き */ + {0x83, 0x4d}, + {0x00, 0xb8}, /* く */ + {0x83, 0x4f}, + {0x00, 0xb9}, /* け */ + {0x83, 0x51}, + {0x00, 0xba}, /* こ */ + {0x83, 0x53}, + {0x00, 0xbb}, /* さ */ + {0x83, 0x55}, + {0x00, 0xbc}, /* し */ + {0x83, 0x57}, + {0x00, 0xbd}, /* す */ + {0x83, 0x59}, + {0x00, 0xbe}, /* せ */ + {0x83, 0x5b}, + {0x00, 0xbf}, /* そ */ + {0x83, 0x5d}, + {0x00, 0xc0}, /* た */ + {0x83, 0x5f}, + {0x00, 0xc1}, /* ち */ + {0x83, 0x61}, + {0x00, 0xaf}, /* っ */ + {0x00, 0xc2}, /* つ */ + {0x83, 0x64}, + {0x00, 0xc3}, /* て */ + {0x83, 0x66}, + {0x00, 0xc4}, /* と */ + {0x83, 0x68}, + {0x00, 0xc5}, /* な */ + {0x00, 0xc6}, /* に */ + {0x00, 0xc7}, /* ぬ */ + {0x00, 0xc8}, /* ね */ + {0x00, 0xc9}, /* の */ + {0x00, 0xca}, /* は */ + {0x83, 0x6f}, + {0x83, 0x70}, + {0x00, 0xcb}, /* ひ */ + {0x83, 0x72}, + {0x83, 0x73}, + {0x00, 0xcc}, /* ふ */ + {0x83, 0x75}, + {0x83, 0x76}, + {0x00, 0xcd}, /* へ */ + {0x83, 0x78}, + {0x83, 0x79}, + {0x00, 0xce}, /* ほ */ + {0x83, 0x7b}, + {0x83, 0x7c}, + {0x00, 0xcf}, /* ま */ + {0x00, 0xd0}, /* み */ + {0x83, 0x7f}, + {0x00, 0xd1}, /* む */ + {0x00, 0xd2}, /* め */ + {0x00, 0xd3}, /* も */ + {0x00, 0xac}, /* ゃ */ + {0x00, 0xd4}, /* や */ + {0x00, 0xad}, /* ゅ */ + {0x00, 0xd5}, /* ゆ */ + {0x00, 0xae}, /* ょ */ + {0x00, 0xd6}, /* よ */ + {0x00, 0xd7}, /* ら */ + {0x00, 0xd8}, /* り */ + {0x00, 0xd9}, /* る */ + {0x00, 0xda}, /* れ */ + {0x00, 0xdb}, /* ろ */ + {0x83, 0x8e}, + {0x00, 0xdc}, /* わ */ + {0x83, 0x90}, + {0x83, 0x91}, + {0x00, 0xa6}, /* を */ + {0x00, 0xdd}, /* ん */ + {0x83, 0x94}, + {0x83, 0x95}, + {0x83, 0x96}, + {0x83, 0x97}, + {0x83, 0x98}, + {0x83, 0x99}, + {0x83, 0x9a}, + {0x83, 0x9b}, + {0x83, 0x9c}, + {0x83, 0x9d}, + {0x83, 0x9e}, + {0x83, 0x9f}, + {0x83, 0xa0}, + {0x83, 0xa1}, + {0x83, 0xa2}, + {0x83, 0xa3}, + {0x83, 0xa4}, + {0x83, 0xa5}, + {0x83, 0xa6}, + {0x83, 0xa7}, + {0x83, 0xa8}, + {0x83, 0xa9}, + {0x83, 0xaa}, + {0x83, 0xab}, + {0x83, 0xac}, + {0x83, 0xad}, + {0x83, 0xae}, + {0x83, 0xaf}, + {0x83, 0xb0}, + {0x83, 0xb1}, + {0x83, 0xb2}, + {0x83, 0xb3}, + {0x83, 0xb4}, + {0x83, 0xb5}, + {0x83, 0xb6}, + {0x83, 0xb7}, + {0x83, 0xb8}, + {0x83, 0xb9}, + {0x83, 0xba}, + {0x83, 0xbb}, + {0x83, 0xbc}, + {0x83, 0xbd}, + {0x83, 0xbe}, + {0x83, 0xbf}, + {0x83, 0xc0}, + {0x83, 0xc1}, + {0x83, 0xc2}, + {0x83, 0xc3}, + {0x83, 0xc4}, + {0x83, 0xc5}, + {0x83, 0xc6}, + {0x83, 0xc7}, + {0x83, 0xc8}, + {0x83, 0xc9}, + {0x83, 0xca}, + {0x83, 0xcb}, + {0x83, 0xcc}, + {0x83, 0xcd}, + {0x83, 0xce}, + {0x83, 0xcf}, + {0x83, 0xd0}, + {0x83, 0xd1}, + {0x83, 0xd2}, + {0x83, 0xd3}, + {0x83, 0xd4}, + {0x83, 0xd5}, + {0x83, 0xd6}, + {0x83, 0xd7}, + {0x83, 0xd8}, + {0x83, 0xd9}, + {0x83, 0xda}, + {0x83, 0xdb}, + {0x83, 0xdc}, + {0x83, 0xdd}, + {0x83, 0xde}, + {0x83, 0xdf}, + {0x83, 0xe0}, + {0x83, 0xe1}, + {0x83, 0xe2}, + {0x83, 0xe3}, + {0x83, 0xe4}, + {0x83, 0xe5}, + {0x83, 0xe6}, + {0x83, 0xe7}, + {0x83, 0xe8}, + {0x83, 0xe9}, + {0x83, 0xea}, + {0x83, 0xeb}, + {0x83, 0xec}, + {0x83, 0xed}, + {0x83, 0xee}, + {0x83, 0xef}, + {0x83, 0xf0}, + {0x83, 0xf1}, + {0x83, 0xf2}, + {0x83, 0xf3}, + {0x83, 0xf4}, + {0x83, 0xf5}, + {0x83, 0xf6}, + {0x83, 0xf7}, + {0x83, 0xf8}, + {0x83, 0xf9}, + {0x83, 0xfa}, + {0x83, 0xfb}, + {0x83, 0xfc}, + {0x83, 0xfd}, + {0x83, 0xfe}, + {0x83, 0xff} +}}; + +BYTE *zen2han(BYTE *src) { + BYTE c0, c1; + char *dst, *_dst; + + dst = _dst = malloc(strlen(src) + 1); + if (dst == NULL) { + fprintf(stderr, "zen2han(): Out of Memory (size %d)", strlen(src) + 1); + return NULL; + } + + while(0 != (c0 = *src++)) { + if (c0 < 0x81) { + *dst++ = c0; + } else if (c0 <= 0x83) { + c1 = *src++; + if (hankakutable[c0 - 0x81][c1 - 0x40][0] == 0) { + *dst++ = hankakutable[c0 - 0x81][c1 - 0x40][1]; + } else { + *dst++ = c0; *dst++ = c1; + } + } else if (c0 < 0xa0){ + *dst++ = c0; *dst++ = *src++; + } else if (c0 < 0xe0){ + *dst++ = c0; + } else { + *dst++ = c0; *dst++ = *src++; + } + } + *dst = 0; + return _dst; +} + +BYTE *han2zen(BYTE *src) { + BYTE c0; + BYTE *dst, *_dst; + BYTE *kindex; + dst = _dst = malloc(strlen(src) * 2 + 1); + + if (dst == NULL) { + fprintf(stderr, "han2zen(): Out of Memory (size %d)", strlen(src) *2 + 1); + return NULL; + } + + while(0 != (c0 = *src++)) { + if (c0 == 0x20) { + *dst++ = 0x81; *dst++ = 0x40; + } else if (c0 < 0x80) { + *dst++ = c0; + } else if (c0 >= 0xe0) { + *dst++ = (char)c0; *dst++ = *src++; + } else if (c0 >= 0xa0) { + kindex = hankana2sjis(c0); + *dst++ = *kindex; *dst++ = *(kindex+1); + } else { + *dst++ = (char)c0; *dst++ = *src++; + } + } + *dst = 0; + return _dst; +} diff --git a/src/hankana2sjis.c b/src/hankana2sjis.c new file mode 100644 index 0000000..cca6b3b --- /dev/null +++ b/src/hankana2sjis.c @@ -0,0 +1,62 @@ +/* + * hankana2sjis.c 半角カタカナ -> 全角平仮名変換 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: hankana2sjis.c,v 1.4 2000/11/25 13:09:06 chikama Exp $ */ + +// index = 0xa0~ +char *hankana2sjis(int index) { + static char kanatbl[][2] = { + 0x81, 0x40, 0x81, 0x42, 0x81, 0x75, 0x81, 0x76, + 0x81, 0x41, 0x81, 0x45, 0x82, 0xf0, 0x82, 0x9f, + 0x82, 0xa1, 0x82, 0xa3, 0x82, 0xa5, 0x82, 0xa7, + 0x82, 0xe1, 0x82, 0xe3, 0x82, 0xe5, 0x82, 0xc1, + 0x81, 0x5b, 0x82, 0xa0, 0x82, 0xa2, 0x82, 0xa4, + 0x82, 0xa6, 0x82, 0xa8, 0x82, 0xa9, 0x82, 0xab, + 0x82, 0xad, 0x82, 0xaf, 0x82, 0xb1, 0x82, 0xb3, + 0x82, 0xb5, 0x82, 0xb7, 0x82, 0xb9, 0x82, 0xbb, + 0x82, 0xbd, 0x82, 0xbf, 0x82, 0xc2, 0x82, 0xc4, + 0x82, 0xc6, 0x82, 0xc8, 0x82, 0xc9, 0x82, 0xca, + 0x82, 0xcb, 0x82, 0xcc, 0x82, 0xcd, 0x82, 0xd0, + 0x82, 0xd3, 0x82, 0xd6, 0x82, 0xd9, 0x82, 0xdc, + 0x82, 0xdd, 0x82, 0xde, 0x82, 0xdf, 0x82, 0xe0, + 0x82, 0xe2, 0x82, 0xe4, 0x82, 0xe6, 0x82, 0xe7, + 0x82, 0xe8, 0x82, 0xe9, 0x82, 0xea, 0x82, 0xeb, + 0x82, 0xed, 0x82, 0xf1, 0x81, 0x4a, 0x81, 0x4b + }; + return kanatbl[index - 0xa0]; +} + +char *num2sjis(int num) { + static char suji[][3] = { + 0x82,0x4f,0x00, /* 0 */ + 0x82,0x50,0x00, /* 1 */ + 0x82,0x51,0x00, /* 2 */ + 0x82,0x52,0x00, /* 3 */ + 0x82,0x53,0x00, /* 4 */ + 0x82,0x54,0x00, /* 5 */ + 0x82,0x55,0x00, /* 6 */ + 0x82,0x56,0x00, /* 7 */ + 0x82,0x57,0x00, /* 8 */ + 0x82,0x58,0x00, /* 9 */ + 0x81,0x40,0x00, /* space */ + }; + return suji[num]; +} diff --git a/src/haveunit.h b/src/haveunit.h new file mode 100644 index 0000000..4f9d7e9 --- /dev/null +++ b/src/haveunit.h @@ -0,0 +1,69 @@ +/* + * for new GOGO-no-coda (1999/09) + * Copyright (C) 1999 shigeo + */ + +#ifndef _CHKCPU_H +#define _CHKCPU_H + +#define tFPU (1<<0) +#define tMMX (1<<1) +#define t3DN (1<<2) +#define tSSE (1<<3) +#define tCMOV (1<<4) +#define tE3DN (1<<5) /* Athlon用(Externd 3D Now!) */ +#define tEMMX (1<<6) /* EMMX=E3DNow!_INT=SSE_INT */ +#define tINTEL (1<<8) +#define tAMD (1<<9) +#define tCYRIX (1<<10) +#define tIDT (1<<11) +#define tMULTI (1<<12) /* for Multi-threaded encoder. */ + /* Never set on UP or in the binary linked w/o multithread lib. */ +#define tUNKNOWN (1<<15) /* ベンダー不明 */ +#define tSPC1 (1<<16) /* 特別なスイッチ */ +#define tSPC2 (1<<17) /* 用途は決まってない */ + +#define tFAMILY4 (1<<20) /* 486 この時ベンダー判定は当てにならない */ +#define tFAMILY5 (1<<21) /* 586 (P5, P5-MMX, K6, K6-2, K6-III) */ +#define tFAMILY6 (1<<22) /* 686以降 P-Pro, P-II, P-III, Athlon */ + +/* + * 搭載しているユニットに従って上の値の論理和を返す + * chkcpu.asmとの整合性注意 + */ + +int haveUNIT(void); + +/* + * useUNITに従って関数の使用を変更する + */ + +void setupUNIT(int useUNIT); + +/* + * SSEを四捨五入モードにする + */ + +void setPIII_round(void); + + /* + * 使用関数の表示(デバッグ用) + */ + +void SETUP_DSP(char *mes); + +#ifdef WIN32 +void maskFPU_exception( void ); +#endif + +#if 0 +#define SETUP_DEBUG + +#ifdef SETUP_DEBUG +#define SETUP_DSP(x) fprintf(stderr,x) +#else +#define SETUP_DSP(x) +#endif +#endif + +#endif diff --git a/src/haveunit.s b/src/haveunit.s new file mode 100644 index 0000000..bf4f55e --- /dev/null +++ b/src/haveunit.s @@ -0,0 +1,269 @@ + +; for new GOGO-no-coda (1999/09) +; Copyright (C) 1999 shigeo +; modified by Keiichi SAKAI, URURI, Hash + +; 99/07/29 +; 99/09/06 フラグ追加 +; 99/09/07 SSEの処理を別にする +; 99/09/29 Cx586対策 +; 99/11/10 Cxrix対策 + +; int haveUNIT(void); + +; 486未満のCPUまたはFPUを搭載していなければ0 +; それ以外は次の値の論理和 +; PIIIでは丸め誤差を四捨五入モードにする(らしい) + +; haveunit.hとの整合性注意 + +%include "nasm.h" + +tFPU equ (1<<0) +tMMX equ (1<<1) +t3DN equ (1<<2) +tSSE equ (1<<3) +tCMOV equ (1<<4) +tE3DN equ (1<<5) ;/* Athlon用 (extend 3D Now!)*/ +tEMMX equ (1<<6) ;/* EMMX=E3DNow!_INT=SSE_INT */ + +tSPC1 equ (1<<16) ;/* 特別なスイッチ */ +tSPC2 equ (1<<17) ;/* 用途は決まってない */ + +tINTEL equ (1<<8) +tAMD equ (1<<9) +tCYRIX equ (1<<10) +tIDT equ (1<<11) +tUNKNOWN equ (1<<15) ;ベンダーが分からない + +tFAMILY4 equ (1<<20) ;/* 486 この時ベンダー判定は当てにならない */ +tFAMILY5 equ (1<<21) ;/* 586 (P5, P5-MMX, K6, K6-2, K6-III) */ +tFAMILY6 equ (1<<22) ;/* 686以降 P-Pro, P-II, P-III, Athlon */ + + globaldef haveUNIT + globaldef setPIII_round + globaldef maskFPU_exception + + segment_data + segment_code + +ACflag equ (1<<18) +IDflag equ (1<<21) + + align 16 +haveUNIT: + push ebx + push esi + xor esi,esi + call near haveFPU + jnz near .Lexit + or esi,tFPU + pushfd ;flag保存 + pushfd + pop eax ;eax=flag + or eax,ACflag ;eax=flag|ACflag + push eax + popfd ;flag=eax + pushfd + pop eax ;eax=flag + popfd ;flag復元 + test eax,ACflag ;ACflagは変化したか? + jz near .Lexit +;486以降 + pushfd ;flag保存 + pushfd + pop eax ;eax=flag + or eax,IDflag ;eax=flag|IDflag + push eax + popfd ;flag=eax + pushfd + pop eax ;eax=flag + popfd ;flag復元 + test eax,IDflag +; jz short .Lexit + jnz .L586 + +%if 1 + ;Cyrix 486CPU check Cyrix の HP にあったやつ by Hash + + xor ax, ax ; clear ax + sahf ; clear flags, bit 1 is always 1 in flags + mov ax, 5 + mov bx, 2 + div bl ; do an operation that does not change flags + lahf ; get flags + cmp ah, 2 ; check for change in flags + jne .L486intel ; flags changed not Cyrix + or esi,tCYRIX ; TRUE Cyrix CPU + jmp .L486 + +.L486intel: + or esi,tINTEL +.L486: + or esi,tFAMILY4 + jmp .Lexit + +%else + ; check for Cyrix 486DLC -- based on check routine + ; documented in "Cx486SLC/e SMM Programmer's Guide" + xor dx,dx + cmp dx,dx + pushf + pop cx + mov ax,0FFFFh + mov bx,4 + div bx + pushf + pop ax + and ax,8D5h + and cx,8D5h + cmp ax,cx + jnz .L486intel + or esi,tCYRIX + jmp .L486 +.L486intel: + or esi,tINTEL +.L486: + or esi,tFAMILY4 + jmp .Lexit +%endif + + +.L586: + +;cpuid は eax,ebx,ecx,edxを破壊するので注意!!! + + xor eax,eax + cpuid +; cmp ecx,"letn" + cmp ecx,"ntel" ;うわ〜NASMと反対に配置するんだ + jne .F00 + or esi,tINTEL + jmp .F09 +.F00: +; cmp ecx,"DMAc" + cmp ecx,"cAMD" + jne .F01 + or esi,tAMD + jmp .F09 +.F01: +; cmp ecx,"daet" + cmp ecx,"tead" + jne .F02 + or esi,tCYRIX + jmp .F09 +.F02: +; cmp ecx,"slua" + cmp ecx,"auls" + jne .F03 + or esi,tIDT + jmp .F09 +.F03: + or esi,tUNKNOWN + jmp .F09 +.F09: + mov eax,1 + cpuid + cmp ah,4 + jne .F10 + or esi,tFAMILY4 + jmp .Lexit +.F10: + cmp ah,5 + jne .F11 + or esi,tFAMILY5 + jmp .F19 +.F11: + cmp ah,6 + jne .F12 + or esi,tFAMILY6 + jmp .F19 +.F12: + or esi,tFAMILY6 ; 7以上は6と見なす +.F19: + + ;for AMD, IDT + mov eax,80000001h + cpuid + test edx,(1 << 31) + jz .F20 + or esi,t3DN +.F20: + test edx,(1 << 15) ;CMOVcc + jz .F21 +; test edx,(1 << 16) ;FCMOVcc ;K7から変更 by URURI +; jz .F21 + or esi,tCMOV +.F21: + test edx,(1 << 30) ;拡張 3D Now! + jz .F22 +%ifdef USE_E3DN + or esi,tE3DN +%endif +.F22: + test edx,(1 << 22) ;AMD MMX Ext + jz .F23 + or esi,tEMMX +.F23: + ;Intel系 + mov eax,1 + cpuid + test edx,(1 << 23) + jz .F30 + or esi,tMMX +.F30: + test edx,(1 << 15) ;CMOVcc and FCMOV if FPU=1 + jz .F31 + or esi,tCMOV +.F31: + test edx,(1 << 25) + jz short .Lexit + or esi,tEMMX +%ifndef UNAVAILABLE_SSE + or esi,tSSE +%endif +.Lexit: + mov eax,esi + pop esi + pop ebx + ret + +; in:none +; out:ZF FPUあり=1, なし=0 +; dest:eax + + align 16 +haveFPU: + mov al,1 + fninit + fnstsw ax + cmp al,0 + jne short .LhF_exit + sub esp,4 + fnstcw word [esp] + mov ax,[esp] + add esp,4 + and ax,103Fh + cmp ax,3Fh +.LhF_exit: + ret + +setPIII_round: + ;P-IIIのSSEを確実に四捨五入モードに +; mov eax,0x1f80 ; default mode + mov eax,0x9f80 ; flush to ZERO mode + push eax + ldmxcsr [esp] ; setup MXCSR + pop eax + ret + +; for Win32 Delphi +maskFPU_exception: + push eax + fnstcw word [esp] + and word [esp],0xFFF2 + fldcw word [esp] + pop eax + ret + + end diff --git a/src/image.c b/src/image.c new file mode 100644 index 0000000..5962790 --- /dev/null +++ b/src/image.c @@ -0,0 +1,1170 @@ +/* + * image.c image操作 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: image.c,v 1.40 2003/08/30 21:29:16 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include "portab.h" +#include "system.h" +#include "image.h" +#include "cg.h" +#include "config.h" +#include "nact.h" +#include "graphicsdevice.h" +#include "alpha_plane.h" +#include "ags.h" + +/* private variables */ +static Pallet xpal[256]; /* pal & pixel 値 */ + +/* fader */ +static int fadeX[16] = {0,2,2,0,1,3,3,1,1,3,3,1,0,2,2,0}; +static int fadeY[16] = {0,2,0,2,1,3,1,3,0,2,0,2,1,3,1,3}; + +/* private methods */ +static void trans_index2pixels(int depth, int lv, cgdata *cg); +static int trans_index2pixel(int depth, int i); +static void image_drawLine8(agsurface_t *dib, int x0, int y0, int x1, int y1, int col); +static void image_drawRectangle8(agsurface_t *dib, int x, int y, int w, int h, int col); +static void image_fillRectangle8(agsurface_t *dib, int x, int y, int w, int h, int col); +static void image_copyArea8(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy); +static void image_getGlyphImage8to8(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col); +static void image_copyAreaSP8(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int width, int height, int sp); + +#include "image15.c" +#include "image16.c" +#include "image24.c" +#include "image24p.c" + + +static void (*draw_image24_from_data)(agsurface_t *, cgdata *, int, int, int, int); +static void (*draw_sprite16_from_data)(agsurface_t *, cgdata *, int, int, int, int); +static void (*draw_image16_from_data)(agsurface_t *, cgdata *, int, int, int, int); +static void (*draw_line)(agsurface_t*, int, int, int, int, int); +static void (*draw_rectangle)(agsurface_t*, int, int, int, int, int); +static void (*fill_rectangle)(agsurface_t*, int, int, int, int, int); +static void (*copy_area)(agsurface_t*, int, int, int, int, int, int); +static void (*copy_area_ablend_sda)(agsurface_t *, BYTE *, BYTE *, int, int, BYTE *, int); +static void (*copy_area_ablend_sd)(agsurface_t *, BYTE *, BYTE *, int, int, int); +static void (*copy_area_alevel)(agsurface_t *, BYTE *, BYTE *, int, int, int); +static void (*copy_area_wlevel)(agsurface_t *, BYTE *, BYTE *, int, int, int); +static void (*copy_from_alpha)(agsurface_t *, BYTE *, BYTE *, int, int, ALPHA_DIB_COPY_TYPE); +static void (*copy_to_alpha)(agsurface_t *, BYTE *, BYTE *, int, int, ALPHA_DIB_COPY_TYPE); +static void (*wrap_color)(agsurface_t *, BYTE *, int, int, int, int); +static void (*copy_area_sprite)(agsurface_t *, BYTE *, BYTE *, int, int, int); +static void (*draw_antialiased_pattern)(agsurface_t *, agsurface_t *, int, int, int, int, int); + +/* + * dib の depth に応じた関数の設定 + * depth: dib depth +*/ +void image_setdepth(int depth) { + switch(depth) { + case 8: + draw_line = image_drawLine8; + draw_rectangle = image_drawRectangle8; + fill_rectangle = image_fillRectangle8; + copy_area = image_copyArea8; + copy_area_sprite = image_copyAreaSP8; + break; + case 15: + // draw_image24_from_data = drawImage24_fromData15; + draw_sprite16_from_data = drawSprite16_fromData15; + draw_image16_from_data = drawImage16_fromData15; + draw_line = image_drawLine16; + draw_rectangle = image_drawRectangle16; + fill_rectangle = image_fillRectangle16; + copy_area = image_copyArea16; + copy_area_ablend_sda = image_copyAreaSP16_shadow15; + copy_area_ablend_sd = image_copyAreaSP16_alphaBlend15; + copy_area_alevel = image_copyAreaSP16_alphaLevel15; + copy_area_wlevel = image_copyAreaSP16_whiteLevel15; + copy_from_alpha = image_copy_from_alpha15; + copy_to_alpha = image_copy_to_alpha15; + wrap_color = image_wrapColor15; + copy_area_sprite = image_copyAreaSP16_transparent16; + draw_antialiased_pattern = image_draw_antialiased_pattern15; + break; + case 16: + draw_image24_from_data = drawImage24_fromData16; + draw_sprite16_from_data = drawSprite16_fromData16; + draw_image16_from_data = drawImage16_fromData16; + draw_line = image_drawLine16; + draw_rectangle = image_drawRectangle16; + fill_rectangle = image_fillRectangle16; + copy_area = image_copyArea16; + copy_area_ablend_sda = image_copyAreaSP16_shadow16; + copy_area_ablend_sd = image_copyAreaSP16_alphaBlend16; + copy_area_alevel = image_copyAreaSP16_alphaLevel16; + copy_area_wlevel = image_copyAreaSP16_whiteLevel16; + copy_from_alpha = image_copy_from_alpha16; + copy_to_alpha = image_copy_to_alpha16; + wrap_color = image_wrapColor16; + copy_area_sprite = image_copyAreaSP16_transparent16; + draw_antialiased_pattern = image_draw_antialiased_pattern16; + break; + case 24: + case 32: + //draw_image24_from_data = drawImage24_fromData32; + draw_sprite16_from_data = drawSprite16_fromData24; + draw_image16_from_data = drawImage16_fromData24; + draw_line = image_drawLine24; + draw_rectangle = image_drawRectangle24; + fill_rectangle = image_fillRectangle24; + copy_area = image_copyArea24; + copy_area_ablend_sda = image_copyAreaSP16_shadow24; + copy_area_ablend_sd = image_copyAreaSP16_alphaBlend24; + copy_area_alevel = image_copyAreaSP16_alphaLevel24; + copy_area_wlevel = image_copyAreaSP16_whiteLevel24; + copy_from_alpha = image_copy_from_alpha24; + copy_to_alpha = image_copy_to_alpha24; + wrap_color = image_wrapColor24; + copy_area_sprite = image_copyAreaSP16_transparent24; + draw_antialiased_pattern = image_draw_antialiased_pattern24; + break; + default: + break; + } +} + + +static void trans_index2pixels(int depth, int lv, cgdata *cg) { + Pallet256 *pal; + int i, i_st = 0, i_ed = 256, r, g, b; + + if (cg == NULL) { + pal = nact->sys_pal; + } else { + pal = cg->pal; + if (cg->type == ALCG_VSP) { + i_st = (cg->vsp_bank << 4); + i_ed = i_st + 16; + } + } + switch(depth) { + case 8: + for (i = i_st; i < i_ed; i++) { + xpal[i].r = pal->red [i]; + xpal[i].g = pal->green[i]; + xpal[i].b = pal->blue [i]; + xpal[i].pixel = i; + } + break; + case 15: + if (lv == 255) { + for (i = i_st; i < i_ed; i++) { + xpal[i].pixel = PIX15(pal->red[i], pal->green[i], pal->blue[i]); + } + } else if (lv < 255) { + for (i = i_st; i < i_ed; i++) { + xpal[i].pixel = PIX15((pal->red [i]*lv)>>8, + (pal->green[i]*lv)>>8, + (pal->blue [i]*lv)>>8); + } + } else { + lv -= 255; + for (i = i_st; i < i_ed; i++) { + r = pal->red[i]; + g = pal->green[i]; + b = pal->blue[i]; + xpal[i].pixel = PIX15((((255-r)*lv)>>8)+r, + (((255-g)*lv)>>8)+g, + (((255-b)*lv)>>8)+b); + } + } + break; + case 16: + if (lv == 255) { + for (i = i_st; i < i_ed; i++) { + xpal[i].pixel = PIX16(pal->red[i], pal->green[i], pal->blue[i]); + } + } else if (lv < 255) { + for (i = i_st; i < i_ed; i++) { + xpal[i].pixel = PIX16((pal->red [i]*lv)>>8, + (pal->green[i]*lv)>>8, + (pal->blue [i]*lv)>>8); + } + } else { + lv -= 255; + for (i = i_st; i < i_ed; i++) { + r = pal->red[i]; + g = pal->green[i]; + b = pal->blue[i]; + xpal[i].pixel = PIX16((((255-r)*lv)>>8)+r, + (((255-g)*lv)>>8)+g, + (((255-b)*lv)>>8)+b); + } + } + break; + case 24: + case 32: + if (lv == 255) { + for (i = i_st; i < i_ed; i++) { + xpal[i].pixel = PIX24(pal->red[i], pal->green[i], pal->blue[i]); + } + } else if (lv < 255) { + for (i = i_st; i < i_ed; i++) { + xpal[i].pixel = PIX24((pal->red [i]*lv)>>8, + (pal->green [i]*lv)>>8, + (pal->blue [i]*lv)>>8); + } + } else { + lv -= 255; + for (i = i_st; i < i_ed; i++) { + r = pal->red[i]; + g = pal->green[i]; + b = pal->blue[i]; + xpal[i].pixel = PIX24((((255-r)*lv)>>8)+r, + (((255-g)*lv)>>8)+g, + (((255-b)*lv)>>8)+b); + } + } + break; + default: + WARNING("Unknown depth\n"); + break; + } + nact->sys_pal_changed = FALSE; +} + +static int trans_index2pixel(int depth, int i) { + Pallet256 *pal = nact->sys_pal; + + switch(depth) { + case 8: + return i; + case 15: + return PIX15(pal->red[i], pal->green[i], pal->blue[i]); + case 16: + return PIX16(pal->red[i], pal->green[i], pal->blue[i]); + case 24: + case 32: + return PIX24(pal->red[i], pal->green[i], pal->blue[i]); + default: + WARNING("Unknown depth\n"); + return i; + } +} + +/* 16bitCGの ALPHALEVELを指定 */ +static WORD *changeImageAlphaLevel(cgdata *cg) { + WORD *new_pic = g_new(WORD, cg->width * cg->height), *new_pic_; + WORD *pic = (WORD *)cg->pic; + int pixels = cg->width * cg->height; + + new_pic_ = new_pic; + + while (pixels--) { + *new_pic = RGB_ALPHALEVEL16(*pic, cg->alphalevel); + new_pic++; pic++; + } + return new_pic_; +} + + +/* 色の拡大 */ +void image_expandPixel(agsurface_t *img_src, agsurface_t *img_dst, int lv) { + static int prelv = 0; + if (img_src->depth != 8) return; + + if (nact->sys_pal_changed || prelv != lv) trans_index2pixels(img_dst->depth, lv, NULL); + + switch(img_dst->bytes_per_pixel) { + case 2: + expandPixel8to16(img_src, img_dst); + break; + case 3: + expandPixel8to24p(img_src, img_dst); + break; + case 4: + expandPixel8to24(img_src, img_dst); + break; + default: + break; + } + prelv = lv; +} + +/* + fade out for 16/24/32 +*/ +void image_fadeOut(agsurface_t *img, int lv, int col) { + switch(img->bytes_per_pixel) { + case 2: + fadeOut16(img, lv, col); break; + case 3: + fadeOut24p(img, lv, col); break; + case 4: + fadeOut24(img, lv, col); break; + default: + break; + } +} + +/* + fade in for 16/24/32 +*/ +void image_fadeIn(agsurface_t *src, agsurface_t *dst, int lv) { + switch(dst->bytes_per_pixel) { + case 2: + fadeIn16(src, dst, lv); break; + case 3: + fadeIn24p(src, dst, lv); break; + case 4: + fadeIn24(src, dst, lv); break; + default: + break; + } +} + +/* + * 拡大・縮小コピー + */ +void image_scaledCopyArea(agsurface_t *src, agsurface_t *dst, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int mirror) { + float a1, a2, xd, yd; + int *row, *col; + int x, y; + BYTE *sdata, *ddata; + agsurface_t *srccpy = NULL; + + /* src が NULL の場合,領域が重なる場合を考えて copy を作る */ + if (src == NULL) { + srccpy = image_saveRegion(dst, sx, sy, sw, sh); + src = srccpy; + sx = sy = 0; + } + + sdata = GETOFFSET_PIXEL(src, sx, sy); + ddata = GETOFFSET_PIXEL(dst, dx, dy); + + a1 = (float)sw / (float)dw; + a2 = (float)sh / (float)dh; + // src width と dst width が同じときに問題があるので+1 + row = g_new0(int, dw+1); + // 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる + // 可能性がある。 + col = g_new0(int, dh+1); + + if (mirror & 1) { + /* 上下反転 added by tajiri@wizard */ + for (yd = sh - a2, y = 0; y < dh; y++) { + col[y] = yd; yd -= a2; + } + } else { + for (yd = 0.0, y = 0; y < dh; y++) { + col[y] = yd; yd += a2; + } + } + if (mirror & 2) { + /* 左右反転 added by tajiri@wizard */ + for (xd = sw - a1, x = 0; x < dw; x++) { + row[x] = xd; xd -= a1; + } + } else { + for (xd = 0.0, x = 0; x < dw; x++) { + row[x] = xd; xd += a1; + } + } + +#define SCALEDCOPYAREA(type) { \ + int x, y; \ + type *sl, *dl; \ + BYTE *_sl, *_dl; \ + for (y = 0; y < dh; y++) { \ + sl = (type *)(sdata + *(y + col) * src->bytes_per_line);\ + dl = (type *)(ddata + y * dst->bytes_per_line);\ + for (x = 0; x < dw; x++) { \ + *(dl + x) = *(sl + *(row + x)); \ + } \ + _dl = (BYTE *)dl; \ + while(*(col + y) == *(col + y + 1)) { \ + _sl = _dl; \ + _dl += dst->bytes_per_line; \ + memcpy(_dl, _sl, dw * sizeof(type)); \ + y++; \ + } \ + }} + + switch(dst->depth) { + case 8: + SCALEDCOPYAREA(BYTE); break; + case 15: + case 16: + SCALEDCOPYAREA(WORD); break; + case 24: + case 32: + SCALEDCOPYAREA(DWORD); break; + default: + break; + } + + g_free(row); + g_free(col); + + if (srccpy != NULL) { + image_delRegion(srccpy); + } +} + +/* + * dibに8bitCGの描画 + */ +void image_drawImage8_fromData(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { +#define DRAWSPRITEFROMDATA8(type) { \ + int x, y; \ + BYTE *pic_src = cg->pic + cg->data_offset; \ + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); \ + type *yl; \ + for (y = 0; y < h; y++) { \ + yl = (type *)(pic_dst + y * dib->bytes_per_line);\ + for (x = 0; x < w; x++) { \ + if (*pic_src != (BYTE)cg->spritecolor) { \ + *yl = xpal[(*pic_src)].pixel; \ + } \ + yl++; pic_src++; \ + } \ + pic_src += (cg->width - w); \ + }} +#define DRAWIMAGEFROMDATA8(type) { \ + int x, y; \ + BYTE *pic_src = cg->pic + cg->data_offset; \ + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); \ + type *yl; \ + for (y = 0; y bytes_per_line);\ + for (x = 0; x < w; x++) { \ + *yl = xpal[(*pic_src)].pixel; \ + yl++; pic_src++; \ + } \ + pic_src += (cg->width - w); \ + }} + + if (cg->spritecolor >= 0) { + switch(dib->depth) { + case 8: + { + int x, y; + BYTE *pic_src = cg->pic + cg->data_offset; + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *yl; + for (y = 0; y < h; y++) { + yl = (BYTE *)(pic_dst + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + if (*pic_src != (BYTE)cg->spritecolor) { + *yl = (*pic_src); + } + yl++; pic_src++; + } + pic_src += (cg->width - w); + } + break; + } + case 15: + case 16: + if (nact->sys_pal_changed) + trans_index2pixels(dib->depth, cg->alphalevel, cg); + DRAWSPRITEFROMDATA8(WORD); break; + case 24: + case 32: + if (nact->sys_pal_changed) + trans_index2pixels(dib->depth, cg->alphalevel, cg); + DRAWSPRITEFROMDATA8(DWORD); break; + default: + break; + } + } else { + switch(dib->depth) { + case 8: + { + int y; + BYTE* pic_src = cg->pic + cg->data_offset; + BYTE* pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + + for (y = 0; y < h; y++) { + memcpy(pic_dst, pic_src, w); + pic_src += cg->width; + pic_dst += dib->bytes_per_line; + } + break; + } + case 15: + case 16: + if (nact->sys_pal_changed) + trans_index2pixels(dib->depth, cg->alphalevel, cg); + DRAWIMAGEFROMDATA8(WORD); break; + case 24: + case 32: + if (nact->sys_pal_changed) + trans_index2pixels(dib->depth, cg->alphalevel, cg); + DRAWIMAGEFROMDATA8(DWORD); break; + default: + break; + } + } +} + +/* + * dibに16bitCGの描画 + */ +void image_drawImage16_fromData(agsurface_t *dib, cgdata *cg, int x, int y, int w, int h) { + WORD *pic_save = NULL; + + /* set alpha Level */ + if (cg->alphalevel != 255) { + pic_save = (WORD *)cg->pic; + cg->pic = (BYTE *)changeImageAlphaLevel(cg); + } + + if (cg->spritecolor >= 0) { + draw_sprite16_from_data(dib, cg, x, y, w, h); + } else { + draw_image16_from_data(dib, cg, x, y, w, h); + } + + if (cg->alphalevel != 255) { + g_free(cg->pic); + cg->pic = (BYTE *)pic_save; + } +} + +/* + * dib に線を描画 + */ +void image_drawLine(agsurface_t *dib, int x0, int y0, int x1, int y1, int col) { + draw_line(dib, x0, y0, x1, y1, col); +} + +/* + * dib に矩形を描画 + */ +void image_drawRectangle(agsurface_t *dib, int x, int y, int w, int h, int col) { + draw_rectangle(dib, x, y, w, h, col); +} + +/* + * dib に矩形塗りつぶしを描画 + */ +void image_fillRectangle(agsurface_t *dib, int x, int y, int w, int h, int col) { + fill_rectangle(dib, x, y, w, h, col); +} + +void image_fillRectangleNeg(agsurface_t *dib, int x, int y, int w, int h, int col) { + fill_rectangle(dib, x, y, w, h, -1 ^ trans_index2pixel(dib->depth, col)); +} + +/* + * dib の指定領域をコピー + */ +void image_copyArea(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy) { + copy_area(dib, sx, sy, w, h, dx, dy); +} + +/* + * 16bit専用の dib の指定領域コピー alphaつき + */ +void image_copyAreaSP16_shadow(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int lv) { + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *adata = GETOFFSET_ALPHA(dib, sx, sy); + + copy_area_ablend_sda(dib, sdata, ddata, w, h, adata, lv); +} + +/* + * 16bit専用の dib の指定領域コピー + * srcのイメージを lvの明度でコピー CE 2001 + */ +void image_copyAreaSP16_alphaBlend(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int lv) { + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy); + + copy_area_ablend_sd(dib, sdata, ddata, w, h, lv); +} + +void image_copyAreaSP16_alphaLevel(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int lv) { + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy); + + copy_area_alevel(dib, sdata, ddata, w, h, lv); +} + +void image_copyAreaSP16_whiteLevel(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int lv) { + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy); + + copy_area_wlevel(dib, sdata, ddata, w, h, lv); +} + +void image_copy_from_alpha(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag) { + BYTE *sdata = GETOFFSET_ALPHA(dib, sx, sy); + BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy); + + copy_from_alpha(dib, sdata, ddata, w, h, flag); +} + +void image_copy_to_alpha(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag) { + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *ddata = GETOFFSET_ALPHA(dib, dx, dy); + + copy_to_alpha(dib, sdata, ddata, w, h, flag); +} + + +/* + * 指定範囲にパレット col を rate の割合で重ねる CK1 + */ +void image_wrapColor(agsurface_t *dib, int sx, int sy, int w, int h, int col, int rate) { + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + + wrap_color(dib, sdata, w, h, col, rate); +} + +/* + * dib のピクセル情報を取得 + */ +void image_getPixel(agsurface_t *dib, int x, int y, Pallet *cell) { + BYTE *dst = GETOFFSET_PIXEL(dib, x, y); + + switch(dib->depth) { + case 8: + cell->pixel = *dst; break; + case 15: + cell->r = PIXR15(*(WORD *)dst); + cell->g = PIXG15(*(WORD *)dst); + cell->b = PIXB15(*(WORD *)dst); + break; + case 16: + cell->r = PIXR16(*(WORD *)dst); + cell->g = PIXG16(*(WORD *)dst); + cell->b = PIXB16(*(WORD *)dst); + break; + case 24: + case 32: + cell->r = PIXR24(*(DWORD *)dst); + cell->g = PIXG24(*(DWORD *)dst); + cell->b = PIXB24(*(DWORD *)dst); + break; + default: + break; + } +} + +/* + * dib から領域の切り出し + */ +agsurface_t* image_saveRegion(agsurface_t *dib, int x, int y, int w, int h) { + agsurface_t *i = g_new(agsurface_t ,1); + int j; + BYTE *ys = GETOFFSET_PIXEL(dib, x, y); + BYTE *yd; + + // printf("save region %d,%d,%d,%d\n", x, y, w, h); + + i->width = w; + i->height = h; + i->bytes_per_line = w * dib->bytes_per_pixel; + i->bytes_per_pixel = dib->bytes_per_pixel; + i->pixel = yd = g_new(char, w * h * dib->bytes_per_pixel); + + for (j = 0; j < h; j++) { + memcpy(yd, ys, w * dib->bytes_per_pixel); + yd += (w * dib->bytes_per_pixel); + ys += dib->bytes_per_line; + } + return i; +} + +/* + * dib にセーブした領域を回復 + */ +void image_putRegion(agsurface_t *dib, agsurface_t *dst, int x, int y) { + BYTE *yd = GETOFFSET_PIXEL(dib, x, y); + BYTE *ys = GETOFFSET_PIXEL(dst, 0, 0); + int i; + int width, height; + + width = dst->width; + height = dst->height; + + if (x + width > dib->width) width = dib->width - x; + if (y + height > dib->height) height = dib->height - y; + + // printf("dibinfo %d, %d\n", dib->width, dib->height); + // printf("reginfo %d, %d\n", dst->width, dst->height); + // printf("width,height %d, %d\n", width, height); + + for (i = 0; i < height; i++) { + memcpy(yd, ys, width * dst->bytes_per_pixel); + ys += (dst->width * dst->bytes_per_pixel); + yd += dib->bytes_per_line; + } +} + +/* + * dib に dstを描画後、後始末 + */ +void image_restoreRegion(agsurface_t *dib, agsurface_t *dst, int x, int y) { + image_putRegion(dib, dst, x, y); + g_free(dst->pixel); + g_free(dst); +} + +/* + * save した領域の解放 + */ +void image_delRegion(agsurface_t *r) { + g_free(r->pixel); + g_free(r); +} + + +/* + * dib にセーブした領域からコピー + */ +void image_copyRegion(agsurface_t *src, int sx, int sy, int w, int h, agsurface_t *dib, int dx, int dy) { + int y; + BYTE *sdata = GETOFFSET_PIXEL(src, sx, sy); + BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy); + + for (y = 0; y < h; y++) { + memcpy(ddata, sdata, w * dib->bytes_per_pixel); + sdata += src->bytes_per_line; + ddata += dib->bytes_per_line; + } +} + + +/* + * dibに gpyphイメージを描画 + */ +void image_getGlyphImage(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + switch(glyph->bytes_per_pixel) { + case 1: + image_getGlyphImage8to8(dib, glyph, dx, dy, col); break; + case 2: + image_getGlyphImage16to16(dib, glyph, dx, dy, col); break; + case 3: + image_getGlyphImage24pto24(dib, glyph, dx, dy, col); break; + case 4: + image_getGlyphImage24to24(dib, glyph, dx, dy, col); break; + default: + break; + } +} + +/* + * img : 8bit DIB の先頭 + * glyph : 文字の書かれているイメージ (大きさ込) depth 15/16 + * dx, dy : 表示位置 + * col : 色 + */ +static void image_getGlyphImage16to8(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = GETOFFSET_PIXEL(glyph, 0, 0); + BYTE *yd; + WORD *ys; + + for (y = 0; y < glyph->height; y++) { + ys = (WORD *)(src + y * glyph->bytes_per_line); + yd = dst + y * dib->bytes_per_line; + for (x = 0; x < glyph->width; x++) { + if (*ys != 0) { + *yd = col; + } + ys++; yd++; + } + } +} + +static void image_getGlyphImage24to8(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = GETOFFSET_PIXEL(glyph, 0, 0); + BYTE *yd; + DWORD *ys; + + for (y = 0; y < glyph->height; y++) { + ys = (DWORD *)(src + y * glyph->bytes_per_line); + yd = dst + y * dib->bytes_per_line; + for (x = 0; x < glyph->width; x++) { + if (*ys == 1) { + *yd = col; + } + ys++; yd++; + } + } +} + +static void image_getGlyphImage24pto8(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = GETOFFSET_PIXEL(glyph, 0, 0); + BYTE *yd; + BYTE *ys; + + for (y = 0; y < glyph->height; y++) { + ys = (BYTE *)(src + y * glyph->bytes_per_line); + yd = dst + y * dib->bytes_per_line; + for (x = 0; x < glyph->width; x++) { + if (*ys == 1) { + *yd = col; + } + ys+=3; yd++; + } + } +} + +void image_getGlyphImageNto8(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + switch(glyph->bytes_per_pixel) { + case 2: + image_getGlyphImage16to8(dib, glyph, dx, dy, col); break; + case 3: + image_getGlyphImage24pto8(dib, glyph, dx, dy, col); break; + case 4: + image_getGlyphImage24to8(dib, glyph, dx, dy, col); break; + } +} + + +/* + * dib に指定のパレット sp を抜いてコピー + */ +void image_copyAreaSP(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int col) { + BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy); + + copy_area_sprite(dib, sdata, ddata, w, h, col); +} + +int image_index2pixel(int depth, int pal) { + return trans_index2pixel(depth, pal); +} + +void image_get_glyph(agsurface_t *gls, agsurface_t *gld) { + BYTE *dst = GETOFFSET_PIXEL(gld, 0, 0); + int x, y; + int dw = gls->width, dh = gls->height; + + switch(gls->bytes_per_pixel) { + case 1: + { + BYTE *src = GETOFFSET_PIXEL(gls, 0, 0); + for (y = 0; y < dh; y++) { + memcpy(dst, src, dw); + src += gls->bytes_per_line; + dst += gld->bytes_per_line; + } + break; + } + case 2: + { + WORD *src; + for (y = 0; y < dh; y++) { + src = (WORD *)(gls->pixel + y * gls->bytes_per_line); + dst = (BYTE *)(gld->pixel + y * gld->bytes_per_line); + for (x = 0; x < dw; x++) { + *dst = (*src) ? 1 : 0; + src++; dst++; + } + } + break; + } + case 3: + { + BYTE *src; + for (y = 0; y < dh; y++) { + src = (BYTE *)(gls->pixel + y * gls->bytes_per_line); + dst = (BYTE *)(gld->pixel + y * gld->bytes_per_line); + for (x = 0; x < dw; x++) { + *dst = (*src) ? 1 : 0; + src+=3; dst++; + } + } + break; + } + case 4: + { + DWORD *src; + for (y = 0; y < dh; y++) { + src = (DWORD *)(gls->pixel + y * gls->bytes_per_line); + dst = (BYTE *)(gld->pixel + y * gld->bytes_per_line); + for (x = 0; x < dw; x++) { + *dst = (*src) ? 1 : 0; + src++; dst++; + } + } + break; + } + } +} + +void image_draw_antialiased_pattern(agsurface_t *dib, agsurface_t *pattern, int dx, int dy, int dw, int dh, int col) { + draw_antialiased_pattern(dib, pattern, dx, dy, dw, dh, col); +} + +void image_draw_pattern(agsurface_t *dib, agsurface_t *pattern, int dx, int dy, int dw, int dh, int col) { +#define DRAWPATTERN(type) { \ + int x, y; \ + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); \ + BYTE *src = (BYTE *)pattern->pixel; \ + type *yd; \ + BYTE *ys; \ + for (y = 0; y < dh; y++) { \ + ys = (BYTE *)(src + y * pattern->bytes_per_line); \ + yd = (type *)(dst + y * dib->bytes_per_line); \ + for (x = 0; x < dw; x++) { \ + if (*ys) { \ + *yd = col; \ + } \ + ys++; yd++; \ + } \ + }} + + switch(dib->depth) { + case 8: + DRAWPATTERN(BYTE); break; + case 15: + case 16: + DRAWPATTERN(WORD); break; + case 24: + case 32: + DRAWPATTERN(DWORD); break; + } +} + +/* モザイク */ + +void image_Mosaic(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int slice) { +#define m_mozaic(type) { \ + type *p_ss = (type *)GETOFFSET_PIXEL(dib, sx, sy); \ + type *p_src; \ + int l = dib->bytes_per_line / dib->bytes_per_pixel * slice; \ + for (y = 0; y < h; y += slice) { \ + p_src = p_ss; \ + if ((y + slice) > h ) r.height = h - y; \ + r.width = slice; \ + for (x = 0; x < w; x += slice) { \ + cl = *p_src; \ + r.x = dx + x; \ + r.y = dy + y; \ + if ((r.x + slice) > w) r.width = w - x; \ + fill_rectangle(dib, r.x, r.y, r.width, r.height, cl); \ + p_src += slice; \ + } \ + p_ss += l; \ + }} + + int cl; + int x,y; + MyRectangle r; + + r.width=slice; + r.height=slice; + + switch(dib->depth) { + case 8: + m_mozaic(BYTE); + break; + case 16: + m_mozaic(WORD); + break; + case 24: + case 32: + m_mozaic(DWORD); + break; + } +} + +/******************************************************************************/ +/* private methods image操作 8bpp */ +/******************************************************************************/ + +static void image_drawLine8(agsurface_t *dib, int x0, int y0, int x1, int y1, int col) { + int dx = abs(x0 - x1), dy = abs(y0 - y1); + BYTE *p; + + if (dx == 0) { + int i = min(y0, y1); + p = GETOFFSET_PIXEL(dib, x0, i); + + for (i = 0; i < dy; i++) { + *p = col; + p += dib->bytes_per_line; + } + + } else if (dy == 0) { + int i = min(x0, x1); + p = GETOFFSET_PIXEL(dib, i, y0); + memset(p, col, dx); + + } else if (dx == dy) { + int i; + if (x0 < x1) { + p = GETOFFSET_PIXEL(dib, x0, y0); + if (y0 < y1) { + dy = dib->bytes_per_line + dib->bytes_per_pixel; + } else { + dy = -dib->bytes_per_line + dib->bytes_per_pixel; + } + } else { + p = GETOFFSET_PIXEL(dib, x1, y1); + if (y0 < y1) { + dy = -dib->bytes_per_line + dib->bytes_per_pixel; + } else { + dy = dib->bytes_per_line + dib->bytes_per_pixel; + } + } + for (i = 0; i < dx; i++) { + *p = col; + p += dy; + } + } else { + int i, d1, d2, ds, dd, imax; + + if (dx < dy) { + d1 = dib->bytes_per_line; + if (y0 > y1) { + p = GETOFFSET_PIXEL(dib, x1, y1); + d2 = dib->bytes_per_pixel * (x0 < x1 ? -1 : 1); + } else { + p = GETOFFSET_PIXEL(dib, x0, y0); + d2 = dib->bytes_per_pixel * (x0 < x1 ? 1 : -1); + } + ds = dx; + imax = dy; + } else { + d1 = dib->bytes_per_pixel; + if (x0 > x1) { + p = GETOFFSET_PIXEL(dib, x1, y1); + d2 = dib->bytes_per_line * (y0 < y1 ? -1 : 1); + } else { + p = GETOFFSET_PIXEL(dib, x0, y0); + d2 = dib->bytes_per_line * (y0 < y1 ? 1 : -1); + } + ds = dy; + imax = dx; + } + dd = 0; + for (i = 0; i < imax; i++) { + *p = col; + p += d1; + dd += ds; + if (dd > imax) { + p += d2; + dd -= imax; + } + } + } +} + +static void image_drawRectangle8(agsurface_t *dib, int x, int y, int w, int h, int col) { + BYTE *dst = GETOFFSET_PIXEL(dib, x, y); + int i; + + /* top */ + memset(dst, col, w); + + /* side */ + h-=2; + for (i = 0; i < h; i++) { + dst += dib->bytes_per_line; + *dst = col; + *(dst + w - 1) = col; + } + + /* bottom */ + dst += dib->bytes_per_line; + memset(dst, col, w); +} + +static void image_fillRectangle8(agsurface_t *dib, int x, int y, int w, int h, int col) { + BYTE *dst = GETOFFSET_PIXEL(dib, x, y); + int i; + + for (i = 0; i < h; i++) { + memset(dst, col, w); + dst += dib->bytes_per_line; + } +} + +static void image_copyArea8(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy) { + BYTE *src = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + + if (sy <= dy && dy < (sy + h)) { + src += (h-1) * dib->bytes_per_line; + dst += (h-1) * dib->bytes_per_line; + + while (h--) { + memmove(dst, src, w); + src -= dib->bytes_per_line; + dst -= dib->bytes_per_line; + } + } else { + while(h--) { + memmove(dst, src, w); + src += dib->bytes_per_line; + dst += dib->bytes_per_line; + } + } +} + +static void image_getGlyphImage8to8(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = GETOFFSET_PIXEL(glyph, 0, 0); + BYTE *yd; + BYTE *ys; + + for (y = 0; y < glyph->height; y++) { + ys = src + y * glyph->bytes_per_line; + yd = dst + y * dib->bytes_per_line; + for (x = 0; x < glyph->width; x++) { + if (*ys != 0) { + *yd = col; + } + ys++; yd++; + } + } +} + +static void image_copyAreaSP8(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int width, int height, int sp) { + int x, y; + BYTE *pix_dst, *pix_src; + + for (y = 0; y < height; y++) { + pix_src = (BYTE *)(sdata + y * dib->bytes_per_line); + pix_dst = (BYTE *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < width; x++) { + if (*pix_src != (BYTE)sp) { + *pix_dst = *pix_src; + } + pix_src++; + pix_dst++; + } + } +} + diff --git a/src/image.h b/src/image.h new file mode 100644 index 0000000..ed4251e --- /dev/null +++ b/src/image.h @@ -0,0 +1,71 @@ +/* + * image.h image操作 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: image.h,v 1.24 2003/01/12 10:48:50 chikama Exp $ */ + +#ifndef __IMAGE__ +#define __IMAGE__ + +#include "cg.h" +#include "ags.h" + +extern void image_setdepth(int); +extern void image_expandPixel(agsurface_t *img_src, agsurface_t *img_dst, int lv); +extern void image_fadeOut(agsurface_t *img, int lv, int col); +extern void image_fadeIn(agsurface_t *src, agsurface_t *dst, int lv); +extern void image_scaledCopyArea(agsurface_t *dib, agsurface_t *src, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int mirror); + +extern void image_drawImage8_fromData(agsurface_t *img, cgdata *cg, int x, int y, int w, int h); +extern void image_drawImage16_fromData(agsurface_t *img, cgdata *cg, int x, int y, int w, int h); +extern void image_drawLine(agsurface_t *dib, int x0, int y0, int x1, int y1, int col); +extern void image_drawRectangle(agsurface_t *dib, int x, int y, int w, int h, int col); +extern void image_fillRectangle(agsurface_t *dib, int x, int y, int w, int h, int col); +extern void image_copyArea(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy); +extern void image_copyAreaSP(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int col); +extern void image_copyAreaSP16_shadow(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int lv); +extern void image_copyAreaSP16_alphaBlend(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int col); +extern void image_copyAreaSP16_alphaLevel(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int col); +extern void image_copyAreaSP16_whiteLevel(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int col); +extern void image_copy_from_alpha(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag); +extern void image_copy_to_alpha(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag); +extern void image_wrapColor(agsurface_t *dib, int sx, int sy, int w, int h, int col, int rate); +extern void image_getPixel(agsurface_t *dib, int x, int y, Pallet *cell); + +extern agsurface_t* image_saveRegion(agsurface_t *dib, int x, int y, int w, int h); +extern void image_putRegion(agsurface_t *dib, agsurface_t *dst, int x, int y); +extern void image_restoreRegion(agsurface_t *dib, agsurface_t *dst, int x, int y); +extern void image_copyRegion(agsurface_t *src, int sx, int sy, int w, int h, agsurface_t *dib, int dx, int dy); +extern void image_delRegion(agsurface_t *r); + +extern void image_getGlyphImage(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col); +extern void image_getGlyphImageNto8(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col); +extern void image_changeColorArea8(agsurface_t *dib, int sx, int sy, int w, int h, int src, int dst, int cnt); +extern MyRectangle* image_imageFlood8(agsurface_t *dib, int x, int y, int c); +extern int image_index2pixel(int depth, int pal); +extern void image_get_glyph(agsurface_t *gls, agsurface_t *gld); +extern void image_draw_antialiased_pattern(agsurface_t *dib, agsurface_t *pattern, int dx, int dy, int dw, int dh, int col); +extern void image_draw_pattern(agsurface_t *dib, agsurface_t *pattern, int dx, int dy, int dw, int dh, int col); +extern void image_trans_pixel_24to24p(agsurface_t *src, agsurface_t *dst); +extern void image_Mosaic(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, int slice); +extern void image_fillRectangleNeg(agsurface_t *dib, int x, int y, int w, int h, int col); + +#endif /* __IMAGE__ */ + diff --git a/src/image15.c b/src/image15.c new file mode 100644 index 0000000..489ec81 --- /dev/null +++ b/src/image15.c @@ -0,0 +1,283 @@ +/* + * image15.c image操作(15bpp) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: image15.c,v 1.16 2006/04/21 16:40:48 chikama Exp $ */ + +#include +#include "portab.h" + +static void drawImage16_fromData15(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { + int x, y; + WORD *pic_src = (WORD *)(cg->pic + cg->data_offset); + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + WORD pic16; + WORD *yl; + + for (y = 0; y < h; y++) { + yl = (WORD *)(pic_dst + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + pic16 = *pic_src; + *yl = PIX15(RGB_PIXR16(pic16), RGB_PIXG16(pic16), RGB_PIXB16(pic16)); + (WORD *)yl ++; pic_src++; + } + pic_src += (cg->width - w); + } +} + +static void drawSprite16_fromData15(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { + int x, y; + WORD pic16; + WORD *pic_src = (WORD *)(cg->pic + cg->data_offset); + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *pic_dst_a = GETOFFSET_ALPHA(dib, dx, dy); + WORD *yl, pic15; + BYTE *ya; + + for (y = 0; y < h; y++) { + yl = (WORD *)(pic_dst + y * dib->bytes_per_line); + ya = (BYTE *)(pic_dst_a + y * dib->width); + for (x = 0; x < w; x++) { + pic16 = *pic_src; + pic15 = PIX15(RGB_PIXR16(pic16),RGB_PIXG16(pic16),RGB_PIXB16(pic16)); + if (*ya == 255) { + *yl = pic15; + } else if (*ya > 0) { + *yl= ALPHABLEND15(pic15, *yl, *ya); + } + yl ++; ya++; pic_src++; + } + pic_src += (cg->width - w); + } +} + +static void image_wrapColor15(agsurface_t *dib, BYTE *dst, int w, int h, int col, int rate) { + int x, y; + WORD *yls, yld; + + yld = trans_index2pixel(dib->depth, col); + + for (y = 0; y < h; y++) { + yls = (WORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yls = ALPHABLEND15(yld, *yls, rate); + yls++; + } + } +} + +static void image_copyAreaSP16_shadow15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, BYTE *adata, int lv) { + int x, y; + WORD *yls, *yld; + BYTE *yla; + + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + yla = (BYTE *)(adata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = ALPHABLEND15(*yls, *yld, (*yla * lv) / 255); + yls++; yld++; yla++; + } + } +} + +static void image_copyAreaSP16_alphaBlend15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + WORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = ALPHABLEND15(*yls, *yld, lv); + yls++; yld++; + } + } +} + +static void image_copyAreaSP16_alphaLevel15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + WORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = ALPHALEVEL15(*yls, lv); + yls++; yld++; + } + } +} + +static void image_copyAreaSP16_whiteLevel15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + WORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = WHITELEVEL15(*yls, lv); + yls++; yld++; + } + } +} + +static void image_copy_from_alpha15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) { + int x, y; + BYTE *yls; + WORD *yld; + + switch(flag) { + case TO_16H: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + /* *yld = */ + yld++; yls++; + } + } + break; + case TO_16L: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + /* *yld = (WORD)(*yls) | (*yld & 0xff00); */ + yld++; yls++; + } + } + break; + case TO_24R: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX15(*yls, PIXG15(*yld), PIXB15(*yld)); + yld++; yls++; + } + } + break; + case TO_24G: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX15(PIXR15(*yls), *yls, PIXB15(*yld)); + yld++; yls++; + } + } + break; + case TO_24B: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX15(PIXR15(*yld), PIXG15(*yld), *yls); + yld++; yls++; + } + } + break; + default: + break; + } +} + +static void image_copy_to_alpha15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) { + int x, y; + BYTE *yld; + WORD *yls; + + switch(flag) { + case FROM_16H: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)(PIX16(PIXR15(*yls), PIXG15(*yls), PIXB15(*yls)) >> 8); + yld++; yls++; + } + } + break; + case FROM_16L: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)(PIX16(PIXR15(*yls), PIXG15(*yls), PIXB15(*yls))); + yld++; yls++; + } + } + break; + case FROM_24R: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)PIXR15(*yls); + yld++; yls++; + } + } + break; + case FROM_24G: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)PIXG15(*yls); + yld++; yls++; + } + } + break; + case FROM_24B: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)PIXB15(*yls); + yld++; yls++; + } + } + break; + default: + break; + } +} + +void image_draw_antialiased_pattern15(agsurface_t *dib, agsurface_t *pattern, int dx, int dy, int dw, int dh, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = (BYTE *)pattern->pixel; + WORD *yd; + BYTE *ys; + + for (y = 0; y < dh; y++) { + ys = (BYTE *)(src + y * pattern->bytes_per_line); + yd = (WORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < dw; x++) { + if (*ys != 0) { + *yd = ALPHABLEND15(col, *yd, (BYTE)*ys); + } + ys++; yd++; + } + } +} diff --git a/src/image16.c b/src/image16.c new file mode 100644 index 0000000..dd1ce77 --- /dev/null +++ b/src/image16.c @@ -0,0 +1,558 @@ +/* + * image16.c image操作(16bpp) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: image16.c,v 1.20 2003/05/03 03:44:27 chikama Exp $ */ + +#include "config.h" +#include "portab.h" + +static void fadeOut16(agsurface_t *dst, int lv, int col) { + WORD *yld; + int x, y; + + for (y = 0; y < dst->height; y+=4) { + yld = (WORD *)(dst->pixel + (y + fadeY[lv]) * dst->bytes_per_line); + for (x = 0; x < dst->width; x+=4) { + *(yld + fadeX[lv]) = col; + yld+=4; + } + } +} + +static void fadeIn16(agsurface_t *src, agsurface_t *dst, int lv) { + WORD *yls, *yld; + int x, y; + + for (y = 0; y < src->height; y+=4) { + yls = (WORD *)(src->pixel + (y + fadeY[lv]) * src->bytes_per_line); + yld = (WORD *)(dst->pixel + (y + fadeY[lv]) * dst->bytes_per_line); + for (x = 0; x < src->width; x+=4) { + *(yld + fadeX[lv]) = *(yls + fadeX[lv]); + yls+=4; yld+=4; + } + } +} + +static void drawImage24_fromData16(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { + int x, y; + BYTE* pic_src = (BYTE *)(cg->pic + cg->data_offset); + BYTE* pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + WORD *yl; + + for (y = 0; y < h; y++) { + yl = (WORD *)(pic_dst + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + BYTE r, g, b; + r = *pic_src; + g = *(pic_src+1); + b = *(pic_src+2); + *yl = PIX16(r,g,b); + yl ++; pic_src+=3; + } + pic_src += (cg->width - w); + } +} + +static void drawImage16_fromData16(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { + int y; + WORD* pic_src = (WORD *)(cg->pic + cg->data_offset); + BYTE* pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + + for (y = 0; y < h; y++) { + memcpy(pic_dst, pic_src, w * 2); + pic_src += cg->width; + pic_dst += dib->bytes_per_line; + } +} + +static void drawSprite16_fromData16(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { + int x, y; + WORD pic16; + WORD *pic_src = (WORD *)(cg->pic + cg->data_offset); + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *pic_dst_a = GETOFFSET_ALPHA(dib, dx, dy); + WORD *yl; + BYTE *ya; + + for (y = 0; y < h; y++) { + yl = (WORD *)(pic_dst + y * dib->bytes_per_line); + ya = (BYTE *)(pic_dst_a + y * dib->width); + for (x = 0; x < w; x++) { + pic16 = *pic_src; + if (*ya == 255) { + *yl = pic16; + } else if (*ya > 0) { + *yl= ALPHABLEND16(pic16, *yl, *ya); + } + yl++; ya++; pic_src++; + } + pic_src += (cg->width - w); + } +} + +static void expandPixel8to16(agsurface_t *src, agsurface_t *dst) { + int x, y; + WORD *yd; + BYTE *ys; + + for (y = 0; y < src->height; y++) { + ys = (BYTE *)(src->pixel + y * src->bytes_per_line); + yd = (WORD *)(dst->pixel + y * dst->bytes_per_line); + for (x = 0; x < src->width; x++) { + *yd = xpal[*ys].pixel; + ys++; yd++; + } + } +} + +static void image_drawLine16(agsurface_t *dib, int x0, int y0, int x1, int y1, int col) { + int dx = abs(x0 - x1), dy = abs(y0 - y1); + + if (dx == 0) { + int i = min(y0, y1), d = dib->bytes_per_line / 2; + WORD *p = (WORD *)GETOFFSET_PIXEL(dib, x0, i); + + for (i = 0; i < dy; i++) { + *p = col; + p += d; + } + + } else if (dy == 0) { + int i = min(x0, x1), j; + WORD *p = (WORD *)GETOFFSET_PIXEL(dib, i, y0); + + for (j = 0; j < dx; j++) { + *(p++) = col; + } + + } else if (dx == dy) { + int i; + WORD *p; + + if (x0 < x1) { + p = (WORD *)GETOFFSET_PIXEL(dib, x0, y0); + if (y0 < y1) { + dy = dib->bytes_per_line + dib->bytes_per_pixel; + } else { + dy = -dib->bytes_per_line + dib->bytes_per_pixel; + } + } else { + p = (WORD *)GETOFFSET_PIXEL(dib, x1, y1); + if (y0 < y1) { + dy = -dib->bytes_per_line + dib->bytes_per_pixel; + } else { + dy = dib->bytes_per_line + dib->bytes_per_pixel; + } + } + dy /= 2; + for (i = 0; i < dx; i++) { + *p = col; + p += dy; + } + } else { + int i, d1, d2, ds, dd, imax; + WORD *p; + + if (dx < dy) { + d1 = dib->bytes_per_line; + if (y0 > y1) { + p = (WORD *)GETOFFSET_PIXEL(dib, x1, y1); + d2 = dib->bytes_per_pixel * (x0 < x1 ? -1 : 1); + } else { + p = (WORD *)GETOFFSET_PIXEL(dib, x0, y0); + d2 = dib->bytes_per_pixel * (x0 < x1 ? 1 : -1); + } + ds = dx; + imax = dy; + } else { + d1 = dib->bytes_per_pixel; + if (x0 > x1) { + p = (WORD *)GETOFFSET_PIXEL(dib, x1, y1); + d2 = dib->bytes_per_line * (y0 < y1 ? -1 : 1); + } else { + p = (WORD *)GETOFFSET_PIXEL(dib, x0, y0); + d2 = dib->bytes_per_line * (y0 < y1 ? 1 : -1); + } + ds = dy; + imax = dx; + } + dd = 0; + d1 /= 2; + d2 /= 2; + for (i = 0; i < imax; i++) { + *p = col; + p += d1; + dd += ds; + if (dd > imax) { + p += d2; + dd -= imax; + } + } + } +} + + +static void image_drawRectangle16(agsurface_t *dib, int x, int y, int w, int h, int col) { + BYTE *dst = GETOFFSET_PIXEL(dib, x, y); + int i; + + /* top */ + for (i = 0; i < w; i++) { + *((WORD *)dst + i) = col; + } + + /* side */ + h-=2; + for (i = 0; i < h; i++) { + dst += dib->bytes_per_line; + *((WORD *)dst) = col; + *((WORD *)dst + w - 1) = col; + } + + /* bottom */ + dst += dib->bytes_per_line; + for (i = 0; i < w; i++) { + *((WORD *)dst + i) = col; + } +} + +static void image_fillRectangle16(agsurface_t *dib, int x, int y, int w, int h, int col) { + BYTE *_dst, *dst = GETOFFSET_PIXEL(dib, x, y); + int i; + + _dst = dst; + + for (i = 0; i < w; i++) { + *((WORD *)dst + i) = col; + } + + for (i = 0; i < h -1; i++) { + dst += dib->bytes_per_line; + memcpy(dst, _dst, w * 2); + } +} + +static void image_copyArea16(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy) { + BYTE *src = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + + if (sy <= dy && dy < (sy + h)) { + src += (h-1) * dib->bytes_per_line; + dst += (h-1) * dib->bytes_per_line; + + while (h--) { + memmove(dst, src, w * 2); + src -= dib->bytes_per_line; + dst -= dib->bytes_per_line; + } + } else { + while(h--) { + memmove(dst, src, w * 2); + src += dib->bytes_per_line; + dst += dib->bytes_per_line; + } + } +} + +static void image_getGlyphImage16to16(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = (BYTE *)glyph->pixel; + WORD *yd; + WORD *ys; + + for (y = 0; y < glyph->height; y++) { + ys = (WORD *)(src + y * glyph->bytes_per_line); + yd = (WORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < glyph->width; x++) { + if (*ys != 0) { + *yd = col; + } + ys++; yd++; + } + } +} + +static void image_wrapColor16(agsurface_t *dib, BYTE *dst, int w, int h, int col, int rate) { + int x, y; + WORD *yls, yld; + + yld = trans_index2pixel(dib->depth, col); + + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + int alpha = rate | rate << 8 | rate << 16 | rate << 24; + ablend16_dpd(dst, yld, dst, alpha, w, h, dib->bytes_per_line, dib->bytes_per_line); +#endif + } else { + for (y = 0; y < h; y++) { + yls = (WORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yls = ALPHABLEND16(yld, *yls, rate); + yls++; + } + } + } +} + +static void image_copyAreaSP16_shadow16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, BYTE *adata, int lv) { + int x, y; + WORD *yls, *yld; + BYTE *yla; + + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + ablend16_ppp(ddata, sdata, ddata, adata, w, h, dib->bytes_per_line, dib->bytes_per_line, dib->bytes_per_line, dib->width, lv); +#endif + } else { + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + yla = (BYTE *)(adata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = ALPHABLEND16(*yls, *yld, (*yla * lv) / 255); + yls++; yld++; yla++; + } + } + } +} + +static void image_copyAreaSP16_transparent16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int pal) { + int x, y; + WORD *yls, *yld; + WORD yla = trans_index2pixel(dib->depth, pal); + + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + if (*yls != yla) { + *yld = *yls; + } + yls++; yld++; + } + } +} + +static void image_copyAreaSP16_alphaBlend16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + int alpha = lv | lv << 8 | lv << 16 | lv << 24; + ablend16_ppd(ddata, sdata, ddata, alpha, w, h, dib->bytes_per_line, dib->bytes_per_line, dib->bytes_per_line); +#endif + } else { + WORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = ALPHABLEND16(*yls, *yld, lv); + yls++; yld++; + } + } + } +} + +static void image_copyAreaSP16_alphaLevel16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + WORD *yls, *yld; + + if (nact->mmx_is_ok) { +// if (0) { +#ifdef ENABLE_MMX + int alpha; + lv = 255 - lv; + alpha = lv | lv << 8 | lv << 16 | lv << 24; + ablend16_dpd(ddata, 0, sdata, alpha, w, h, dib->bytes_per_line, dib->bytes_per_line); +#endif + } else { + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = ALPHALEVEL16(*yls, lv); + yls++; yld++; + } + } + } +} + +static void image_copyAreaSP16_whiteLevel16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + WORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = WHITELEVEL16(*yls, lv); + yls++; yld++; + } + } +} + +static void image_copy_from_alpha16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) { + int x, y; + BYTE *yls; + WORD *yld; + + switch(flag) { + case TO_16H: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = (WORD)(*yls << 8) | (*yld & 0xff); + yld++; yls++; + } + } + break; + case TO_16L: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = (WORD)(*yls) | (*yld & 0xff00); + yld++; yls++; + } + } + break; + case TO_24R: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX16(*yls, PIXG16(*yld), PIXB16(*yld)); + yld++; yls++; + } + } + break; + case TO_24G: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX16(PIXR16(*yls), *yls, PIXB16(*yld)); + yld++; yls++; + } + } + break; + case TO_24B: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (WORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX16(PIXR16(*yld), PIXG16(*yld), *yls); + yld++; yls++; + } + } + break; + default: + break; + } +} + +static void image_copy_to_alpha16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) { + int x, y; + BYTE *yld; + WORD *yls; + + switch(flag) { + case FROM_16H: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)(*yls >> 8); + yld++; yls++; + } + } + break; + case FROM_16L: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)(*yls); + yld++; yls++; + } + } + break; + case FROM_24R: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = PIXR16(*yls); + yld++; yls++; + } + } + break; + case FROM_24G: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = PIXG16(*yls); + yld++; yls++; + } + } + break; + case FROM_24B: + for (y = 0; y < h; y++) { + yls = (WORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = PIXB16(*yls); + yld++; yls++; + } + } + break; + default: + break; + } +} + + +void image_draw_antialiased_pattern16(agsurface_t *dib, agsurface_t *pattern, int dx, int dy, int dw, int dh, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = (BYTE *)pattern->pixel; + WORD *yd; + BYTE *ys; + + for (y = 0; y < dh; y++) { + ys = (BYTE *)(src + y * pattern->bytes_per_line); + yd = (WORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < dw; x++) { + if (*ys != 0) { + *yd = ALPHABLEND16(col, *yd, (BYTE)*ys); + } + ys++; yd++; + } + } +} diff --git a/src/image24.c b/src/image24.c new file mode 100644 index 0000000..5c3d68c --- /dev/null +++ b/src/image24.c @@ -0,0 +1,509 @@ +/* + * image24.c image操作(24/32bpp) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: image24.c,v 1.17 2006/04/21 16:40:48 chikama Exp $ */ + +#include +#include "portab.h" + +static void fadeOut24(agsurface_t *dst, int lv, int col) { + DWORD *yld; + int x, y; + + for (y = 0; y < dst->height; y+=4) { + yld = (DWORD *)(dst->pixel + (y + fadeY[lv]) * dst->bytes_per_line); + for (x = 0; x < dst->width; x+=4) { + *(yld + fadeX[lv]) = col; + yld+=4; + } + } +} + +static void fadeIn24(agsurface_t *src, agsurface_t *dst, int lv) { + DWORD *yls, *yld; + int x, y; + + for (y = 0; y < src->height; y+=4) { + yls = (DWORD *)(src->pixel + (y + fadeY[lv]) * src->bytes_per_line); + yld = (DWORD *)(dst->pixel + (y + fadeY[lv]) * dst->bytes_per_line); + for (x = 0; x < src->width; x+=4) { + *(yld + fadeX[lv]) = *(yls + fadeX[lv]); + yls+=4; yld+=4; + } + } +} + +static void drawImage16_fromData24(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { + int x, y; + WORD pic16; + WORD *pic_src = (WORD *)(cg->pic + cg->data_offset); + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + DWORD *yl; + + for (y = 0; y < h; y++) { + yl = (DWORD *)(pic_dst + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + pic16 = *pic_src; + *yl = PIX24(RGB_PIXR16(pic16),RGB_PIXG16(pic16),RGB_PIXB16(pic16)); + yl ++; pic_src++; + } + pic_src += (cg->width - w); + } +} + +static void drawSprite16_fromData24(agsurface_t *dib, cgdata *cg, int dx, int dy, int w, int h) { + int x, y; + WORD pic16; + WORD *pic_src = (WORD *)(cg->pic + cg->data_offset); + BYTE *pic_dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *pic_dst_a = GETOFFSET_ALPHA(dib, dx, dy); + DWORD *yl, pic24; + BYTE *ya; + + for (y = 0; y < h; y++) { + yl = (DWORD *)(pic_dst + y * dib->bytes_per_line); + ya = (BYTE *)(pic_dst_a + y * dib->width); + for (x = 0; x < w; x++) { + pic16 = *pic_src; + pic24 = PIX24(RGB_PIXR16(pic16),RGB_PIXG16(pic16),RGB_PIXB16(pic16)); + if (*ya == 255) { + *yl = pic24; + } else if (*ya > 0) { + *yl = ALPHABLEND24(pic24, *yl, *ya); + } + yl ++; ya++; pic_src++; + } + pic_src += (cg->width - w); + } +} + +static void expandPixel8to24(agsurface_t *src, agsurface_t *dst) { + int x, y; + DWORD *yd; + BYTE *ys; + + for (y = 0; y < src->height; y++) { + ys = (BYTE *)(src->pixel + y * src->bytes_per_line); + yd = (DWORD *)(dst->pixel + y * dst->bytes_per_line); + for (x = 0; x < src->width; x++) { + *yd = xpal[*ys].pixel; + ys++; yd++; + } + } +} + +static void image_drawLine24(agsurface_t *dib, int x0, int y0, int x1, int y1, int col) { + int dx = abs(x0 - x1), dy = abs(y0 - y1); + + if (dx == 0) { + int i = min(y0, y1), d = dib->bytes_per_line / 4; + DWORD *p = (DWORD *)GETOFFSET_PIXEL(dib, x0, i); + + for (i = 0; i < dy; i++) { + *p = col; + p += d; + } + + } else if (dy == 0) { + int i = min(x0, x1), j; + DWORD *p = (DWORD *)GETOFFSET_PIXEL(dib, i, y0); + + for (j = 0; j < dx; j++) { + *(p++) = col; + } + + } else if (dx == dy) { + int i; + DWORD *p; + + if (x0 < x1) { + p = (DWORD *)GETOFFSET_PIXEL(dib, x0, y0); + if (y0 < y1) { + dy = dib->bytes_per_line + dib->bytes_per_pixel; + } else { + dy = -dib->bytes_per_line + dib->bytes_per_pixel; + } + } else { + p = (DWORD *)GETOFFSET_PIXEL(dib, x1, y1); + if (y0 < y1) { + dy = -dib->bytes_per_line + dib->bytes_per_pixel; + } else { + dy = dib->bytes_per_line + dib->bytes_per_pixel; + } + } + dy /= 4; + for (i = 0; i < dx; i++) { + *p = col; + p += dy; + } + } else { + int i, d1, d2, ds, dd, imax; + DWORD *p; + + if (dx < dy) { + d1 = dib->bytes_per_line; + if (y0 > y1) { + p = (DWORD *)GETOFFSET_PIXEL(dib, x1, y1); + d2 = dib->bytes_per_pixel * (x0 < x1 ? -1 : 1); + } else { + p = (DWORD *)GETOFFSET_PIXEL(dib, x0, y0); + d2 = dib->bytes_per_pixel * (x0 < x1 ? 1 : -1); + } + ds = dx; + imax = dy; + } else { + d1 = dib->bytes_per_pixel; + if (x0 > x1) { + p = (DWORD *)GETOFFSET_PIXEL(dib, x1, y1); + d2 = dib->bytes_per_line * (y0 < y1 ? -1 : 1); + } else { + p = (DWORD *)GETOFFSET_PIXEL(dib, x0, y0); + d2 = dib->bytes_per_line * (y0 < y1 ? 1 : -1); + } + ds = dy; + imax = dx; + } + dd = 0; + d1 /= 4; + d2 /= 4; + for (i = 0; i < imax; i++) { + *p = col; + p += d1; + dd += ds; + if (dd > imax) { + p += d2; + dd -= imax; + } + } + } +} + +static void image_drawRectangle24(agsurface_t *dib, int x, int y, int w, int h, int col) { + BYTE *dst = GETOFFSET_PIXEL(dib, x, y); + int i; + + /* top */ + for (i = 0; i < w; i++) { + *((DWORD *)dst + i) = col; + } + + /* side */ + h-=2; + for (i = 0; i < h; i++) { + dst += dib->bytes_per_line; + *((DWORD *)dst) = col; + *((DWORD *)dst + w - 1) = col; + } + + /* bottom */ + dst += dib->bytes_per_line; + for (i = 0; i < w; i++) { + *((DWORD *)dst + i) = col; + } +} + +static void image_fillRectangle24(agsurface_t *dib, int x, int y, int w, int h, int col) { + BYTE *_dst, *dst = GETOFFSET_PIXEL(dib, x, y); + int i; + + _dst = dst; + + for (i = 0; i < w; i++) { + *((DWORD *)dst + i) = col; + } + + for (i = 0; i < h -1; i++) { + dst += dib->bytes_per_line; + memcpy(dst, _dst, w * 4); + } +} + +static void image_copyArea24(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy) { + BYTE *src = GETOFFSET_PIXEL(dib, sx, sy); + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + + if (sy <= dy && dy < (sy + h)) { + src += (h-1) * dib->bytes_per_line; + dst += (h-1) * dib->bytes_per_line; + + while (h--) { + memmove(dst, src, w * 4); + src -= dib->bytes_per_line; + dst -= dib->bytes_per_line; + } + } else { + while(h--) { + memmove(dst, src, w * 4); + src += dib->bytes_per_line; + dst += dib->bytes_per_line; + } + } +} + +static void image_getGlyphImage24to24(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = (BYTE *)glyph->pixel; + DWORD *yd; + DWORD *ys; + + for (y = 0; y < glyph->height; y++) { + ys = (DWORD *)(src + y * glyph->bytes_per_line); + yd = (DWORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < glyph->width; x++) { + if (*ys != 0) { + *yd = col; + } + ys++; yd++; + } + } +} + +static void image_wrapColor24(agsurface_t *dib, BYTE *dst, int w, int h, int col, int rate) { + int x, y; + DWORD *yls, yld; + + yld = trans_index2pixel(dib->depth, col); + + for (y = 0; y < h; y++) { + yls = (DWORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yls = ALPHABLEND24(yld, *yls, rate); + yls++; + } + } +} + +static void image_copyAreaSP16_shadow24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, BYTE *adata, int lv) { + int x, y; + DWORD *yls, *yld; + BYTE *yla; + + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + yla = (BYTE *)(adata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = ALPHABLEND24(*yls, *yld, (*yla * lv) / 255); + yls++; yld++; yla++; + } + } +} + +static void image_copyAreaSP16_transparent24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int pal) { + int x, y; + DWORD *yls, *yld; + DWORD yla = trans_index2pixel(dib->depth, pal) & 0xf0f0f0; + + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + if ((*yls & 0xf0f0f0) != yla) { + *yld = *yls; + } + yls++; yld++; + } + } +} + +static void image_copyAreaSP16_alphaBlend24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + DWORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = ALPHABLEND24(*yls, *yld, lv); + yls++; yld++; + } + } +} + +static void image_copyAreaSP16_alphaLevel24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + DWORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = ALPHALEVEL24(*yls, lv); + yls++; yld++; + } + } +} + +static void image_copyAreaSP16_whiteLevel24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, int lv) { + int x, y; + DWORD *yls, *yld; + + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = WHITELEVEL24(*yls, lv); + yls++; yld++; + } + } +} + +static void image_copy_from_alpha24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) { + int x, y; + BYTE *yls; + DWORD *yld; + + switch(flag) { + case TO_16H: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + /* *yld = */ + yld++; yls++; + } + } + break; + case TO_16L: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + /* *yld = (WORD)(*yls) | (*yld & 0xff00); */ + yld++; yls++; + } + } + break; + case TO_24R: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX24(*yls, PIXG24(*yld), PIXB24(*yld)); + yld++; yls++; + } + } + break; + case TO_24G: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX24(PIXR24(*yls), *yls, PIXB24(*yld)); + yld++; yls++; + } + } + break; + case TO_24B: + for (y = 0; y < h; y++) { + yls = (BYTE *)(sdata + y * dib->width); + yld = (DWORD *)(ddata + y * dib->bytes_per_line); + for (x = 0; x < w; x++) { + *yld = PIX24(PIXR24(*yld), PIXG24(*yld), *yls); + yld++; yls++; + } + } + break; + default: + break; + } +} + +static void image_copy_to_alpha24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) { + int x, y; + BYTE *yld; + DWORD *yls; + + switch(flag) { + case FROM_16H: + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)(PIX16(PIXR24(*yls), PIXG24(*yls), PIXB24(*yls)) >> 8); + yld++; yls++; + } + } + break; + case FROM_16L: + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)(PIX16(PIXR24(*yls), PIXG24(*yls), PIXB24(*yls))); + yld++; yls++; + } + } + break; + case FROM_24R: + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)PIXR24(*yls); + yld++; yls++; + } + } + break; + case FROM_24G: + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)PIXG24(*yls); + yld++; yls++; + } + } + break; + case FROM_24B: + for (y = 0; y < h; y++) { + yls = (DWORD *)(sdata + y * dib->bytes_per_line); + yld = (BYTE *)(ddata + y * dib->width); + for (x = 0; x < w; x++) { + *yld = (BYTE)PIXB24(*yls); + yld++; yls++; + } + } + break; + default: + break; + } +} + +void image_draw_antialiased_pattern24(agsurface_t *dib, agsurface_t *pattern, int dx, int dy, int dw, int dh, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = (BYTE *)pattern->pixel; + DWORD *yd; + BYTE *ys; + + for (y = 0; y < dh; y++) { + ys = (BYTE *)(src + y * pattern->bytes_per_line); + yd = (DWORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < dw; x++) { + if (*ys) { + *yd = ALPHABLEND24(col, *yd, (BYTE)*ys); + } + ys++; yd++; + } + } +} diff --git a/src/image24p.c b/src/image24p.c new file mode 100644 index 0000000..a4419ab --- /dev/null +++ b/src/image24p.c @@ -0,0 +1,109 @@ +/* + * image24p.c image操作(packed 24bpp) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: image24p.c,v 1.4 2006/04/21 16:40:48 chikama Exp $ */ + +#include "portab.h" +#include "image.h" + +static void expandPixel8to24p(agsurface_t *src, agsurface_t *dst) { + Pallet256 *pal = nact->sys_pal; + int x, y; + BYTE *yd; + BYTE *ys; + + for (y = 0; y < src->height; y++) { + ys = (BYTE *)(src->pixel + y * src->bytes_per_line); + yd = (BYTE *)(dst->pixel + y * dst->bytes_per_line); + for (x = 0; x < src->width; x++) { + *yd = pal->blue[*ys]; yd++; + *yd = pal->green[*ys]; yd++; + *yd = pal->red[*ys]; yd++; ys++; + } + } +} + +void image_trans_pixel_24to24p(agsurface_t *src, agsurface_t *dst) { + int x, y; + BYTE *yd; + DWORD *ys; + + for (y = 0; y < src->height; y++) { + ys = (DWORD *)(src->pixel + y * src->bytes_per_line); + yd = (BYTE *)(dst->pixel + y * dst->bytes_per_line); + for (x = 0; x < src->width; x++) { + *yd = PIXB24(*ys); yd++; + *yd = PIXG24(*ys); yd++; + *yd = PIXR24(*ys); yd++; ys++; + } + } +} + +static void image_getGlyphImage24pto24(agsurface_t *dib, agsurface_t *glyph, int dx, int dy, int col) { + int x, y; + BYTE *dst = GETOFFSET_PIXEL(dib, dx, dy); + BYTE *src = (BYTE *)glyph->pixel; + DWORD *yd; + BYTE *ys; + + for (y = 0; y < glyph->height; y++) { + ys = (BYTE *)(src + y * glyph->bytes_per_line); + yd = (DWORD *)(dst + y * dib->bytes_per_line); + for (x = 0; x < glyph->width; x++) { + if (*ys != 0) { + *yd = col; + } + ys+=3; yd++; + } + } +} + +static void fadeOut24p(agsurface_t *dst, int lv, int col) { + BYTE *yld; + int x, y; + + for (y = 0; y < dst->height; y+=4) { + yld = (BYTE *)(dst->pixel + (y + fadeY[lv]) * dst->bytes_per_line); + for (x = 0; x < dst->width; x+=4) { + *(yld + fadeX[lv]) = + *(yld + fadeX[lv] +1) = + *(yld + fadeX[lv] +2) = (BYTE)col; + yld += (4*3); + } + } +} + +static void fadeIn24p(agsurface_t *src, agsurface_t *dst, int lv) { + DWORD *yls; + BYTE *yld; + int x, y; + + for (y = 0; y < src->height; y+=4) { + yls = (DWORD *)(src->pixel + (y + fadeY[lv]) * src->bytes_per_line); + yld = (BYTE *)(dst->pixel + (y + fadeY[lv]) * dst->bytes_per_line); + for (x = 0; x < src->width; x+=4) { + *(yld + fadeX[lv] ) = PIXB24(*(yls + fadeX[lv])); + *(yld + fadeX[lv] +1) = PIXG24(*(yls + fadeX[lv])); + *(yld + fadeX[lv] +2) = PIXR24(*(yls + fadeX[lv])); + yls+=4; yld+=(4*3); + } + } +} diff --git a/src/imput.c b/src/imput.c new file mode 100644 index 0000000..d3abcaf --- /dev/null +++ b/src/imput.c @@ -0,0 +1,147 @@ +/* + * imput.c キーボードマウス関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: imput.c,v 1.22 2001/03/30 19:16:38 chikama Exp $ */ + +#include +#include +#include "config.h" +#include "imput.h" +#include "xsystem35.h" +#include "message.h" +#include "joystick.h" + +static boolean skipToNextSel = FALSE; +static boolean skipModeInterruptable = TRUE; + +static int hak_ignore_mask = 0xffffffff; +static int hak_releasewait_mask = (0 << 0) | (0 << 1) | (0 << 2) | (0 << 3) | + (1 << 4) | (0 << 5) | (0 << 6) | (0 << 7) ; + +void set_skipMode(boolean bool) { + skipToNextSel = bool; +} + +boolean get_skipMode() { + return skipToNextSel; +} + +void set_skipMode2(boolean bool) { + skipModeInterruptable = bool; +} + +boolean get_skipMode2() { + return skipModeInterruptable; +} + +void set_hak_keymode(int key, int mode) { + int flg = (1 << key); + + if (mode == 2) { + hak_ignore_mask |= flg; + } else { + hak_ignore_mask ^= flg; + if (mode == 0) { + hak_releasewait_mask &= ~flg; + } else { + hak_releasewait_mask |= flg; + } + } +} + +int sys_getMouseInfo(MyPoint *p, boolean is_dibgeo) { + MyPoint _p; + int key = GetMouseInfo(&_p); + + if (p) { + p->x = _p.x; + p->y = _p.y; + if (is_dibgeo) { + p->x += nact->sys_view_area.x; + p->y += nact->sys_view_area.y; + } + } + return key; +} + +int sys_getKeyInfo() { + return GetKeyInfo(); +} + +int sys_getJoyInfo() { + return joy_getinfo(); +} + +int sys_getInputInfo() { + int key = GetMouseInfo(NULL) | GetKeyInfo() | joy_getinfo(); + + if (key == SYS35KEY_SPC && skipModeInterruptable) { + skipToNextSel = FALSE; + } + + /* 復活 !! */ + if (key == (SYS35KEY_SPC | SYS35KEY_RET | SYS35KEY_ESC)) sys_exit(0); + + return key; +} + +void sys_hit_any_key() { + int key=0; + if (skipToNextSel) return; + + msg_hitAnyKey(); + + /* message wait flag restore */ + if (nact->messagewait_enable_save) { + nact->messagewait_enable = nact->messagewait_enable_save ; + + while(0 == (key & hak_ignore_mask)) { + key = sys_keywait(INT_MAX, TRUE); + } + while(key & hak_releasewait_mask) { + key = sys_keywait(100, TRUE); + } + } + + while(0 == (key & hak_ignore_mask)) { + key = sys_keywait(INT_MAX, TRUE); + } + + while(key & hak_releasewait_mask) { + key = sys_keywait(100, TRUE); + } + + +} + +void sys_key_releasewait(int key, boolean zi_mask_enabled) { + int mask; + + if (zi_mask_enabled) { + mask = hak_releasewait_mask; + } else { + mask = 0xffffffff; + } + + while(key & mask) { + key = sys_keywait(50, FALSE); + } +} diff --git a/src/imput.h b/src/imput.h new file mode 100644 index 0000000..5d50140 --- /dev/null +++ b/src/imput.h @@ -0,0 +1,55 @@ +/* + * imput.c キーボードマウス関連 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: imput.h,v 1.15 2001/03/30 19:16:38 chikama Exp $ */ + +#ifndef __IMPUT__ +#define __IMPUT__ + +#include "portab.h" +#include "graphics.h" +#include "graphicsdevice.h" + +#define SYS35KEY_NULL 0 +#define SYS35KEY_UP 1 +#define SYS35KEY_DOWN 2 +#define SYS35KEY_LEFT 4 +#define SYS35KEY_RIGHT 8 +#define SYS35KEY_RET 16 +#define SYS35KEY_SPC 32 +#define SYS35KEY_ESC 64 +#define SYS35KEY_TAB 128 + +extern int sys_getMouseInfo(MyPoint *p, boolean is_dibgeo); +extern int sys_getInputInfo(void); +extern int sys_getKeyInfo(void); +extern int sys_getJoyInfo(void); +extern void sys_key_releasewait(int key, boolean zi_mask_enabled); +extern void sys_hit_any_key(); +extern void set_skipMode(boolean bool); +extern void set_skipMode2(boolean bool); +extern boolean get_skipMode(); +extern boolean get_skipMode2(); +extern void set_hak_keymode(int key, int mode); + +#define sys_keywait(r,flg) Keywait(r,flg) + +#endif /* __IMPUT__ */ diff --git a/src/joystick.h b/src/joystick.h new file mode 100644 index 0000000..a80629c --- /dev/null +++ b/src/joystick.h @@ -0,0 +1,33 @@ +/* + * joystick.h joystick interface + * + * Copyright (C) 1999- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: joystick.h,v 1.7 2001/01/21 23:04:16 chikama Exp $ */ + +#ifndef __JOYSTICK_H__ +#define __JOYSTICK_H__ + +#include "portab.h" + +extern void joy_set_devicename(char *); +extern int joy_open(void); +extern void joy_close(void); +extern int joy_getinfo(void); + +#endif /* !__JOYSTICK_H__ */ diff --git a/src/joystick_dmy.c b/src/joystick_dmy.c new file mode 100644 index 0000000..5782850 --- /dev/null +++ b/src/joystick_dmy.c @@ -0,0 +1,40 @@ +/* + * joystick_dmy.h joystick interface for dummy + * + * Copyright (C) 1999- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: joystick_dmy.c,v 1.5 2000/11/25 13:09:07 chikama Exp $ */ + +#include "joystick.h" +#include "portab.h" + +void joy_set_devicename(char *name) { + return; +} + +int joy_open(void) { + return -1; +} + +void joy_close(void) { + return; +} + +int joy_getinfo(void) { + return 0; +} diff --git a/src/joystick_linux.c b/src/joystick_linux.c new file mode 100644 index 0000000..b78945b --- /dev/null +++ b/src/joystick_linux.c @@ -0,0 +1,148 @@ +/* + * joystick_linux.c joystick interface for linux (kernel 2.2.x) + * + * Copyright (C) 1999- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: joystick_linux.c,v 1.8 2000/11/25 13:09:08 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "joystick.h" +#include "portab.h" + +#ifndef JOY_DEVICE +#define JOY_DEVICE "/dev/js0" +#endif + +static char *dev_joy = JOY_DEVICE; +static int joy_fd=-1,joy_dat=0,joy_sens=19660; +static unsigned char joy_axes,joy_buttons; +static boolean joy_enable=TRUE; +static struct js_event js; + +void joy_set_devicename(char *name) { + if (0 == strcmp("none", name)) dev_joy = NULL; + else dev_joy = strdup(name); +} + +int joy_open(void) { + if( dev_joy == NULL ) return -1; + joy_fd=open(dev_joy,O_RDONLY); + if( joy_fd < 0 ) { + joy_enable=FALSE; + return joy_fd; + } + ioctl(joy_fd,JSIOCGAXES,&joy_axes); + ioctl(joy_fd,JSIOCGBUTTONS,&joy_buttons); + printf("open %s axes %d buttons %d\n",dev_joy,joy_axes,joy_buttons); + + return joy_fd; +} + +void joy_close(void) { + if( joy_fd < 0 ) return; + close(joy_fd); + return; +} + +int joy_getinfo(void) { + int err; + struct timeval tv; + fd_set set; + int max_fd; + + return 0; + if( joy_fd < 0 || !joy_enable ) return 0; + max_fd = joy_fd+1; + tv.tv_sec = 0; + tv.tv_usec = 1000; + FD_ZERO(&set); + FD_SET(joy_fd,&set); + while( select(max_fd,&set,NULL,NULL,&tv) ) { + if( FD_ISSET(joy_fd,&set) ) { + err=read(joy_fd,&js,sizeof(js)); + if( err != sizeof(js) ) return joy_dat; + switch(js.type & ~JS_EVENT_INIT) { + case JS_EVENT_BUTTON: + if( js.number < 4 ) { + joy_dat &= ~(1<<(js.number+4)); + joy_dat |= js.value<<(js.number+4); + } + break; + case JS_EVENT_AXIS: + if( js.number == 0 ) { + joy_dat &= ~(0x0c); + if( js.value > joy_sens ) joy_dat |= 8; + if( js.value < -joy_sens ) joy_dat |= 4; + } else if( js.number == 1 ) { + joy_dat &= ~(0x03); + if( js.value > joy_sens ) joy_dat |= 2; + if( js.value < -joy_sens ) joy_dat |= 1; + } + break; + } + } + } + return joy_dat; +} + +#if 0 +boolean joy_getinfo(int *data) { + int err; + + if( joy_fd < 0 || !joy_enable ) return FALSE; + + err = read(joy_fd, &js, sizeof(js)); + if( err != sizeof(js) ) { + *data = joy_dat; + return TRUE; + } + switch(js.type & ~JS_EVENT_INIT) { + case JS_EVENT_BUTTON: + if( js.number < 4 ) { + joy_dat &= ~(1<<(js.number+4)); + joy_dat |= js.value<<(js.number+4); + } + break; + case JS_EVENT_AXIS: + if( js.number == 0 ) { + joy_dat &= ~(0x0c); + if( js.value > joy_sens ) joy_dat |= 8; + if( js.value < -joy_sens ) joy_dat |= 4; + } else if( js.number == 1 ) { + joy_dat &= ~(0x03); + if( js.value > joy_sens ) joy_dat |= 2; + if( js.value < -joy_sens ) joy_dat |= 1; + } + break; + } + *data = joy_dat; + return TRUE; +} +#endif diff --git a/src/joystick_sdl.c b/src/joystick_sdl.c new file mode 100644 index 0000000..27e74ee --- /dev/null +++ b/src/joystick_sdl.c @@ -0,0 +1,81 @@ +/* + * joystick_sdl.c joystick interface for SDL 1.1 and over + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: joystick_sdl.c,v 1.3 2000/11/25 13:09:08 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "joystick.h" +#include "sdl_core.h" + +static int joy_axes, joy_buttons; +static char *dev_joy = NULL; +static boolean joy_enable=TRUE; +static SDL_Joystick *js; + +void joy_set_devicename(char *name) { + if( dev_joy ) free(dev_joy); + dev_joy=strdup(name); +} + +int joy_open(void) { + int i; + const char *name; + for( i=0 ; i + * + * 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 + * +*/ +/* $Id: key.h,v 1.2 2000/08/11 18:55:51 chikama Exp $ */ + +#ifndef __KEYCODE__ +#define __KEYCODE__ + +#define KEY_UNDEFINED (0x00) +#define KEY_MOUSE_LEFT (0x01) +#define KEY_MOUSE_RIGHT (0x02) +#define KEY_CONTROL (0x03) +#define KEY_MOUSE_MIDDLE (0x04) +#define KEY_BS (0x08) +#define KEY_BACKSPACE (0x08) +#define KEY_TAB (0x09) +#define KEY_CLEAR (0x0c) +#define KEY_ENTER (0x0d) +#define KEY_PAD_ENTER (0x0d) +#define KEY_RETURN (0x0d) +#define KEY_SHIFT (0x10) +#define KEY_LSHIFT (0x10) +#define KEY_RSHIFT (0x10) +#define KEY_CTRL (0x11) +#define KEY_LCTRL (0x11) +#define KEY_RCTRL (0x11) +#define KEY_ALT (0x12) +#define KEY_LALT (0x12) +#define KEY_RALT (0x12) +#define KEY_PAUSE (0x13) +#define KEY_CAPSLOCK (0x14) +#define KEY_KANAKAN (0x15) +#define KEY_ESC (0x1b) +#define KEY_ESCAPE (0x1b) +#define KEY_SPACE (0x20) +#define KEY_PAGEUP (0x21) +#define KEY_PAGEDOWN (0x22) +#define KEY_END (0x23) +#define KEY_HOME (0x24) +#define KEY_LEFT (0x25) +#define KEY_UP (0x26) +#define KEY_RIGHT (0x27) +#define KEY_DOWN (0x28) +#define KEY_SELECT (0x29) +#define KEY_EXECUTE (0x2b) +#define KEY_PRINTSCREEN (0x2c) +#define KEY_INS (0x2d) +#define KEY_INSERT (0x2d) +#define KEY_DEL (0x2e) +#define KEY_DELETE (0x2e) +#define KEY_HELP (0x2f) +#define KEY_0 (0x30) +#define KEY_1 (0x31) +#define KEY_2 (0x32) +#define KEY_3 (0x33) +#define KEY_4 (0x34) +#define KEY_5 (0x35) +#define KEY_6 (0x36) +#define KEY_7 (0x37) +#define KEY_8 (0x38) +#define KEY_9 (0x39) +#define KEY_PAD_EQUALS (0x3d) +#define KEY_A (0x41) +#define KEY_B (0x42) +#define KEY_C (0x43) +#define KEY_D (0x44) +#define KEY_E (0x45) +#define KEY_F (0x46) +#define KEY_G (0x47) +#define KEY_H (0x48) +#define KEY_I (0x49) +#define KEY_J (0x4a) +#define KEY_K (0x4b) +#define KEY_L (0x4c) +#define KEY_M (0x4d) +#define KEY_N (0x4e) +#define KEY_O (0x4f) +#define KEY_P (0x50) +#define KEY_Q (0x51) +#define KEY_R (0x52) +#define KEY_S (0x53) +#define KEY_T (0x54) +#define KEY_U (0x55) +#define KEY_V (0x56) +#define KEY_W (0x57) +#define KEY_X (0x58) +#define KEY_Y (0x59) +#define KEY_Z (0x5a) +#define KEY_PAD_0 (0x60) +#define KEY_PAD_1 (0x61) +#define KEY_PAD_2 (0x62) +#define KEY_PAD_3 (0x63) +#define KEY_PAD_4 (0x64) +#define KEY_PAD_5 (0x65) +#define KEY_PAD_6 (0x66) +#define KEY_PAD_7 (0x67) +#define KEY_PAD_8 (0x68) +#define KEY_PAD_9 (0x69) +#define KEY_PAD_STAR (0x6a) +#define KEY_PAD_MULTIPLY (0x6a) +#define KEY_PAD_PLUS (0x6b) +#define KEY_PAD_SEP (0x6c) +#define KEY_PAD_MINUS (0x6d) +#define KEY_PAD_DOT (0x6e) +#define KEY_PAD_PERIOD (0x6e) +#define KEY_PAD_SLASH (0x6f) +#define KEY_PAD_DIVIDE (0x6f) +#define KEY_F1 (0x70) +#define KEY_F2 (0x71) +#define KEY_F3 (0x72) +#define KEY_F4 (0x73) +#define KEY_F5 (0x74) +#define KEY_F6 (0x75) +#define KEY_F7 (0x76) +#define KEY_F8 (0x77) +#define KEY_F9 (0x78) +#define KEY_F10 (0x79) +#define KEY_F11 (0x7a) +#define KEY_F12 (0x7b) +#define KEY_F13 (0x7c) +#define KEY_F14 (0x7d) +#define KEY_F15 (0x7e) +#define KEY_F16 (0x7f) +#define KEY_F17 (0x80) +#define KEY_F18 (0x81) +#define KEY_F19 (0x82) +#define KEY_F20 (0x83) +#define KEY_F21 (0x84) +#define KEY_F22 (0x85) +#define KEY_F23 (0x86) +#define KEY_F24 (0x87) +#define KEY_NUMLOCK (0x90) +#define KEY_SCROLL_LOCK (0x91) +#define KEY_SCROLLOCK (0x91) + +#endif /* __KEYCODE__ */ diff --git a/src/menu.c b/src/menu.c new file mode 100644 index 0000000..9e1bf24 --- /dev/null +++ b/src/menu.c @@ -0,0 +1,224 @@ +/* + * menu.c popup menu + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: menu.c,v 1.14 2002/09/18 13:16:22 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "menu.h" +#include "menu_gui.h" +#include "menu_callback.h" +#include "nact.h" +#include "imput.h" +#include "music.h" + + +#ifndef GTK_CHECK_VERSION +#define GTK_CHECK_VERSION(major,minor,micro) \ +(GTK_MAJOR_VERSION > (major) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION > (minor)) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION == (minor) && \ + GTK_MICRO_VERSION >= (micro))) +#endif /* !GTK_CHECK_VERSION */ + +#if defined (GTK_CHECK_VERSION) && GTK_CHECK_VERSION (1,2,0) +#define GTKV12 +#else +#define GTKV10 +#endif + +static boolean menu_initilized = FALSE; + +static int menu_callback() { + sys_getInputInfo(); + return TRUE; +} + + +void menu_open(void) { + if (!menu_initilized) return; + +#ifdef GTKV12 + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item_msgskip_on), get_skipMode()); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(menu_item_msgskip_off), !get_skipMode()); +#else + gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM(menu_item_msgskip_on), get_skipMode()); + gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM(menu_item_msgskip_off), !get_skipMode()); +#endif + gtk_menu_popup(GTK_MENU(menu_window_popup), NULL, NULL, NULL, NULL, 0, 100); + gtk_widget_show(menu_window_popup); + nact->popupmenu_opened = TRUE; +} + +void menu_quitmenu_open(void) { + if (!menu_initilized) return; + + gtk_widget_show(menu_window_exit); + nact->popupmenu_opened = TRUE; +} + +boolean menu_inputstring(INPUTSTRING_PARAM *p) { + char s[256]; + guint i; + + if (!menu_initilized) return FALSE; + + menu_ok_input = FALSE; + gtk_label_set(GTK_LABEL(menu_label_inputstring_title), p->title); + + sprintf(s, _("MAX %d charater"), p->max); + gtk_label_set(GTK_LABEL(menu_label_inputstring_maxchar), strdup(s)); + + gtk_entry_set_max_length(GTK_ENTRY(menu_textentry), p->max *2); + gtk_entry_set_text(GTK_ENTRY(menu_textentry), p->oldstring); + + gtk_widget_show(menu_window_is); + + i = gtk_idle_add(menu_callback, menu_window_is); + gtk_main(); + gtk_idle_remove(i); + + if (menu_ok_input) { + p->newstring = menu_textentry_string; + } else { + p->newstring = p->oldstring; + } + return TRUE; +} + +boolean menu_inputstring2(INPUTSTRING_PARAM *p) { + guint i; + + if (!menu_initilized) return FALSE; + + menu_ok_input = FALSE; + gtk_entry_set_max_length(GTK_ENTRY(menu_textentry2), p->max *2); + gtk_entry_set_text(GTK_ENTRY(menu_textentry2), p->oldstring); + gtk_widget_set_usize (menu_textentry2, p->h * p->max + 8, p->h + 4); + + gtk_widget_show(menu_window_is2); + + i = gtk_idle_add(menu_callback, menu_window_is2); + gtk_main(); + gtk_idle_remove(i); + + if (menu_ok_input) { + p->newstring = menu_textentry_string; + } else { + p->newstring = p->oldstring; + } + return TRUE; +} + +boolean menu_inputnumber(INPUTNUM_PARAM *p) { + GtkObject *adj; + char s[256]; + gint i; + + if (!menu_initilized) return FALSE; + + menu_ok_input = FALSE; + + gtk_window_set_title (GTK_WINDOW(menu_window_in), p->title); + sprintf(s, "%d ", p->max); + gtk_label_set(GTK_LABEL(menu_label_inputnum_max), s); + sprintf(s, "%d ", p->min); + gtk_label_set(GTK_LABEL(menu_label_inputnum_min), s); + sprintf(s, "%d ", p->def); + gtk_label_set(GTK_LABEL(menu_label_inputnum_def), s); + + adj = gtk_adjustment_new (p->def, p->min, p->max, 1, 1, 1); + gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(menu_spinbutton), GTK_ADJUSTMENT(adj)); + /* こうしないと前の value が表示される */ + gtk_spin_button_set_value(GTK_SPIN_BUTTON(menu_spinbutton), p->def); + + gtk_widget_show(menu_window_in); + + i = gtk_idle_add(menu_callback, menu_window_in); + gtk_main(); + gtk_idle_remove(i); + + if (menu_ok_input) { + p->value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(menu_spinbutton)); + } else { + p->value = -1; + } + return TRUE; +} + +void menu_msgbox_open(char *msg) { + guint i; + if (!menu_initilized) return; + + gtk_label_set(GTK_LABEL(menu_label_msgbox), msg); + gtk_widget_show(menu_window_msgbox); + i = gtk_idle_add((GtkFunction)sys_getInputInfo, menu_window_msgbox); + gtk_main(); + gtk_idle_remove(i); +} + +void menu_init() { + menu_initilized = TRUE; + menu_window_popup = create_menu1(); + menu_window_in = create_window1(); + menu_window_is = create_window2(); + menu_window_exit = create_window3(); + menu_window_about = create_window4(); + menu_window_is2 = create_window5(); + menu_window_msgbox= create_window6(); +} + +void menu_widget_reinit(boolean reset_colortmap) { + static GdkColor col[256]; + static GdkVisual* vis; + static GdkColormap* cm; + int i; + + if (reset_colortmap) { + vis = gdk_visual_get_system(); + cm = gdk_colormap_new(vis, TRUE); + } + if (vis == NULL) return; + if (vis->type != GDK_VISUAL_PSEUDO_COLOR) return; + + for (i = 0; i < 256; i++) { + col[i].pixel = i; + col[i].red = nact->sys_pal->red[i] * 257; + col[i].green = nact->sys_pal->green[i] * 257; + col[i].blue = nact->sys_pal->blue[i] * 257; + } + gdk_colors_store(cm, col, 256); + gtk_widget_set_default_colormap(cm); + + /* reconstruct widget */ + menu_init(); +} + +void menu_gtkmainiteration() { + if (!menu_initilized) return; + + while (gtk_events_pending()) { + gtk_main_iteration(); + menu_callback(); + } +} diff --git a/src/menu.h b/src/menu.h new file mode 100644 index 0000000..8ea1dd5 --- /dev/null +++ b/src/menu.h @@ -0,0 +1,58 @@ +/* + * menu.h popup menu + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: menu.h,v 1.6 2001/04/21 17:03:22 chikama Exp $ */ + +#ifndef __MENU__ +#define __MENU__ + +#include "portab.h" + +/* 文字列入力のパラメータ */ +typedef struct { + char *title; + char *oldstring; + char *newstring; + int max; + /* for MJ cmd */ + boolean need_window; + int x, y, h; +} INPUTSTRING_PARAM; + +/* 数値入力のパラメータ */ +typedef struct { + char *title; + int value; + int def; + int max; + int min; +} INPUTNUM_PARAM; + +extern void menu_open(void); +extern void menu_quitmenu_open(void); +extern boolean menu_inputstring(INPUTSTRING_PARAM *); +extern boolean menu_inputstring2(INPUTSTRING_PARAM *); +extern boolean menu_inputnumber(INPUTNUM_PARAM *); +extern void menu_msgbox_open(char *); +extern void menu_widgetinit(void); +extern void menu_init(); +extern void menu_gtkmainiteration(); + +#endif /* !__MENULL */ diff --git a/src/menu_callback.c b/src/menu_callback.c new file mode 100644 index 0000000..2b46fae --- /dev/null +++ b/src/menu_callback.c @@ -0,0 +1,308 @@ +/* + * menu_callback.c menu callback function + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: menu_callback.c,v 1.11 2003/04/25 17:23:55 chikama Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "portab.h" +#include "menu.h" +#include "menu_callback.h" +#include "menu_gui.h" +#include "nact.h" +#include "imput.h" +#include "music.h" +#include "s39init.h" + +boolean menu_ok_exit; /* exit window で OK が押されたかどうか */ +boolean menu_ok_input; /* 文字列/数値入力 window で OK が... */ + +GtkWidget *menu_item_pcm; +GtkWidget *menu_item_cdrom; +GtkWidget *menu_item_midi; +GtkWidget *menu_item_msgskip_on; +GtkWidget *menu_item_msgskip_off; + +GtkWidget *menu_label_inputstring_title; +GtkWidget *menu_label_inputstring_maxchar; +GtkWidget *menu_label_inputnum_max; +GtkWidget *menu_label_inputnum_min; +GtkWidget *menu_label_inputnum_def; +GtkWidget *menu_label_msgbox; +GtkWidget *menu_spinbutton; +GtkWidget *menu_textentry; +GtkWidget *menu_textentry2; +gchar *menu_textentry_string; + +GtkWidget *menu_window_popup; /* popup menu */ +GtkWidget *menu_window_exit; /* exit window */ +GtkWidget *menu_window_is; /* input string window */ +GtkWidget *menu_window_is2; /* input string window no 2*/ +GtkWidget *menu_window_in; /* input number window */ +GtkWidget *menu_window_about; /* about xsystem35 window */ +GtkWidget *menu_window_msgbox;/* message box window */ + +void +on_window3_destroy (GtkObject *object, + gpointer user_data) +{ + +} + +/* message skip on */ +void +on_item2_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + set_skipMode(TRUE); + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + +/* message skip off */ +void +on_item3_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + set_skipMode(FALSE); + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + +/* mouse auto move on */ +void +on_item5_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + nact->sys_mouse_movesw = 2; + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + + +/* mouse auto move off */ +void +on_item6_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + nact->sys_mouse_movesw = 0; + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + + +void +on_item7_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + gtk_menu_popdown(GTK_MENU(menu_window_popup)); + s39ini_winopen(); +} + +/* PCM off */ +void +on_item9_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + // mus_pcm_set_state(FALSE); + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + + +/* CD on */ +void +on_item11_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + // mus_cdrom_set_state(TRUE); + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + + +/* CD off */ +void +on_item12_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + // mus_cdrom_set_state(FALSE); + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + + +/* MIDI on */ +void +on_item14_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + // mus_midi_set_state(TRUE); + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + +/* MIDI off */ +void +on_item15_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + // mus_midi_set_state(FALSE); + gtk_menu_popdown(GTK_MENU(menu_window_popup)); +} + +/* PopupMenu about */ +void +on_item16_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + nact->popupmenu_opened = TRUE; + gtk_widget_show(menu_window_about); +} + +/* PopupMenu exit */ +void +on_item17_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + nact->popupmenu_opened = TRUE; + gtk_widget_show(menu_window_exit); +} + +/* input number window OK button */ +void +on_button1_clicked (GtkButton *button, + gpointer user_data) +{ + menu_ok_input = TRUE; + gtk_widget_hide(menu_window_in); + gtk_main_quit(); +} + + +/* input number window cancel button */ +void +on_button2_clicked (GtkButton *button, + gpointer user_data) +{ + menu_ok_input = FALSE; + gtk_widget_hide(menu_window_in); + gtk_main_quit(); +} + + +/* input string window cancel button */ +void +on_button4_clicked (GtkButton *button, + gpointer user_data) +{ + menu_ok_input = FALSE; + gtk_widget_hide(menu_window_is); + gtk_main_quit(); +} + + +/* input string window OK button */ +void +on_button3_clicked (GtkButton *button, + gpointer user_data) +{ + menu_textentry_string = gtk_entry_get_text(GTK_ENTRY(menu_textentry)); + menu_ok_input = TRUE; + gtk_widget_hide(menu_window_is); + gtk_main_quit(); +} + +/* Exit Yes */ +void +on_button5_clicked (GtkButton *button, + gpointer user_data) +{ + menu_ok_exit = TRUE; + nact->is_quit = TRUE; + nact->popupmenu_opened = FALSE; +} + + +/* Exit No */ +void +on_button6_clicked (GtkButton *button, + gpointer user_data) +{ + nact->popupmenu_opened = FALSE; + menu_ok_exit = FALSE; + gtk_widget_hide(menu_window_exit); +} + +/* About OK */ +void +on_button11_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_widget_hide(menu_window_about); + nact->popupmenu_opened = FALSE; +} + +/* menu canceld */ +void +on_menu1_deactivate (GtkMenuShell *menushell, + gpointer user_data) +{ + gtk_menu_popdown(GTK_MENU(menu_window_popup)); + nact->popupmenu_opened = FALSE; +} + +/* get enter in text entry */ +void +on_entry1_activate (GtkEditable *editable, + gpointer user_data) +{ + menu_textentry_string = gtk_entry_get_text(GTK_ENTRY(editable)); + menu_ok_input = TRUE; + gtk_widget_hide(menu_window_is); + gtk_main_quit(); +} + +/* get enter in spin button */ +void +on_spinbutton1_activate (GtkEditable *editable, + gpointer user_data) +{ + GtkAdjustment *adj; + adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(menu_spinbutton)); + if (adj->value >= adj->lower && adj->value <= adj->upper) { + menu_ok_input = TRUE; + gtk_widget_hide(menu_window_in); + gtk_main_quit(); + } +} + +/* get enter in text entry */ +void +on_entry2_activate (GtkEditable *editable, + gpointer user_data) +{ + menu_textentry_string = gtk_entry_get_text(GTK_ENTRY(editable)); + menu_ok_input = TRUE; + gtk_widget_hide(menu_window_is2); + gtk_main_quit(); +} + +void +on_button16_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_widget_hide(menu_window_msgbox); + gtk_main_quit(); +} diff --git a/src/menu_callback.h b/src/menu_callback.h new file mode 100644 index 0000000..ae8bff3 --- /dev/null +++ b/src/menu_callback.h @@ -0,0 +1,169 @@ +/* + * menu_callback.h menu callback function + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: menu_callback.h,v 1.4 2001/04/04 21:55:39 chikama Exp $ */ + +#ifndef __MENU_CALLBACK__ +#define __MENU_CALLBACK__ + +#include + +extern boolean menu_ok_exit; +extern boolean menu_ok_input; + +extern GtkWidget *menu_item_pcm; +extern GtkWidget *menu_item_cdrom; +extern GtkWidget *menu_item_midi; +extern GtkWidget *menu_item_msgskip_on; +extern GtkWidget *menu_item_msgskip_off; + +extern GtkWidget *menu_label_inputstring_title; +extern GtkWidget *menu_label_inputstring_maxchar; +extern GtkWidget *menu_label_inputnum_title; +extern GtkWidget *menu_label_inputnum_max; +extern GtkWidget *menu_label_inputnum_min; +extern GtkWidget *menu_label_inputnum_def; +extern GtkWidget *menu_label_msgbox; +extern GtkWidget *menu_spinbutton; +extern GtkWidget *menu_textentry; +extern GtkWidget *menu_textentry2; +extern gchar *menu_textentry_string; + +extern GtkWidget *menu_window_popup; /* popup menu */ +extern GtkWidget *menu_window_exit; /* exit window */ +extern GtkWidget *menu_window_is; /* input string window */ +extern GtkWidget *menu_window_is2; /* input string window no 2*/ +extern GtkWidget *menu_window_in; /* input number window */ +extern GtkWidget *menu_window_about; /* about xsystem35 window */ +extern GtkWidget *menu_window_msgbox;/* message box window */ + + +void +on_window3_destroy (GtkObject *object, + gpointer user_data); + +void +on_item2_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item3_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item4_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item5_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item6_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item7_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item8_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item9_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item10_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item11_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item12_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item14_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item15_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item16_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_item17_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_button1_clicked (GtkButton *button, + gpointer user_data); + +void +on_button2_clicked (GtkButton *button, + gpointer user_data); + +void +on_button4_clicked (GtkButton *button, + gpointer user_data); + +void +on_button3_clicked (GtkButton *button, + gpointer user_data); + +void +on_button5_clicked (GtkButton *button, + gpointer user_data); + +void +on_button6_clicked (GtkButton *button, + gpointer user_data); + +void +on_button11_clicked (GtkButton *button, + gpointer user_data); + +void +on_menu1_deactivate (GtkMenuShell *menushell, + gpointer user_data); + +void +on_entry1_activate (GtkEditable *editable, + gpointer user_data); + +void +on_spinbutton1_activate (GtkEditable *editable, + gpointer user_data); + +void +on_entry2_activate (GtkEditable *editable, + gpointer user_data); + +void +on_button16_clicked (GtkButton *button, + gpointer user_data); +#endif /* !__MENU_CALLBACK__ */ diff --git a/src/menu_gui.c b/src/menu_gui.c new file mode 100644 index 0000000..b4d0f35 --- /dev/null +++ b/src/menu_gui.c @@ -0,0 +1,878 @@ +/* + * menu_gui.c menu gui + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: menu_gui.c,v 1.12 2003/04/25 17:23:55 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" + +#include +#include + +#ifndef GTK_CHECK_VERSION +#define GTK_CHECK_VERSION(major,minor,micro) \ +(GTK_MAJOR_VERSION > (major) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION > (minor)) || \ + (GTK_MAJOR_VERSION == (major) && GTK_MINOR_VERSION == (minor) && \ + GTK_MICRO_VERSION >= (micro))) +#endif /* !GTK_CHECK_VERSION */ + +#if GTK_CHECK_VERSION (1,2,0) +#define GTKV12 +#if GTK_CHECK_VERSION(1,3,0) +#define GTKV13 +#endif +#else +#define GTKV10 +#endif + +#ifdef GTKV13 +#define GTK_WINDOW_DIALOG GTK_WINDOW_TOPLEVEL +#endif + +#include "menu_callback.h" +#include "menu_gui.h" + +GtkWidget* +create_window1 (void) +{ + GtkWidget *window1; + GtkWidget *hbox1; + GtkWidget *vbox1; + GtkObject *spinbutton1_adj; + GtkWidget *spinbutton1; + GtkWidget *table1; + GtkWidget *label3; + GtkWidget *label9; + GtkWidget *label10; + GtkWidget *label11; + GtkWidget *label12; + GtkWidget *label13; + GtkWidget *vbox2; + GtkWidget *button1; + GtkWidget *button2; + GtkWidget *label4; + + window1 = gtk_window_new (GTK_WINDOW_DIALOG); + gtk_object_set_data (GTK_OBJECT (window1), "window1", window1); + gtk_window_set_title (GTK_WINDOW (window1), _("InputNumber")); + gtk_window_set_policy (GTK_WINDOW (window1), FALSE, FALSE, FALSE); + gtk_window_position (GTK_WINDOW (window1), GTK_WIN_POS_MOUSE); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox1); + gtk_object_set_data_full (GTK_OBJECT (window1), "hbox1", hbox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox1); + gtk_container_add (GTK_CONTAINER (window1), hbox1); + + vbox1 = gtk_vbox_new (FALSE, 10); + gtk_widget_ref (vbox1); + gtk_object_set_data_full (GTK_OBJECT (window1), "vbox1", vbox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox1); + gtk_box_pack_start (GTK_BOX (hbox1), vbox1, TRUE, TRUE, 0); + gtk_widget_set_usize (vbox1, 128, -2); +#ifdef GTKV12 + gtk_container_set_border_width (GTK_CONTAINER (vbox1), 10); +#else + gtk_container_border_width (GTK_CONTAINER (vbox1), 10); +#endif + + spinbutton1_adj = gtk_adjustment_new (100, 0, 100, 1, 1, 100); + menu_spinbutton = spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton1_adj), 1, 0); + gtk_widget_ref (spinbutton1); + gtk_object_set_data_full (GTK_OBJECT (window1), "spinbutton1", spinbutton1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (spinbutton1); + gtk_box_pack_start (GTK_BOX (vbox1), spinbutton1, FALSE, FALSE, 0); + + table1 = gtk_table_new (3, 2, FALSE); + gtk_widget_ref (table1); + gtk_object_set_data_full (GTK_OBJECT (window1), "table1", table1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (table1); + gtk_box_pack_start (GTK_BOX (vbox1), table1, FALSE, FALSE, 0); + gtk_table_set_row_spacings (GTK_TABLE (table1), 5); + gtk_table_set_col_spacings (GTK_TABLE (table1), 3); + + label3 = gtk_label_new (_("default")); + gtk_widget_ref (label3); + gtk_object_set_data_full (GTK_OBJECT (window1), "label3", label3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label3); + gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT); + + label9 = gtk_label_new (_("min")); + gtk_widget_ref (label9); + gtk_object_set_data_full (GTK_OBJECT (window1), "label9", label9, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label9); + gtk_table_attach (GTK_TABLE (table1), label9, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_LEFT); + + label10 = gtk_label_new (_("max")); + gtk_widget_ref (label10); + gtk_object_set_data_full (GTK_OBJECT (window1), "label10", label10, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label10); + gtk_table_attach (GTK_TABLE (table1), label10, 0, 1, 2, 3, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT); + + menu_label_inputnum_def = label11 = gtk_label_new (_("0")); + gtk_widget_ref (label11); + gtk_object_set_data_full (GTK_OBJECT (window1), "label11", label11, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label11); + gtk_table_attach (GTK_TABLE (table1), label11, 1, 2, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label11), GTK_JUSTIFY_LEFT); + + menu_label_inputnum_min = label12 = gtk_label_new (_("0")); + gtk_widget_ref (label12); + gtk_object_set_data_full (GTK_OBJECT (window1), "label12", label12, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label12); + gtk_table_attach (GTK_TABLE (table1), label12, 1, 2, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_LEFT); + + menu_label_inputnum_max = label13 = gtk_label_new (_("0")); + gtk_widget_ref (label13); + gtk_object_set_data_full (GTK_OBJECT (window1), "label13", label13, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label13); + gtk_table_attach (GTK_TABLE (table1), label13, 1, 2, 2, 3, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_LEFT); + + vbox2 = gtk_vbox_new (TRUE, 0); + gtk_widget_ref (vbox2); + gtk_object_set_data_full (GTK_OBJECT (window1), "vbox2", vbox2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (hbox1), vbox2, FALSE, TRUE, 0); +#ifdef GTKV12 + gtk_container_set_border_width (GTK_CONTAINER (vbox2), 10); +#else + gtk_container_border_width (GTK_CONTAINER (vbox2), 10); +#endif + button1 = gtk_button_new_with_label (_("OK")); + gtk_widget_ref (button1); + gtk_object_set_data_full (GTK_OBJECT (window1), "button1", button1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button1); + gtk_box_pack_start (GTK_BOX (vbox2), button1, FALSE, FALSE, 0); + + button2 = gtk_button_new_with_label (_("Cancel")); + gtk_widget_ref (button2); + gtk_object_set_data_full (GTK_OBJECT (window1), "button2", button2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button2); + gtk_box_pack_start (GTK_BOX (vbox2), button2, FALSE, FALSE, 0); + + label4 = gtk_label_new (""); + gtk_widget_ref (label4); + gtk_object_set_data_full (GTK_OBJECT (window1), "label4", label4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label4); + gtk_box_pack_start (GTK_BOX (vbox2), label4, FALSE, FALSE, 0); + + gtk_signal_connect (GTK_OBJECT (spinbutton1), "activate", + GTK_SIGNAL_FUNC (on_spinbutton1_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (button1), "clicked", + GTK_SIGNAL_FUNC (on_button1_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (button2), "clicked", + GTK_SIGNAL_FUNC (on_button2_clicked), + NULL); + + return window1; +} + +GtkWidget* +create_window2 (void) +{ + GtkWidget *window2; + GtkWidget *vbox3; + GtkWidget *label5; + GtkWidget *entry1; + GtkWidget *label6; + GtkWidget *label7; + GtkWidget *hbox2; + GtkWidget *button4; + GtkWidget *button3; + + window2 = gtk_window_new (GTK_WINDOW_DIALOG); + gtk_object_set_data (GTK_OBJECT (window2), "window2", window2); +#ifdef GTKV12 + gtk_container_set_border_width (GTK_CONTAINER (window2), 10); +#else + gtk_container_border_width (GTK_CONTAINER (window2), 10); +#endif + gtk_window_set_title (GTK_WINDOW (window2), _("InputString")); + gtk_window_set_policy (GTK_WINDOW (window2), FALSE, FALSE, FALSE); + gtk_window_position (GTK_WINDOW (window2), GTK_WIN_POS_MOUSE); + + vbox3 = gtk_vbox_new (TRUE, 0); + gtk_widget_ref (vbox3); + gtk_object_set_data_full (GTK_OBJECT (window2), "vbox3", vbox3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox3); + gtk_container_add (GTK_CONTAINER (window2), vbox3); + + menu_label_inputstring_title = label5 = gtk_label_new (_("title")); + gtk_widget_ref (label5); + gtk_object_set_data_full (GTK_OBJECT (window2), "label5", label5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label5); + gtk_box_pack_start (GTK_BOX (vbox3), label5, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label5), 0.00, 0.5); + + menu_textentry = entry1 = gtk_entry_new (); + gtk_widget_ref (entry1); + gtk_object_set_data_full (GTK_OBJECT (window2), "entry1", entry1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (entry1); + gtk_box_pack_start (GTK_BOX (vbox3), entry1, FALSE, FALSE, 0); + + menu_label_inputstring_maxchar = label6 = gtk_label_new (_("MAX charater")); + gtk_widget_ref (label6); + gtk_object_set_data_full (GTK_OBJECT (window2), "label6", label6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label6); + gtk_box_pack_start (GTK_BOX (vbox3), label6, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label6), 0.00, 0.5); + + label7 = gtk_label_new (_("Notice) HANKAKU is not available")); + gtk_widget_ref (label7); + gtk_object_set_data_full (GTK_OBJECT (window2), "label7", label7, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label7); + gtk_box_pack_start (GTK_BOX (vbox3), label7, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label7), 0.00, 0.5); + + hbox2 = gtk_hbox_new (FALSE, 5); + gtk_widget_ref (hbox2); + gtk_object_set_data_full (GTK_OBJECT (window2), "hbox2", hbox2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox3), hbox2, TRUE, TRUE, 0); + + button4 = gtk_button_new_with_label (_("Cancel")); + gtk_widget_ref (button4); + gtk_object_set_data_full (GTK_OBJECT (window2), "button4", button4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button4); + gtk_box_pack_end (GTK_BOX (hbox2), button4, FALSE, FALSE, 0); + + button3 = gtk_button_new_with_label (_("OK")); + gtk_widget_ref (button3); + gtk_object_set_data_full (GTK_OBJECT (window2), "button3", button3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button3); + gtk_box_pack_end (GTK_BOX (hbox2), button3, FALSE, FALSE, 0); + + gtk_signal_connect (GTK_OBJECT (button4), "clicked", + GTK_SIGNAL_FUNC (on_button4_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (button3), "clicked", + GTK_SIGNAL_FUNC (on_button3_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (entry1), "activate", + GTK_SIGNAL_FUNC (on_entry1_activate), + NULL); + + return window2; +} + +GtkWidget* +create_window3 (void) +{ + GtkWidget *window3; + GtkWidget *vbox4; + GtkWidget *label8; + GtkWidget *hbox3; + GtkWidget *button5; + GtkWidget *button6; + + window3 = gtk_window_new (GTK_WINDOW_DIALOG); + gtk_object_set_data (GTK_OBJECT (window3), "window3", window3); +#ifdef GTKV12 + gtk_container_set_border_width (GTK_CONTAINER (window3), 10); +#else + gtk_container_border_width (GTK_CONTAINER (window3), 10); +#endif + gtk_window_set_title (GTK_WINDOW (window3), _("Exit")); + gtk_window_set_policy (GTK_WINDOW (window3), FALSE, FALSE, FALSE); + gtk_window_position (GTK_WINDOW (window3), GTK_WIN_POS_MOUSE); + + vbox4 = gtk_vbox_new (TRUE, 10); + gtk_widget_ref (vbox4); + gtk_object_set_data_full (GTK_OBJECT (window3), "vbox4", vbox4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox4); + gtk_container_add (GTK_CONTAINER (window3), vbox4); +#ifdef GTKV12 + gtk_container_set_border_width (GTK_CONTAINER (vbox4), 5); +#else + gtk_container_border_width (GTK_CONTAINER (vbox4), 5); +#endif + label8 = gtk_label_new (_("Exit System35 ?")); + gtk_widget_ref (label8); + gtk_object_set_data_full (GTK_OBJECT (window3), "label8", label8, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label8); + gtk_box_pack_start (GTK_BOX (vbox4), label8, FALSE, FALSE, 0); + + hbox3 = gtk_hbox_new (TRUE, 10); + gtk_widget_ref (hbox3); + gtk_object_set_data_full (GTK_OBJECT (window3), "hbox3", hbox3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox3); + gtk_box_pack_start (GTK_BOX (vbox4), hbox3, TRUE, TRUE, 0); + + button5 = gtk_button_new_with_label (_("Yes")); + gtk_widget_ref (button5); + gtk_object_set_data_full (GTK_OBJECT (window3), "button5", button5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button5); + gtk_box_pack_start (GTK_BOX (hbox3), button5, FALSE, TRUE, 0); + + button6 = gtk_button_new_with_label (_("No")); + gtk_widget_ref (button6); + gtk_object_set_data_full (GTK_OBJECT (window3), "button6", button6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button6); + gtk_box_pack_start (GTK_BOX (hbox3), button6, FALSE, TRUE, 0); + + gtk_signal_connect (GTK_OBJECT (window3), "destroy", + GTK_SIGNAL_FUNC (on_window3_destroy), + NULL); + gtk_signal_connect (GTK_OBJECT (button5), "clicked", + GTK_SIGNAL_FUNC (on_button5_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (button6), "clicked", + GTK_SIGNAL_FUNC (on_button6_clicked), + NULL); + + gtk_widget_grab_focus (button5); + return window3; +} + +GtkWidget* +create_window4 (void) +{ + GtkWidget *window4; + GtkWidget *fixed1; + GtkWidget *notebook1; + GtkWidget *label26; + GtkWidget *label23; + GtkWidget *empty_notebook_page; + GtkWidget *label24; + GtkWidget *label25; + GtkWidget *button11; + + window4 = gtk_window_new (GTK_WINDOW_DIALOG); + gtk_object_set_data (GTK_OBJECT (window4), "window4", window4); + gtk_window_set_title (GTK_WINDOW (window4), _("About")); + gtk_window_position (GTK_WINDOW (window4), GTK_WIN_POS_MOUSE); + + fixed1 = gtk_fixed_new (); + gtk_widget_ref (fixed1); + gtk_object_set_data_full (GTK_OBJECT (window4), "fixed1", fixed1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (fixed1); + gtk_container_add (GTK_CONTAINER (window4), fixed1); + + notebook1 = gtk_notebook_new (); + gtk_widget_ref (notebook1); + gtk_object_set_data_full (GTK_OBJECT (window4), "notebook1", notebook1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (notebook1); + gtk_fixed_put (GTK_FIXED (fixed1), notebook1, 0, 0); + gtk_widget_set_uposition (notebook1, 0, 0); + gtk_widget_set_usize (notebook1, 248, 104); + + label26 = gtk_label_new ("System 3.5 scenario decoder\nfor X\nVersion "VERSION" [proj. RainyMoon]"); + gtk_widget_ref (label26); + gtk_object_set_data_full (GTK_OBJECT (window4), "label26", label26, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label26); + gtk_container_add (GTK_CONTAINER (notebook1), label26); + + label23 = gtk_label_new (_("Information1")); + gtk_widget_ref (label23); + gtk_object_set_data_full (GTK_OBJECT (window4), "label23", label23, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label23); +#ifdef GTKV12 + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label23); +#endif + empty_notebook_page = gtk_vbox_new (FALSE, 0); + gtk_widget_show (empty_notebook_page); + gtk_container_add (GTK_CONTAINER (notebook1), empty_notebook_page); + + label24 = gtk_label_new (_("Information2")); + gtk_widget_ref (label24); + gtk_object_set_data_full (GTK_OBJECT (window4), "label24", label24, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label24); +#ifdef GTKV12 + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label24); +#endif + empty_notebook_page = gtk_vbox_new (FALSE, 0); + gtk_widget_show (empty_notebook_page); + gtk_container_add (GTK_CONTAINER (notebook1), empty_notebook_page); + + label25 = gtk_label_new (_("Information3")); + gtk_widget_ref (label25); + gtk_object_set_data_full (GTK_OBJECT (window4), "label25", label25, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label25); +#ifdef GTKV12 + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label25); +#endif + button11 = gtk_button_new_with_label (_("OK")); + gtk_widget_ref (button11); + gtk_object_set_data_full (GTK_OBJECT (window4), "button11", button11, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button11); + gtk_fixed_put (GTK_FIXED (fixed1), button11, 184, 104); + gtk_widget_set_uposition (button11, 184, 104); + gtk_widget_set_usize (button11, 64, 24); + + gtk_signal_connect (GTK_OBJECT (button11), "clicked", + GTK_SIGNAL_FUNC (on_button11_clicked), + NULL); + return window4; +} + +GtkWidget* +create_menu1 (void) +{ + GtkWidget *menu1; +#ifdef GTKV12 + GtkAccelGroup *menu1_accels; + GtkAccelGroup *item1_menu_accels; + GtkAccelGroup *item4_menu_accels; + GtkAccelGroup *item7_menu_accels; + GtkAccelGroup *item10_menu_accels; + GtkAccelGroup *item13_menu_accels; +#endif + GtkWidget *item1; + GtkWidget *item1_menu; + GSList *msg_group = NULL; + GtkWidget *item2; + GtkWidget *item3; + GtkWidget *__________1; + GtkWidget *item4; + GtkWidget *item4_menu; + GSList *mouse_group = NULL; + GtkWidget *item5; + GtkWidget *item6; + GtkWidget *__________2; + GtkWidget *item7; + GtkWidget *item7_menu; + GSList *pcm_group = NULL; + GtkWidget *item8; + GtkWidget *item9; + GtkWidget *item10; + GtkWidget *item10_menu; + GSList *cdrom_group = NULL; + GtkWidget *item11; + GtkWidget *item12; + GtkWidget *item13; + GtkWidget *item13_menu; + GSList *midi_group = NULL; + GtkWidget *item14; + GtkWidget *item15; + GtkWidget *__________3; + GtkWidget *item16; + GtkWidget *__________4; + GtkWidget *item17; + + menu1 = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (menu1), "menu1", menu1); +#ifdef GTKV12 +#ifdef GTKV13 +#else + menu1_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (menu1)); +#endif +#endif + item1 = gtk_menu_item_new_with_label (_("MessageSkip")); + gtk_widget_ref (item1); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item1", item1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item1); + gtk_container_add (GTK_CONTAINER (menu1), item1); + + item1_menu = gtk_menu_new (); + gtk_widget_ref (item1_menu); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item1_menu", item1_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item1), item1_menu); +#ifdef GTKV12 +#ifdef GTKV13 +#else + item1_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (item1_menu)); +#endif +#endif + menu_item_msgskip_on = item2 = gtk_radio_menu_item_new_with_label (msg_group, _("ON")); + msg_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item2)); + gtk_widget_ref (item2); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item2", item2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item2); + gtk_container_add (GTK_CONTAINER (item1_menu), item2); + + menu_item_msgskip_off = item3 = gtk_radio_menu_item_new_with_label (msg_group, _("OFF")); + msg_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item3)); + gtk_widget_ref (item3); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item3", item3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item3); + gtk_container_add (GTK_CONTAINER (item1_menu), item3); + + __________1 = gtk_menu_item_new (); + gtk_widget_ref (__________1); + gtk_object_set_data_full (GTK_OBJECT (menu1), "__________1", __________1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (__________1); + gtk_container_add (GTK_CONTAINER (menu1), __________1); + gtk_widget_set_sensitive (__________1, FALSE); + + item4 = gtk_menu_item_new_with_label (_("MouseAutoMove")); + gtk_widget_ref (item4); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item4", item4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item4); + gtk_container_add (GTK_CONTAINER (menu1), item4); + + item4_menu = gtk_menu_new (); + gtk_widget_ref (item4_menu); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item4_menu", item4_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item4), item4_menu); +#ifdef GTKV12 +#ifdef GTKV13 +#else + item4_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (item4_menu)); +#endif +#endif + item5 = gtk_radio_menu_item_new_with_label (mouse_group, _("ON")); + mouse_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item5)); + gtk_widget_ref (item5); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item5", item5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item5); + gtk_container_add (GTK_CONTAINER (item4_menu), item5); + + item6 = gtk_radio_menu_item_new_with_label (mouse_group, _("OFF")); + mouse_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item6)); + gtk_widget_ref (item6); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item6", item6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item6); + gtk_container_add (GTK_CONTAINER (item4_menu), item6); + + __________2 = gtk_menu_item_new (); + gtk_widget_ref (__________2); + gtk_object_set_data_full (GTK_OBJECT (menu1), "__________2", __________2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (__________2); + gtk_container_add (GTK_CONTAINER (menu1), __________2); + gtk_widget_set_sensitive (__________2, FALSE); + + item7 = gtk_menu_item_new_with_label (_("VolumeValance")); + gtk_widget_ref (item7); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item7", item7, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item7); + gtk_container_add (GTK_CONTAINER (menu1), item7); + +#if 0 + menu_item_pcm = item7 = gtk_menu_item_new_with_label (_("PCM-audio")); + gtk_widget_ref (item7); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item7", item7, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item7); + gtk_container_add (GTK_CONTAINER (menu1), item7); + + item7_menu = gtk_menu_new (); + gtk_widget_ref (item7_menu); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item7_menu", item7_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item7), item7_menu); +#ifdef GTKV12 +#ifdef GTKV13 +#else + item7_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (item7_menu)); +#endif +#endif + item8 = gtk_radio_menu_item_new_with_label (pcm_group, _("ON")); + pcm_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item8)); + gtk_widget_ref (item8); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item8", item8, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item8); + gtk_container_add (GTK_CONTAINER (item7_menu), item8); + + item9 = gtk_radio_menu_item_new_with_label (pcm_group, _("OFF")); + pcm_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item9)); + gtk_widget_ref (item9); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item9", item9, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item9); + gtk_container_add (GTK_CONTAINER (item7_menu), item9); + + menu_item_cdrom = item10 = gtk_menu_item_new_with_label (_("CDROM-audio")); + gtk_widget_ref (item10); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item10", item10, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item10); + gtk_container_add (GTK_CONTAINER (menu1), item10); + + item10_menu = gtk_menu_new (); + gtk_widget_ref (item10_menu); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item10_menu", item10_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item10), item10_menu); +#ifdef GTKV12 +#ifdef GTKV13 +#else + item10_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (item10_menu)); +#endif +#endif + item11 = gtk_radio_menu_item_new_with_label (cdrom_group, _("ON")); + cdrom_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item11)); + gtk_widget_ref (item11); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item11", item11, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item11); + gtk_container_add (GTK_CONTAINER (item10_menu), item11); + + item12 = gtk_radio_menu_item_new_with_label (cdrom_group, _("OFF")); + cdrom_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item12)); + gtk_widget_ref (item12); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item12", item12, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item12); + gtk_container_add (GTK_CONTAINER (item10_menu), item12); + + menu_item_midi = item13 = gtk_menu_item_new_with_label (_("MIDI-audio")); + gtk_widget_ref (item13); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item13", item13, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item13); + gtk_container_add (GTK_CONTAINER (menu1), item13); + + item13_menu = gtk_menu_new (); + gtk_widget_ref (item13_menu); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item13_menu", item13_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (item13), item13_menu); +#ifdef GTKV12 +#ifdef GTKV13 +#else + item13_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (item13_menu)); +#endif +#endif + item14 = gtk_radio_menu_item_new_with_label (midi_group, _("ON")); + midi_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item14)); + gtk_widget_ref (item14); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item14", item14, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item14); + gtk_container_add (GTK_CONTAINER (item13_menu), item14); + + item15 = gtk_radio_menu_item_new_with_label (midi_group, _("OFF")); + midi_group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item15)); + gtk_widget_ref (item15); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item15", item15, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item15); + gtk_container_add (GTK_CONTAINER (item13_menu), item15); + + __________3 = gtk_menu_item_new (); + gtk_widget_ref (__________3); + gtk_object_set_data_full (GTK_OBJECT (menu1), "__________3", __________3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (__________3); + gtk_container_add (GTK_CONTAINER (menu1), __________3); + gtk_widget_set_sensitive (__________3, FALSE); +#endif + + item16 = gtk_menu_item_new_with_label (_("About")); + gtk_widget_ref (item16); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item16", item16, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item16); + gtk_container_add (GTK_CONTAINER (menu1), item16); + + __________4 = gtk_menu_item_new (); + gtk_widget_ref (__________4); + gtk_object_set_data_full (GTK_OBJECT (menu1), "__________4", __________4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (__________4); + gtk_container_add (GTK_CONTAINER (menu1), __________4); + gtk_widget_set_sensitive (__________4, FALSE); + + item17 = gtk_menu_item_new_with_label (_("Exit")); + gtk_widget_ref (item17); + gtk_object_set_data_full (GTK_OBJECT (menu1), "item17", item17, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (item17); + gtk_container_add (GTK_CONTAINER (menu1), item17); + + gtk_signal_connect (GTK_OBJECT (menu1), "deactivate", + GTK_SIGNAL_FUNC (on_menu1_deactivate), + NULL); + gtk_signal_connect (GTK_OBJECT (item2), "toggled", + GTK_SIGNAL_FUNC (on_item2_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item3), "toggled", + GTK_SIGNAL_FUNC (on_item3_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item5), "activate", + GTK_SIGNAL_FUNC (on_item5_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item6), "activate", + GTK_SIGNAL_FUNC (on_item6_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item7), "activate", + GTK_SIGNAL_FUNC (on_item7_activate), + NULL); +#if 0 + gtk_signal_connect (GTK_OBJECT (item8), "activate", + GTK_SIGNAL_FUNC (on_item8_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item9), "activate", + GTK_SIGNAL_FUNC (on_item9_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item11), "activate", + GTK_SIGNAL_FUNC (on_item11_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item12), "activate", + GTK_SIGNAL_FUNC (on_item12_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item14), "activate", + GTK_SIGNAL_FUNC (on_item14_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item15), "activate", + GTK_SIGNAL_FUNC (on_item15_activate), + NULL); +#endif + gtk_signal_connect (GTK_OBJECT (item16), "activate", + GTK_SIGNAL_FUNC (on_item16_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (item17), "activate", + GTK_SIGNAL_FUNC (on_item17_activate), + NULL); + + return menu1; +} + +GtkWidget* +create_window5 (void) +{ + GtkWidget *window5; + GtkWidget *entry2; + + window5 = gtk_window_new (GTK_WINDOW_DIALOG); + gtk_object_set_data (GTK_OBJECT (window5), "window5", window5); + gtk_window_position (GTK_WINDOW (window5), GTK_WIN_POS_MOUSE); + + menu_textentry2 = entry2 = gtk_entry_new_with_max_length (16); + gtk_widget_ref (entry2); + gtk_object_set_data_full (GTK_OBJECT (window5), "entry2", entry2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (entry2); + gtk_container_add (GTK_CONTAINER (window5), entry2); + gtk_widget_set_usize (entry2, 100, 28); + gtk_entry_set_text (GTK_ENTRY (entry2), _("default")); + + gtk_signal_connect (GTK_OBJECT (entry2), "activate", + GTK_SIGNAL_FUNC (on_entry2_activate), + NULL); + + return window5; +} + +GtkWidget* +create_window6 (void) +{ + GtkWidget *window6; + GtkWidget *vbox5; + GtkWidget *label51; + GtkWidget *button16; + + window6 = menu_window_msgbox = gtk_window_new (GTK_WINDOW_DIALOG); + gtk_object_set_data (GTK_OBJECT (window6), "window6", window6); + gtk_window_set_title (GTK_WINDOW (window6), _("MessageBox")); + gtk_window_position (GTK_WINDOW (window6), GTK_WIN_POS_MOUSE); + + vbox5 = gtk_vbox_new (FALSE, 0); + gtk_widget_ref (vbox5); + gtk_object_set_data_full (GTK_OBJECT (window6), "vbox5", vbox5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox5); + gtk_container_add (GTK_CONTAINER (window6), vbox5); + + label51 = menu_label_msgbox = gtk_label_new (_("Messge")); + gtk_widget_ref (label51); + gtk_object_set_data_full (GTK_OBJECT (window6), "label51", label51, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label51); + gtk_box_pack_start (GTK_BOX (vbox5), label51, FALSE, FALSE, 0); + + button16 = gtk_button_new_with_label (_("OK")); + gtk_widget_ref (button16); + gtk_object_set_data_full (GTK_OBJECT (window6), "button16", button16, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button16); + gtk_box_pack_start (GTK_BOX (vbox5), button16, FALSE, FALSE, 0); + + gtk_signal_connect (GTK_OBJECT (button16), "clicked", + GTK_SIGNAL_FUNC (on_button16_clicked), + NULL); + + return window6; +} diff --git a/src/menu_gui.h b/src/menu_gui.h new file mode 100644 index 0000000..daa09c1 --- /dev/null +++ b/src/menu_gui.h @@ -0,0 +1,36 @@ +/* + * menu_gui.h menu gui + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: menu_gui.h,v 1.4 2001/04/04 21:55:40 chikama Exp $ */ + +#ifndef __MENU_GUI__ +#define __MENU_GUI__ + +#include + +GtkWidget* create_window1 (void); +GtkWidget* create_window2 (void); +GtkWidget* create_window3 (void); +GtkWidget* create_window4 (void); +GtkWidget* create_window5 (void); +GtkWidget* create_window6 (void); +GtkWidget* create_menu1 (void); + +#endif /* !__MENU_GUI__ */ diff --git a/src/menu_gui_volval.c b/src/menu_gui_volval.c new file mode 100644 index 0000000..682cab4 --- /dev/null +++ b/src/menu_gui_volval.c @@ -0,0 +1,167 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include +#include + +static void +on_checkbutton1_toggled (GtkToggleButton *togglebutton, + gpointer user_data); +static void +on_adjustment1_value_changed (GtkAdjustment *adjustment, + gpointer user_data); +static gint +on_window1_destroy (GtkWindow *window, + gpointer user_data); + + + +static GtkWidget* vval_win_open(struct _volval *vval, int max) { + GtkWidget *window1; + GtkWidget *frame1; + GtkWidget *table2; + GtkWidget *label1; + GtkWidget *hscale1; + GtkWidget *checkbutton1; + GtkObject *adjustment1; + GtkWidget *hbox1; + GtkWidget *label6; + GtkWidget *label7; + int i, j; + + window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_object_set_data (GTK_OBJECT (window1), "window1", window1); + gtk_widget_set_usize (window1, 320, -2); + gtk_window_set_title (GTK_WINDOW (window1), _("window1")); + + frame1 = gtk_frame_new (_("VolumeValance")); + gtk_widget_ref (frame1); + gtk_object_set_data_full (GTK_OBJECT (window1), "frame1", frame1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (frame1); + gtk_container_add (GTK_CONTAINER (window1), frame1); + gtk_container_set_border_width (GTK_CONTAINER (frame1), 5); + + table2 = gtk_table_new (6, 3, FALSE); + gtk_widget_ref (table2); + gtk_object_set_data_full (GTK_OBJECT (window1), "table2", table2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (table2); + gtk_container_add (GTK_CONTAINER (frame1), table2); + gtk_container_set_border_width (GTK_CONTAINER (table2), 5); + gtk_table_set_row_spacings (GTK_TABLE (table2), 2); + gtk_table_set_col_spacings (GTK_TABLE (table2), 2); + + for (i = 0, j = 0; i <= max; i++) { + if (vval[i].label == NULL) continue; + label1 = gtk_label_new (vval[i].label); + gtk_widget_ref (label1); + gtk_object_set_data_full (GTK_OBJECT (window1), "label1", label1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label1); + gtk_table_attach (GTK_TABLE (table2), label1, 0, 1, j+1, j+2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT); + + adjustment1 = gtk_adjustment_new (vval[i].vol, 0, 100, 0, 10, 0); + gtk_signal_connect (GTK_OBJECT(adjustment1), "value-changed", + GTK_SIGNAL_FUNC(on_adjustment1_value_changed), + &(vval[i].vol)); + + hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (adjustment1)); + gtk_widget_ref (hscale1); + gtk_object_set_data_full (GTK_OBJECT (window1), "hscale1", hscale1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hscale1); + gtk_table_attach (GTK_TABLE (table2), hscale1, 1, 2, j+1, j+2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 5, 2); + gtk_scale_set_draw_value (GTK_SCALE (hscale1), FALSE); + gtk_scale_set_digits (GTK_SCALE (hscale1), 0); + + checkbutton1 = gtk_check_button_new_with_label (_("mute")); + gtk_widget_ref (checkbutton1); + gtk_object_set_data_full (GTK_OBJECT (window1), "checkbutton1", checkbutton1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (checkbutton1); + gtk_table_attach (GTK_TABLE (table2), checkbutton1, 2, 3, j+1, j+2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_signal_connect (GTK_OBJECT (checkbutton1), "toggled", + GTK_SIGNAL_FUNC (on_checkbutton1_toggled), + &(vval[i].mute)); + + j++; + } + + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox1); + gtk_object_set_data_full (GTK_OBJECT (window1), "hbox1", hbox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox1); + gtk_table_attach (GTK_TABLE (table2), hbox1, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + + label6 = gtk_label_new (_("small")); + gtk_widget_ref (label6); + gtk_object_set_data_full (GTK_OBJECT (window1), "label6", label6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label6); + gtk_box_pack_start (GTK_BOX (hbox1), label6, TRUE, FALSE, 3); + gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT); + + label7 = gtk_label_new (_("large")); + gtk_widget_ref (label7); + gtk_object_set_data_full (GTK_OBJECT (window1), "label7", label7, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label7); + gtk_box_pack_start (GTK_BOX (hbox1), label7, TRUE, FALSE, 3); + gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_RIGHT); + + gtk_signal_connect (GTK_OBJECT (window1), "delete_event", + GTK_SIGNAL_FUNC (on_window1_destroy), + NULL); + + return window1; +} + +static void +on_checkbutton1_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + boolean *muted = (boolean *)user_data; + + if (gtk_toggle_button_get_active(togglebutton)) { + *muted = TRUE; + } else { + *muted = FALSE; + } + s39ini_setvol(); +} + +static void +on_adjustment1_value_changed (GtkAdjustment *adjustment, + gpointer user_data) +{ + int *vol = (int *)user_data; + *vol = adjustment->value; + // printf("value chaned %d\n", *vol); + s39ini_setvol(); +} + +static gint +on_window1_destroy (GtkWindow *window, + gpointer user_data) +{ + s39ini_winclose(); + return TRUE; +} diff --git a/src/menu_null.c b/src/menu_null.c new file mode 100644 index 0000000..3fbd4e9 --- /dev/null +++ b/src/menu_null.c @@ -0,0 +1,67 @@ +/* + * menu_null.c popup menu for null + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: menu_null.c,v 1.2 2003/01/25 01:34:50 chikama Exp $ */ + +#include "config.h" + +#include + +#include "portab.h" +#include "menu.h" + +void menu_open(void) { + return; +} + +void menu_quitmenu_open(void) { + return; +} + +boolean menu_inputstring(INPUTSTRING_PARAM *p) { + p->newstring = p->oldstring; + return TRUE; +} + +boolean menu_inputstring2(INPUTSTRING_PARAM *p) { + p->newstring = p->oldstring; + return TRUE; +} + +boolean menu_inputnumber(INPUTNUM_PARAM *p) { + p->value = p->def; + return TRUE; +} + +void menu_msgbox_open(char *msg) { + return; +} + +void menu_init(void) { + return; +} + +void menu_widget_reinit(boolean reset_colortmap) { + return; +} + +void menu_gtkmainiteration() { + return; +} diff --git a/src/message.c b/src/message.c new file mode 100644 index 0000000..bb2cfa9 --- /dev/null +++ b/src/message.c @@ -0,0 +1,375 @@ +/* + * message.c 文字列表示関係 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * +*/ +/* $Id: message.c,v 1.29 2003/01/25 01:34:50 chikama Exp $ */ + +#include +#include +#include +#include + +#include "portab.h" +#include "windowframe.h" +#include "xsystem35.h" +#include "message.h" +#include "variable.h" +#include "imput.h" +#include "ags.h" +#include "nact.h" + +/* ショートカット */ +#define msg nact->msg + +/* Private Variables */ +/* 現在使用中のメッセージWindow情報 */ +// static Bcom_WindowInfo winInfo = {8,311,616,80,0}; +/* Window枠の種類 */ +static int frameType; +static int frameCgNoTop; +static int frameCgNoMid; +static int frameCgNoBot; +static int frameDot; +/* 文字飾りの設定 */ +static int msgDecorateColor = 0; +static int msgDecorateType = 0; +/* 現在の文字表示位置 */ +static MyPoint msgcur; +static boolean nextLineIsAfterKaigyou = FALSE; + +/* Private Methods */ +static void drawLineFrame(Bcom_WindowInfo *info); +static void copyMsgToStrVar(char *m); +static void msgget_at_r(); +static void msgget_at_a(); + + +void msg_init() { + /* メッセージフォントの大きさ */ + msg.MsgFontSize = 16; + msg.MsgFontBoldSize = 0; + msg.MsgFont = FONT_GOTHIC; + + /* 各種色 */ + msg.MsgFontColor = 255; + msg.WinFrameColor = 255; + msg.WinBackgroundColor = 0; + msg.HitAnyKeyMsgColor = 255; + msg.WinBackgroundTransparent = 255; + + msg.AutoPageChange = TRUE; /* 自動改ページ */ + msg.LineIncrement = 2; /* 改行幅 */ + msg.WinBackgroundTransparentColor = -1; /* Window背景の透過色 -1:指定無し*/ + + /* MG コマンドによるメッセージの文字列変数への取り込み */ + msg.mg_getString = FALSE; + msg.mg_dspMsg = TRUE; + msg.mg_startStrVarNo = 1; + msg.mg_curStrVarNo = 1; + msg.mg_policyR = 0; + msg.mg_policyA = 0; +} + +void msg_setFontSize(int size) { + msg.MsgFontSize = size; +} + +void msg_setStringDecorationColor(int col) { + msgDecorateColor = col; +} + +void msg_setStringDecorationType(int type) { + msgDecorateType = type; +} + +void msg_putMessage(char *m) { + int w; + MyRectangle adj; + + if (nextLineIsAfterKaigyou) { + sys_hit_any_key(); + msg_nextPage(TRUE); + } + + /* 表示文字列を文字列変数にコピーする */ + if (msg.mg_getString) { + copyMsgToStrVar(m); + } + + // fprintf(stdout, "x=%d, y = %d, msg=%s\n", msgcur.x,msgcur.y,msg); + if (!msg.mg_dspMsg) return; + + ags_setFont(msg.MsgFont, msg.MsgFontSize); + switch(msgDecorateType) { + case 0: + adj.x = 0; adj.y = 0; adj.width = 0; adj.height = 0; + break; + case 1: + ags_drawString(msgcur.x, msgcur.y +1, m, msgDecorateColor); + adj.x = 0; adj.y = 0; adj.width = 0; adj.height = 1; + break; + case 2: + ags_drawString(msgcur.x +1, msgcur.y, m, msgDecorateColor); + adj.x = 0; adj.y = 0; adj.width = 1; adj.height = 0; + break; + case 3: + ags_drawString(msgcur.x +1, msgcur.y +1, m, msgDecorateColor); + adj.x = 0; adj.y = 0; adj.width = 1; adj.height = 1; + break; + case 4: + case 6: + ags_drawString(msgcur.x +1, msgcur.y, m, msg.MsgFontColor); + adj.x = 0; adj.y = 0; adj.width = 1; adj.height = 0; + break; + case 7: + ags_drawString(msgcur.x, msgcur.y +1, m, msg.MsgFontColor); + adj.x = 0; adj.y = 0; adj.width = 0; adj.height = 1; + break; + case 8: + ags_drawString(msgcur.x +1, msgcur.y +1, m, msg.MsgFontColor); + adj.x = 0; adj.y = 0; adj.width = 1; adj.height = 1; + break; + case 9: + case 10: + adj.x = 0; adj.y = 0; adj.width = 0; adj.height = 0; + break; + default: + break; + } + + w = ags_drawString(msgcur.x, msgcur.y, m, msg.MsgFontColor); + + if (nact->messagewait_enable) { + int x; + for (x = 0; x < w + adj.width; x+=16) { + ags_updateArea(msgcur.x + adj.x + x, msgcur.y + adj.y, + 16, msg.MsgFontSize + adj.height); + if (nact->messagewait_cancel) { + if (sys_getInputInfo()) { + nact->messagewait_enable_save = nact->messagewait_enable ; + nact->messagewait_enable = FALSE; + ags_updateArea(msgcur.x + adj.x, msgcur.y + adj.y, + w + adj.width, msg.MsgFontSize + adj.height); + break; + } + usleep(nact->messagewait_time * 10000); + } + nact->callback(); + } + } else { + ags_updateArea(msgcur.x + adj.x, msgcur.y + adj.y, + w + adj.width, msg.MsgFontSize + adj.height); + } + msgcur.x += w; +} + +void msg_nextLine() { + // puts("next Line"); + if (msg.mg_getString) { + msgget_at_r(); + return; + } + + msgcur.x = msg.win->x; + msgcur.y += (msg.MsgFontSize + msg.LineIncrement); + + if ((msgcur.y + msg.MsgFontSize) > (msg.win->y + msg.win->height)) { + nextLineIsAfterKaigyou = TRUE; + } +} + +void msg_nextPage(boolean innerclear) { + // puts("next Page"); + if (innerclear) { + if (msg.WinBackgroundTransparent == 255) { + ags_fillRectangle(msg.win->x, msg.win->y, + msg.win->width, msg.win->height, + msg.WinBackgroundColor); + } else { + if (msg.win->savedimg != NULL) { + if (frameType != WINDOW_FRAME_LINE) { + ags_putRegion(msg.win->savedimg, msg.win->x, msg.win->y); + } else { + ags_putRegion(msg.win->savedimg, msg.win->x-8, msg.win->y-8); + } + } + ags_wrapColor(msg.win->x, msg.win->y, + msg.win->width, msg.win->height, + msg.WinBackgroundColor, msg.WinBackgroundTransparent); + } + } + if (frameType == WINDOW_FRAME_LINE) { + drawLineFrame(msg.win); + } else if (innerclear) { + ags_updateArea(msg.win->x, msg.win->y, + msg.win->width, msg.win->height); + } + + msgcur.x = msg.win->x; + msgcur.y = msg.win->y + msg.LineIncrement; + + if (nextLineIsAfterKaigyou) { + if (msg.mg_getString) msgget_at_a(); + } + + nextLineIsAfterKaigyou = FALSE; +} + +void msg_openWindow(int W, int C1, int C2, int N, int M) { + // winInfo = *info; + frameType = W; + + switch(W) { + case WINDOW_FRAME_EMPTY: + if (M == 0) { + /* show window */ + if (msg.win->save) { + if (msg.win->savedimg != NULL) { + ags_delRegion(msg.win->savedimg); + } + msg.win->savedimg = ags_saveRegion(msg.win->x, msg.win->y, msg.win->width, msg.win->height); + } else { + msg.win->savedimg = NULL; + } + } else { + /* restore window */ + if (msg.win->savedimg != NULL) { + ags_putRegion(msg.win->savedimg, msg.win->x, msg.win->y); + ags_updateArea(msg.win->x, msg.win->y, msg.win->width, msg.win->height); + } + } + frameDot = 0; + break; + case WINDOW_FRAME_LINE: + if (M == 0) { + /* show window*/ + if (msg.win->save) { + if (msg.win->savedimg != NULL) { + ags_delRegion(msg.win->savedimg); + } + msg.win->savedimg = ags_saveRegion(msg.win->x -8, msg.win->y -8, msg.win->width +16, msg.win->height +16); + } else { + msg.win->savedimg = NULL; + } + } else { + /* restore window */ + if (msg.win->savedimg != NULL) { + ags_putRegion(msg.win->savedimg, msg.win->x -8, msg.win->y -8); + ags_updateArea(msg.win->x -8, msg.win->y -8, msg.win->width +16, msg.win->height +16); + } + } + frameDot = 8; + break; + case WINDOW_FRAME_CG: + frameCgNoTop = C1; + frameCgNoMid = C2; + frameCgNoBot = N; + frameDot = M; + break; + default: + break; + } + if (M == 0) msg_nextPage(N == 0 ? TRUE : FALSE); +} + +void msg_setMessageLocation(int x, int y) { + msgcur.x = x; + msgcur.y = y; +} + +void msg_getMessageLocation(MyPoint *loc) { + loc->x = msgcur.x; + loc->y = msgcur.y; +} + +void msg_hitAnyKey() { + int w; + static BYTE hak[] = {0x81, 0xa5, 0x00}; /* ▼ */ + + w = ags_drawString(msg.win->x + msg.win->width - msg.MsgFontSize, + msg.win->y + msg.win->height - msg.MsgFontSize, + hak, msg.HitAnyKeyMsgColor); + ags_updateArea(msg.win->x + msg.win->width - msg.MsgFontSize, + msg.win->y + msg.win->height - msg.MsgFontSize, + w, msg.MsgFontSize); +} + +static void drawLineFrame(Bcom_WindowInfo *i) { + ags_drawRectangle(i->x -8, i->y -8, i->width +16, i->height +16, msg.WinFrameColor); + ags_drawRectangle(i->x -7, i->y -7, i->width +14, i->height +14, msg.WinFrameColor); + ags_drawRectangle(i->x -6, i->y -6, i->width +12, i->height +12, msg.WinFrameColor); + ags_drawRectangle(i->x -5, i->y -5, i->width +10, i->height +10, msg.WinBackgroundColor); + ags_drawRectangle(i->x -4, i->y -4, i->width +8, i->height +8, msg.WinBackgroundColor); + ags_drawRectangle(i->x -3, i->y -3, i->width +6, i->height +6, msg.WinFrameColor); + ags_drawRectangle(i->x -2, i->y -2, i->width +4, i->height +4, msg.WinBackgroundColor); + ags_drawRectangle(i->x -1, i->y -1, i->width +2, i->height +2, msg.WinBackgroundColor); + ags_updateArea(i->x -8, i->y -8, i->width +16, i->height +16); +} + +static void copyMsgToStrVar(char *m) { + if (v_strlen(msg.mg_curStrVarNo -1) == 0) { + v_strcpy(msg.mg_curStrVarNo -1, m); + } else { + v_strcat(msg.mg_curStrVarNo -1, m); + } +} + +static void msgget_at_r() { + if (msg.mg_policyR == 1) return; + msg.mg_curStrVarNo++; + // v_strcpy(msg.mg_curStrVarNo -1, NULL); +} + +static void msgget_at_a() { + switch(msg.mg_policyA) { + case 0: + msg.mg_curStrVarNo = msg.mg_startStrVarNo; + break; + case 1: + msg.mg_curStrVarNo++; + v_strcpy(msg.mg_curStrVarNo -1, ""); + break; + case 2: + v_strcpy(msg.mg_curStrVarNo -1, ""); + msg.mg_curStrVarNo++; + break; + case 3: + break; + default: + break; + } +} + +void msg_mg6_command(int sw) { + switch(sw) { + case 0: + msg.mg_curStrVarNo--; + break; + case 1: + msg.mg_curStrVarNo++; + break; + case 2: + /* まだ */ + break; + default: + break; + } +} diff --git a/src/message.h b/src/message.h new file mode 100644 index 0000000..d4aa1fd --- /dev/null +++ b/src/message.h @@ -0,0 +1,76 @@ +/* + * message.h 文字列表示関係 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: message.h,v 1.22 2002/05/07 21:43:53 chikama Exp $ */ + +#ifndef __MESSAGE__ +#define __MESSAGE__ + +#include "portab.h" +#include "windowframe.h" +#include "graphics.h" + +extern void msg_init(); +extern void msg_setFontSize(int size); +extern void msg_setStringDecorationColor(int col); +extern void msg_setStringDecorationType(int type); +extern void msg_putMessage(char *msg); +extern void msg_nextLine(); +extern void msg_nextPage(boolean clear); +extern void msg_hitAnyKey(); +extern void msg_openWindow(int W, int C1, int C2, int N, int M); +extern void msg_setMessageLocation(int x, int y); +extern void msg_getMessageLocation(MyPoint *loc); +extern void msg_mg6_command(int cmd); + +struct __message { + /* メッセージフォントの大きさ */ + int MsgFontSize; + int MsgFontBoldSize; + int MsgFont; + + /* 各種色 */ + int MsgFontColor; + int WinFrameColor; + int WinBackgroundColor; + int HitAnyKeyMsgColor; + int WinBackgroundTransparentColor; + + boolean AutoPageChange; + int LineIncrement; + int WinBackgroundTransparent; + + /* MG command関連 */ + boolean mg_getString; + boolean mg_dspMsg; + int mg_startStrVarNo; + int mg_curStrVarNo; + int mg_policyR; + int mg_policyA; + + /* メッセージ window */ + int winno; + Bcom_WindowInfo *win; // 現在使用中の window + Bcom_WindowInfo wininfo[MSGWINMAX]; +}; +typedef struct __message msg_t; + +#endif /* __MESSAGE__ */ diff --git a/src/midi.c b/src/midi.c new file mode 100644 index 0000000..17cc2a9 --- /dev/null +++ b/src/midi.c @@ -0,0 +1,103 @@ +/* + * midi.c midi access wrapper + * + * Copyright (C) 2000- Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: midi.c,v 1.22 2003/01/04 17:01:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "midi.h" + +static char *dev; +static char *player; +static char default_mode = 'e'; +static int subdev = -1; + +#ifdef ENABLE_MIDI_EXTPLAYER +extern mididevice_t midi_extplayer; +#endif + +#if defined(ENABLE_MIDI_RAWMIDI) || defined(ENABLE_MIDI_SEQMIDI) +extern mididevice_t midi_rawmidi; +#endif + +int midi_init(mididevice_t *midi) { + int ret = NG; + + switch(default_mode) { + case 'r': + case 's': +#if defined(ENABLE_MIDI_RAWMIDI) || defined(ENABLE_MIDI_SEQMIDI) + memcpy(midi, &midi_rawmidi, sizeof(mididevice_t)); + ret = midi->init(dev, subdev); +#endif + break; + case 'e': +#ifdef ENABLE_MIDI_EXTPLAYER + ret = midi_extplayer.init(player, 0); + memcpy(midi, &midi_extplayer, sizeof(mididevice_t)); +#endif + break; + case '0': + break; + } + + return ret; +} + +void midi_set_playername(char *name) { + if (player) free(player); + if (0 == strcmp("none", name)) player = NULL; + else player = strdup(name); +} + +void midi_set_devicename(char *name) { + if (dev) free(dev); + if (0 == strcmp("none", name)) dev = NULL; + else dev = strdup(name); +} + +void midi_set_output_device(int mode) { + switch(mode & 0x7f) { + case 'e': + /* external player */ + default_mode = 'e'; + break; + case 'r': + /* raw midi mode */ + default_mode = 'r'; + break; + case 's': + /* sequencer midi mode */ + default_mode = 's'; + subdev = mode >> 8; + break; + case '0': + /* disable midi */ + default_mode = '0'; + break; + default: + break; + } +} diff --git a/src/midi.extplayer.c b/src/midi.extplayer.c new file mode 100644 index 0000000..ba89303 --- /dev/null +++ b/src/midi.extplayer.c @@ -0,0 +1,345 @@ +/* + * midi.extplayer.c midi play with external player + * + * Copyright (C) 1999- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: midi.extplayer.c,v 1.22 2003/11/09 15:06:13 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "midi.h" +#include "music_server.h" +#include "music_pcm.h" +#include "nact.h" + + +/* for debugging */ +#if 0 +# define KILL(pid, sig) ( \ + fprintf(stderr, "%s:%d:kill %d %d\n", \ + __FILE__, __LINE__, (pid), (sig)), \ + fflush(stderr), \ + kill((pid), (sig))\ + ) + +# define KILLPG(pid, sig) ( \ + fprintf(stderr, "%s:%d:killpg %d %d\n", \ + __FILE__, __LINE__, (pid), (sig)), \ + fflush(stderr), \ + killpg((pid), (sig))\ + ) +#else +# define KILL(pid, sig) kill((pid), (sig)) +# define KILLPG(pid, sig) killpg((pid), (sig)) +#endif + +extern void sys_set_signalhandler(int SIG, void (*handler)(int)); + +static int midi_initilize(char *pname, int subdev); +static int midi_exit(); +static int midi_start(int no, char *data, int datalen); +static int midi_stop(); +static int midi_pause(void); +static int midi_unpause(void); +static int midi_get_playing_info(midiplaystate *st); +static int midi_getflag(int mode, int index); +static int midi_setflag(int mode, int index, int val); +static int midi_setVolumePipe(int vol); +static int midi_getVolumePipe(); + + +#define midi midi_extplayer +mididevice_t midi = { + midi_initilize, + midi_exit, + midi_start, + midi_stop, + midi_pause, + midi_unpause, + midi_get_playing_info, + midi_getflag, + midi_setflag, + NULL, + NULL +}; + +static boolean enabled = FALSE; +static char midi_player[256]; +static int argc; +static char **argv; +static int midino; // 現在演奏中の番号 +static pid_t midipid; // 外部プレーヤーの pid +static int counter; // 演奏時間 +static boolean pipedplay; // pipe play モードかどうか + +static void player_set(char *buf) { + char *b, *bb; + int i, j; + + if (buf[0] == '-') { + pipedplay = TRUE; + buf++; + } else { + pipedplay = FALSE; + } + + strncpy(midi_player, buf, sizeof(midi_player)); + b = midi_player; + + if (!pipedplay) { + /* count arguments */ + i = j = 0; + while (*b != 0) { + if (*(b++) == ' ' && j > 0) { + i++; j = 0; + while (*b == ' ') b++; + } else { + j++; + } + if (*b == '\n') *b = 0; + } + if (j == 0 && i > 0) i--; + if (NULL == (argv = (char **)malloc(sizeof(char *) * (i +3)))) { + return; + } + argc = i +1; + + /* devide argument */ + b = midi_player; + j = 0; + while (j <= i) { + argv[j] = b; + while (*b != ' ' && *b != 0) b++; + *(b++) = 0; + while (*b == ' ' || *b == 0) b++; + j++; + } + argv[j +1] = NULL; + + /* cut down argv[0] */ + bb = b = argv[0]; + while (*b != 0) { + if ( *b == '/') bb = b +1; + b++; + } + argv[0] = bb; + } +} + +static int midi_initilize(char *pname, int sub) { + if (pname == NULL) return -1; + player_set(pname); + + reset_counter_high(SYSTEMCOUNTER_MIDI, 10, 0); + enabled = TRUE; + + if (pipedplay) { + midi.setvol = midi_setVolumePipe; + midi.getvol = midi_getVolumePipe; + NOTICE("midi piped play mode\n"); + } else { + NOTICE("midi external player mode\n"); + } + + return 0; +} + +static int midi_exit() { + char tmpfilename[256]; + int i; + + if (enabled) { + midi_stop(); + } + + for (i = 0; i < 256; i++) { + g_snprintf(tmpfilename, sizeof(tmpfilename)-1, "%s/xsys35-midi_%03d.mid", nact->tmpdir, i); + unlink(tmpfilename); + } + + return OK; +} + + +/* no = 0~ */ +static int midi_start(int no, char *data, int datalen) { + char tmpfilename[256]; + FILE *fd; + char cmd_pipe[256]; + pid_t pid; + + g_snprintf(tmpfilename, sizeof(tmpfilename) -1, "%s/xsys35-midi_%03d.mid", nact->tmpdir, no); + if (NULL == (fd = fopen(tmpfilename, "rb"))) { + if (NULL == (fd = fopen(tmpfilename, "wb"))) { + WARNING("cannot open tmporaryfile"); + return NG; + } + fwrite(data, 1, datalen, fd); + } + fclose(fd); + + if (pipedplay) { + g_snprintf(cmd_pipe, sizeof(cmd_pipe) -1, "%s %s", midi_player, tmpfilename); + if (-1 == muspcm_load_pipe(SLOT_MIDIPIPE, cmd_pipe)) { + return NG; + } + muspcm_start(SLOT_MIDIPIPE, 1); + pid = 1; // dummy + } else { + /* arg set */ + argv[argc] = tmpfilename; + argv[argc +1] = NULL; + + pid = fork(); + if (pid == 0) { + /* child process */ + pid_t mine = getpid(); +#ifdef QUITE_MIDI + close(1); +#endif + setpgid(mine, mine); + sys_set_signalhandler(SIGTERM, SIG_DFL); + execvp(midi_player, argv); + perror("execvp"); + _exit(-1); + } else if (pid < 0) { + WARNING("fork failed"); + return NG; + } + } + + midino = no; + midipid = pid; + counter = get_high_counter(SYSTEMCOUNTER_MIDI); + + return OK; +} + +static int midi_stop() { + int status = 0; + + if (!enabled || midipid == 0) { + return OK; + } + + if (!pipedplay) { + KILL(midipid, SIGCONT); + KILLPG(midipid, SIGCONT); + KILL(midipid, SIGTERM); + KILLPG(midipid, SIGTERM); + while (0 >= waitpid(midipid, &status, WNOHANG)); + } else { + muspcm_stop(SLOT_MIDIPIPE); + } + + midipid = 0; + midino = 0; + + return OK; +} + +static int midi_pause(void) { + if (!enabled || midipid == 0) return OK; + + if (pipedplay) { + muspcm_pause(SLOT_MIDIPIPE); + } else { + KILLPG(midipid, SIGTSTP); + } + return OK; +} + +static int midi_unpause(void) { + if (!enabled || midipid == 0) return OK; + + if (pipedplay) { + muspcm_unpause(SLOT_MIDIPIPE); + } else { + KILLPG(midipid, SIGCONT); + } + return OK; +} + +static int midi_get_playing_info(midiplaystate *st) { + int status, cnt, err; + + if (!enabled || midipid == 0) { + goto errout; + } + + if (pipedplay) { + cnt = muspcm_getpos(SLOT_MIDIPIPE); + if (cnt == 0) { + goto errout; + } + } else { + if (midipid == (err = waitpid(midipid, &status, WNOHANG))) { + midipid = 0; + goto errout; + } + cnt = (get_high_counter(SYSTEMCOUNTER_MIDI) - counter) * 10; + } + + st->in_play = TRUE; + st->play_no = midino; + st->loc_ms = cnt; + + return OK; + + errout: + st->in_play = FALSE; + st->play_no = 0; + st->loc_ms = 0; + return NG; +} + +static int midi_getflag(int mode, int index) { + return 0; +} + +static int midi_setflag(int mode, int index, int val) { + return NG; +} + +static int midi_setVolumePipe(int vol) { + if (prv.pcm[SLOT_CDROMPIPE] != NULL) { + prv.pcm[SLOT_CDROMPIPE]->vollv = vol; + } + return OK; +} + +static int midi_getVolumePipe() { + if (prv.pcm[SLOT_CDROMPIPE] != NULL) { + return prv.pcm[SLOT_CDROMPIPE]->vollv; + } + return 100; +} diff --git a/src/midi.h b/src/midi.h new file mode 100644 index 0000000..f33a02c --- /dev/null +++ b/src/midi.h @@ -0,0 +1,55 @@ +/* + * midi.h midi wrapper + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: midi.h,v 1.6 2002/08/18 09:35:29 chikama Exp $ */ + +#ifndef __MIDI_H__ +#define __MIDI_H__ + +#include "portab.h" + +typedef struct { + boolean in_play; /* now playing ? */ + int loc_ms; /* playing posion in ms */ + int play_no; /* current playing no */ +} midiplaystate; + +typedef struct mididevice mididevice_t; +struct mididevice { + int (* init)(char *, int); + int (* exit)(void); + int (* start)(int, char*, int); + int (* stop)(void); + int (* pause)(void); + int (* unpause)(void); + int (* getpos)(midiplaystate *); + int (* getflag)(int mode, int index); + int (* setflag)(int mode, int index, int val); + int (* setvol)(int); + int (* getvol)(int); +}; + +extern int midi_init(mididevice_t *); +extern void midi_set_playername(char *); +extern void midi_set_devicename(char *); +extern void midi_set_output_device(int mode); + +#endif /* __MIDI_H__ */ diff --git a/src/midi.rawmidi.c b/src/midi.rawmidi.c new file mode 100644 index 0000000..f6f9fc4 --- /dev/null +++ b/src/midi.rawmidi.c @@ -0,0 +1,620 @@ +/* + * midi.rawmidi.c midi play with rawmidi device + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * Based on midiplay+ by Daisuke NAGANO + * + * 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 + * +*/ +/* $Id: midi.rawmidi.c,v 1.7 2003/01/31 12:58:28 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ENABLE_MIDI_SEQMIDI +#if defined(__FreeBSD__) +#include +#elif defined(__OpenBSD__) || defined(__NetBSD__) +#include +#else +#include +#endif +#include +#endif + +#include "portab.h" +#include "system.h" +#include "midi.h" +#include "music_server.h" +#include "midifile.h" +#include "counter.h" + +struct _midiflag { + char midi_variable[128]; + char midi_flag[128]; +}; +typedef struct _midiflag midiflag_t; + + +static void signal_pause(int sig_num); +static void send_reset(); +static unsigned long ticks2usec(unsigned long ticks, int division, unsigned int tempo); +static void parse_event(); +static int midi_initilize(char *devnm, int subdev); +static int midi_exit(); +static int midi_start(int no, char *data, int datalen); +static int midi_stop(); +static int midi_pause(void); +static int midi_unpause(void); +static int midi_get_playing_info(midiplaystate *st); +static int midi_getflag(int mode, int index); +static int midi_setflag(int mode, int index, int val); + +static long(* myflush)(void); +static void(* mywrite)(unsigned char *d, int n, int p); + +#ifdef ENABLE_MIDI_RAWMIDI +static long raw_myflush(); +static void raw_mywrite(unsigned char *d, int n, int p); +#endif +#ifdef ENABLE_MIDI_SEQMIDI +static long seq_myflush(); +static void seq_mywrite(unsigned char *d, int n, int p); +#endif + +mididevice_t midi_rawmidi = { + midi_initilize, + midi_exit, + midi_start, + midi_stop, + midi_pause, + midi_unpause, + midi_get_playing_info, + midi_getflag, + midi_setflag, + NULL, + NULL +}; + +#ifndef MIDI_DEVICE +#define MIDI_DEVICE "/dev/midi" +#endif + +#ifndef SEQ_DEVICE +#define SEQ_DEVICE "/dev/sequencer" +#endif + +static boolean enabled = FALSE; +static struct midiinfo *midi; +static int midifd; +static char *mididevname; +static int midino; +static pid_t midipid; +static int counter; + +static int shmkey; +static midiflag_t *flags; + + +static boolean cmd_pause; +static boolean cmd_stop; + +static long extratime; + +#define ALL_NOTEOFF_SZ 48 +static char all_noteoff[] = { 0xb0, 0x7b, 0x00, + 0xb1, 0x7b, 0x00, + 0xb2, 0x7b, 0x00, + 0xb3, 0x7b, 0x00, + 0xb4, 0x7b, 0x00, + 0xb5, 0x7b, 0x00, + 0xb6, 0x7b, 0x00, + 0xb7, 0x7b, 0x00, + 0xb8, 0x7b, 0x00, + 0xb9, 0x7b, 0x00, + 0xba, 0x7b, 0x00, + 0xbb, 0x7b, 0x00, + 0xbc, 0x7b, 0x00, + 0xbd, 0x7b, 0x00, + 0xbe, 0x7b, 0x00, + 0xbf, 0x7b, 0x00 }; + +#define ALL_RESET_SZ 96 +static char all_reset[] = { 0xb0, 0x78, 0x00, 0xb0, 0x79, 0x00, + 0xb1, 0x78, 0x00, 0xb1, 0x79, 0x00, + 0xb2, 0x78, 0x00, 0xb2, 0x79, 0x00, + 0xb3, 0x78, 0x00, 0xb3, 0x79, 0x00, + 0xb4, 0x78, 0x00, 0xb4, 0x79, 0x00, + 0xb5, 0x78, 0x00, 0xb5, 0x79, 0x00, + 0xb6, 0x78, 0x00, 0xb6, 0x79, 0x00, + 0xb7, 0x78, 0x00, 0xb7, 0x79, 0x00, + 0xb8, 0x78, 0x00, 0xb8, 0x79, 0x00, + 0xb9, 0x78, 0x00, 0xb9, 0x79, 0x00, + 0xba, 0x78, 0x00, 0xba, 0x79, 0x00, + 0xbb, 0x78, 0x00, 0xbb, 0x79, 0x00, + 0xbc, 0x78, 0x00, 0xbc, 0x79, 0x00, + 0xbd, 0x78, 0x00, 0xbd, 0x79, 0x00, + 0xbe, 0x78, 0x00, 0xbe, 0x79, 0x00, + 0xbf, 0x78, 0x00, 0xbf, 0x79, 0x00 }; + + +extern void sys_set_signalhandler(int SIG, void (*handler)(int)); + +static void signal_pause(int sig_num) { + switch(sig_num) { + case SIGTERM: + cmd_stop = TRUE; + break; + case SIGUSR1: + /* pause */ + if (!cmd_pause) { + cmd_pause = TRUE; + } + break; + + case SIGUSR2: + /* unpause */ + if (cmd_pause) { + cmd_pause = FALSE; + } + break; + } +} + +static void send_reset() { + mywrite(all_reset, ALL_RESET_SZ, 0); + usleep(60000); + myflush(); + usleep(70000); + return; +} + +#ifdef ENABLE_MIDI_RAWMIDI + +#define WRBFSIZE 16384 +static unsigned char wrbuff[WRBFSIZE]; +static int nwr = 0; /* wrbuff の index */ + +static long raw_myflush() { + struct timeval st, et; + static long ret; + static long t1, t2; + int i; + + gettimeofday(&st, NULL); + + for (i = 0 ;i < nwr ; i++) { + while(write(midifd, wrbuff+i, 1) != 1); + } + + nwr = 0; + gettimeofday(&et, NULL); + + t1 = et.tv_usec - st.tv_usec; + t2 = et.tv_sec - st.tv_sec; + while (t1 < 0) { + t2--; + t1 += 1000000; + } + + ret = t2 * 1000000 + t1 + extratime; + + extratime = 0; + return ret; +} + +/* + * write the code to the buffer + */ +static void raw_mywrite(unsigned char *d, int n, int p) { + + if ((nwr + n + 2) >= WRBFSIZE) { + extratime = myflush(); + } + + while (n--) { + wrbuff[nwr++] = *(d++); + } + return; +} +#endif + +#ifdef ENABLE_MIDI_SEQMIDI +SEQ_DEFINEBUF(2048); +SEQ_USE_EXTBUF(); +static int midi_subdev; + +void seqbuf_dump() { + if (_seqbufptr) { + if (write(midifd, _seqbuf, _seqbufptr) == -1) { + perror("write"); + exit(-1); + } + } + _seqbufptr = 0; +} + +static long seq_myflush() { + struct timeval st, et; + static long ret; + static long t1, t2; + + gettimeofday(&st, NULL); + + seqbuf_dump(); + + gettimeofday(&et, NULL); + + t1 = et.tv_usec - st.tv_usec; + t2 = et.tv_sec - st.tv_sec; + while (t1 < 0) { + t2--; + t1 += 1000000; + } + + ret = t2 * 1000000 + t1 + extratime; + + extratime = 0; + return ret; +} + +/* + * write the code to the buffer + */ +static void seq_mywrite(unsigned char *d, int n, int p) { + + while(n--) { + SEQ_MIDIOUT(midi_subdev, *(d++)); + } + return; +} +#endif + + + +/* + * tick count to micro second for (usleep) + * + */ +static unsigned long ticks2usec(unsigned long ticks, int division, unsigned int tempo) { + + return (unsigned long) ((ticks) * (tempo) / (division)); +} + +static void parse_event() { + int i = 0; + int tick = 0; + int ctick = 0; + int tempo = 500000; + unsigned long ts, tu; + struct timeval tp; + + gettimeofday(&tp, NULL); + ts = tp.tv_sec; + tu = tp.tv_usec; + + while(TRUE) { + /* pause / stop check */ + if (cmd_stop) { + break; + } + + if (cmd_pause) { + gettimeofday(&tp, NULL); + ts = tp.tv_sec; + tu = tp.tv_usec; + usleep(50*1000); + continue; + } + + while(tick == midi->event[i].ctime) { + /* delta wait */ + if (ctick != midi->event[i].ctime) { + int delta, stime; + + delta = midi->event[i].ctime - ctick; + stime = ticks2usec(delta, midi->division, tempo) - myflush(); + if (stime > 0) { + long j; + struct timespec ttmp, *req; + + req = &ttmp; + req->tv_sec = (time_t)stime / 1000000; + req->tv_nsec = (long)(stime % 1000000) * 1000; + nanosleep(req, NULL); + + gettimeofday(&tp, NULL); + j = (tp.tv_sec * 1000000 + tp.tv_usec) - (ts * 1000000 + tu); + if (j != stime) { + extratime += (j - stime); + } + } else { + gettimeofday(&tp, NULL); + extratime += -stime; + } + ts = tp.tv_sec; + tu = tp.tv_usec; + ctick = midi->event[i].ctime; + } + if (midi->event[i].type == 0) { + /* ordinary data */ + mywrite(midi->event[i].data, midi->event[i].n, midi->event[i].port); + i++; + } else if (midi->event[i].type == 2) { + /* tempo change */ + int *p; + p = (int*)midi->event[i].data; + tempo = (unsigned int)*p; + i++; + } else if (midi->event[i].type == 3) { + /* system35 maker */ + int vn1 = midi->event[i+1].data[2]; + int vn2 = midi->event[i+2].data[2]; + int vn3 = midi->event[i+3].data[2]; + + switch(vn1) { + case 0: + /* set label */ + i += 6; + break; + case 1: + /* jump */ + mywrite(all_noteoff, ALL_NOTEOFF_SZ, 0); + i = midi->sys35_label[vn2]; + ctick = tick = midi->event[i].ctime; + break; + case 2: + /* set flag */ + flags->midi_flag[vn2] = vn3; + i += 6; + break; + case 3: + /* flag jump */ + if (flags->midi_flag[vn2] == 1) { + i = midi->sys35_label[vn3]; + ctick = + tick = midi->event[i].ctime; + mywrite(all_noteoff, ALL_NOTEOFF_SZ, 0); + } else { + i += 6; + } + break; + case 4: + /* set variable */ + flags->midi_variable[vn2] = vn3; + i += 6; + break; + case 5: + /* variable jump */ + if (--(flags->midi_variable[vn2]) == 0) { + i = midi->sys35_label[vn3]; + ctick = + tick = midi->event[i].ctime; + mywrite(all_noteoff, ALL_NOTEOFF_SZ, 0); + } else { + i += 6; + } + break; + } + } else { + WARNING("Unknown type of event %x (NEVER!).\n", midi->event[i].type); + } + if (i >= midi->eventsize) return; + } + tick++; + } +} + +static int midi_initilize(char *devnm, int subdev) { + enabled = FALSE; + + reset_counter_high(SYSTEMCOUNTER_MIDI, 10, 0); + + if (devnm == NULL) { + if (subdev == -1) { + mididevname = MIDI_DEVICE; + } else { + mididevname = SEQ_DEVICE; + } + } else { + mididevname = devnm; + } + + if (0 > (shmkey = shmget(IPC_PRIVATE, sizeof(midiflag_t), IPC_CREAT | 0600))) { + perror("shmget"); + return NG; + } + if ((void *)-1 == (flags = (midiflag_t *)shmat(shmkey, 0, 0))) { + perror("shmat"); + return NG; + } + memset(flags, 0, sizeof(midiflag_t)); + + if (subdev == -1) { +#ifdef ENABLE_MIDI_RAWMIDI + myflush = raw_myflush; + mywrite = raw_mywrite; + NOTICE("RAWMIDI Initilize OK\n"); +#endif + } else { +#ifdef ENABLE_MIDI_SEQMIDI + myflush = seq_myflush; + mywrite = seq_mywrite; + midi_subdev = subdev; + NOTICE("SEQMIDI Initilize OK\n"); +#endif + } + + enabled = TRUE; + return OK; +} + +static int midi_exit() { + if (enabled) { + midi_stop(); + if (0 > shmdt((char *)flags)) { + perror("shmdt"); + } + if (0 > shmctl(shmkey, IPC_RMID, 0)) { + perror("shmctl"); + } + } + return OK; +} + + +/* no = 0~ */ +static int midi_start(int no, char *data, int datalen) { + pid_t pid; + + pid = fork(); + if (pid == 0) { +#ifdef QUITE_MIDI + close(1); +#endif + sys_set_signalhandler(SIGTERM, SIG_DFL); + + if (NULL == (midi = mf_read_midifile(data, datalen))) { + _exit(-1); + } + + + if (0 > (midifd = open(mididevname, O_RDWR))) { + perror("open"); + _exit(-1); + } +#ifdef ENABLE_SEQMIDI + { int nrsynths; + if (-1 == ioctl(mididev, SNDCTL_SEQ_NRSYNTHS, &nrsynths)) { + perror("SNDCTL_SEQ_NRSYNTHS"); + _exit(-1); + }} +#endif + + send_reset(); + + sys_set_signalhandler(SIGUSR1, signal_pause); /* pause */ + sys_set_signalhandler(SIGUSR2, signal_pause); /* unpause */ + sys_set_signalhandler(SIGTERM, signal_pause); /* stop */ + + /* parse */ + parse_event(); + + send_reset(); + mf_remove_midifile(midi); + _exit(0); + } + + midino = no; + midipid = pid; + counter = get_high_counter(SYSTEMCOUNTER_MIDI); + + return OK; +} + +static int midi_stop() { + int status=0; + + if (!enabled || midipid == 0) { + return OK; + } + + kill(midipid, SIGTERM); + while(0 >= waitpid(midipid, &status, WNOHANG)); + + midipid = 0; + midino = 0; + + return OK; +} + +static int midi_pause(void) { + if (!enabled) return OK; + + kill(midipid, SIGUSR1); + return OK; +} + +static int midi_unpause(void) { + if (!enabled) return OK; + + kill(midipid, SIGUSR2); + return OK; +} + +static int midi_get_playing_info(midiplaystate *st) { + int status, cnt, err; + + if (!enabled || midino == 0) { + st->in_play = FALSE; + st->play_no = 0; + st->loc_ms = 0; + return OK; + } + + if (midipid == (err = waitpid(midipid, &status, WNOHANG))) { + st->in_play = FALSE; + st->play_no = 0; + st->loc_ms = 0; + midipid = 0; + return OK; + } + + cnt = get_high_counter(SYSTEMCOUNTER_MIDI) - counter; + + st->in_play = TRUE; + st->play_no = midino; + st->loc_ms = cnt * 10; + + return OK; +} + +static int midi_getflag(int mode, int index) { + if (mode == 0) { + /* flag */ + return flags->midi_flag[index]; + } else { + /* variable */ + return flags->midi_variable[index]; + } +} + +static int midi_setflag(int mode, int index, int val) { + if (mode == 0) { + /* flag */ + flags->midi_flag[index] = val; + } else { + /* variable */ + flags->midi_variable[index] = val; + } + return OK; +} diff --git a/src/midifile.c b/src/midifile.c new file mode 100644 index 0000000..b07cce9 --- /dev/null +++ b/src/midifile.c @@ -0,0 +1,581 @@ +/* + * midifile.h standard midifile parser + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * Based on midiplay+ by Daisuke NAGANO + * + * 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 + * +*/ +/* $Id: midifile.c,v 1.4 2002/12/31 04:11:19 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "midifile.h" + +static long to32bit(int c1, int c2, int c3, int c4); +static void midi_inc(); +static void make_chunk(struct midievent *ev, int n); +static void midi_noteoff(int chan, int note, int vol); +static void midi_noteon(int chan, int note, int vol); +static void midi_pressure(int chan, int note, int press); +static void midi_controlparameter(int chan, int cnt, int val); +static void midi_pitchbend(int chan, int lsb, int msg); +static void midi_program(int chan, int prog); +static void midi_chanpressure(int chan, int press); +static void midi_tempo(int tempo); +static void chanmessage(int status, int c1, int c2); +static void metaevent(int type); +static void msginit(); +static void msgadd(int c); +// static int msglen(); +static char *msg(); +static int midigetc(); +static long readvarinum(); +static void read_playevent(); +static int read_header(BYTE *stream, off_t len); + +static struct midiinfo *midi; + +#define Read16() \ +(*stream << 8) | (*(stream + 1)), stream+=2 + +#define Read32() \ +(*stream << 24) | (*(stream + 1) << 16) | (*(stream + 2) << 8) | (*(stream + 3)), stream+=4 + +static long to32bit(int c1, int c2, int c3, int c4) { + long value = 0L; + + value = (c1 & 0xff); + value = (value << 8) + (c2 & 0xff); + value = (value << 8) + (c3 & 0xff); + value = (value << 8) + (c4 & 0xff); + + return value; +} + +static void midi_inc() { + midi->ceptr++; + if (midi->ceptr > MAXMIDIEVENT) { + NOTICE("too much event\n"); + sys_exit(0); + } +} + +static void make_chunk(struct midievent *ev, int n) { + ev->type = 0; + ev->ctime = midi->curtime; + ev->n = n; + ev->port = 0; + + if (n != 0) { + ev->data = g_new(unsigned char, n + 1); + } +} + +static void midi_noteoff(int chan, int note, int vol) { + make_chunk(&midi->event[midi->ceptr], 3); + + midi->event[midi->ceptr].data[0] = MIDI_NOTEOFF + chan; + midi->event[midi->ceptr].data[1] = note; + midi->event[midi->ceptr].data[2] = vol; + + midi_inc(); +} + +static void midi_noteon(int chan, int note, int vol) { + make_chunk(&midi->event[midi->ceptr], 3); + + midi->event[midi->ceptr].data[0] = MIDI_NOTEON + chan; + midi->event[midi->ceptr].data[1] = note; + midi->event[midi->ceptr].data[2] = vol; + + midi_inc(); +} + +static void midi_pressure(int chan, int note, int press) { + make_chunk(&midi->event[midi->ceptr], 3); + + midi->event[midi->ceptr].data[0] = MIDI_PRESSURE + chan; + midi->event[midi->ceptr].data[1] = note; + midi->event[midi->ceptr].data[2] = press; + + midi_inc(); +} + +static int check_sys35mark(int *fnc, int *val1, int *val2) { + midi->marker++; + + switch(midi->marker) { + case 1: + if (midi->event[midi->ceptr].data[1] != 101 || + midi->event[midi->ceptr].data[2] != 100) { + midi->marker = 0; + } + break; + case 2: + if (midi->event[midi->ceptr].data[1] != 100) { + midi->marker = 0; + } + break; + case 3: + if (midi->event[midi->ceptr].data[1] != 6) { + midi->marker = 0; + } + break; + case 4: + if (midi->event[midi->ceptr].data[1] != 38) { + midi->marker = 0; + } + break; + case 5: + if (midi->event[midi->ceptr].data[1] != 101 || + midi->event[midi->ceptr].data[2] != 127) { + midi->marker = 0; + } + break; + case 6: + if (midi->event[midi->ceptr].data[1] != 100 || + midi->event[midi->ceptr].data[2] != 127) { + midi->marker = 0; + } else { + midi->marker = 0; + *fnc = midi->event[midi->ceptr-4].data[2]; + *val1 = midi->event[midi->ceptr-3].data[2]; + *val2 = midi->event[midi->ceptr-2].data[2]; + return 1; + } + break; + } + return 0; +} + +static void midi_controlparameter(int chan, int cnt, int val) { + int fnc, val1, val2; + + make_chunk(&midi->event[midi->ceptr], 3); + + midi->event[midi->ceptr].data[0] = MIDI_CONTROL + chan; + midi->event[midi->ceptr].data[1] = cnt; + midi->event[midi->ceptr].data[2] = val; + + if (check_sys35mark(&fnc, &val1, &val2) > 0) { + midi->event[midi->ceptr - 5].type = 3; + /* ラベル登録 */ + if (fnc == 0) { + midi->sys35_label[val1] = midi->ceptr -5; + } + } + + midi_inc(); +} + +static void midi_pitchbend(int chan, int lsb, int msg) { + make_chunk(&midi->event[midi->ceptr], 3); + + midi->event[midi->ceptr].data[0] = MIDI_PITCHB + chan; + midi->event[midi->ceptr].data[1] = lsb; + midi->event[midi->ceptr].data[2] = msg; + + midi_inc(); +} + +static void midi_program(int chan, int prog) { + make_chunk(&midi->event[midi->ceptr], 2); + + midi->event[midi->ceptr].data[0] = MIDI_PROGRAM + chan; + midi->event[midi->ceptr].data[1] = prog; + + midi_inc(); +} + +static void midi_chanpressure(int chan, int press) { + make_chunk(&midi->event[midi->ceptr], 2); + + midi->event[midi->ceptr].data[0] = MIDI_CHANPRES + chan; + midi->event[midi->ceptr].data[1] = press; + + midi_inc(); +} + +static void midi_tempo(int tempo) { + unsigned char x[4]; + unsigned int *p; + + p = (unsigned int*)x; + *p = (unsigned int)tempo; + + make_chunk(&midi->event[midi->ceptr], sizeof(unsigned long)); + midi->event[midi->ceptr].type = 2; /* tempo change (msec/midi-qnote) */ + midi->event[midi->ceptr].data[0] = x[0]; + midi->event[midi->ceptr].data[1] = x[1]; + midi->event[midi->ceptr].data[2] = x[2]; + midi->event[midi->ceptr].data[3] = x[3]; + + midi_inc(); +} + +static void chanmessage(int status, int c1, int c2) { + int chan = status & 0xf; + + switch (status & 0xf0) { + case 0x80: + midi_noteoff(chan, c1, c2); + break; + case 0x90: + midi_noteon(chan, c1, c2); + break; + case 0xa0: + midi_pressure(chan, c1, c2); + break; + case 0xb0: + midi_controlparameter(chan, c1, c2); + break; + case 0xe0: + midi_pitchbend(chan, c1, c2); + break; + case 0xc0: + midi_program(chan, c1); + break; + case 0xd0: + midi_chanpressure(chan, c1); + break; + default: + NOTICE("Unknown Message\n"); + } +} + +static void metaevent(int type) { + // int len = msglen(); + char *m = msg(); + + switch(type) { + case 0x00: + NOTICE("seqnum\n"); + break; + case 0x01: + NOTICE("text event (Text Event, Ignored)\n"); + break; + case 0x02: + NOTICE("copyright notice (Text Event, Ignored)\n"); + break; + case 0x03: + NOTICE("sequence / track name (Text Event, Ignored)\n"); + break; + case 0x04: + NOTICE("instrument name (Text Event, Ignored)\n"); + break; + case 0x05: + NOTICE("lyric (Text Event, Ignored)\n"); + break; + case 0x06: + NOTICE("marker (Text Event, Ignored)\n"); + break; + case 0x07: + NOTICE("cue point (Text Event, Ignored)\n"); + break; + case 0x08: + NOTICE("meta event 0x08 (Text Event, Ignored)\n"); + break; + case 0x09: + NOTICE("meta event 0x09 (Text Event, Ignored)\n"); + break; + case 0x0a: + NOTICE("meta event 0x0a (Text Event, Ignored)\n"); + break; + case 0x0b: + NOTICE("meta event 0x0b (Text Event, Ignored)\n"); + break; + case 0x0c: + NOTICE("meta event 0x0c (Text Event, Ignored)\n"); + break; + case 0x0d: + NOTICE("meta event 0x0d (Text Event, Ignored)\n"); + break; + case 0x0e: + NOTICE("meta event 0x0e (Text Event, Ignored)\n"); + break; + case 0x0f: + NOTICE("meta event 0x0f (Text Event, Ignored)\n"); + break; + case 0x2f: + /* EOF */ + midi->length_left = 0; + midi->eventsize = midi->ceptr; + break; + case 0x51: + midi_tempo(to32bit(0, m[0], m[1], m[2])); + break; + case 0x54: + NOTICE("set smpte\n"); + break; + case 0x58: + NOTICE("time sig (Ignore)\n"); + break; + case 0x59: + NOTICE("keysig (Ignore)\n"); + break; + case 0x7f: + NOTICE("seq specific\n"); + break; + default: + NOTICE("meta misc\n"); + break; + } +} + +static void msginit() { + midi->msgindex = 0; +} + +static void msgadd(int c) { + if (midi->msgindex >= midi->msgsize) { + midi->msgsize *= 2; + midi->msgbuffer = (unsigned char *)g_realloc(midi->msgbuffer, midi->msgsize); + } + midi->msgbuffer[midi->msgindex++] = (unsigned char)c; +} + +#if 0 +static int msglen() { + return midi->msgindex; +} +#endif + +static char *msg() { + return midi->msgbuffer; +} + +static int midigetc() { + midi->length_left--; + return *midi->cdata++; +} + +/* readvarinum - read a varying-length number, and return the */ +/* number of characters it took. */ + +static long readvarinum() { + long value; + int c; + + value = c = midigetc(); + + if (c & 0x80) { + value &= 0x7f; + do { + c = midigetc(); + value = (value << 7) + (c & 0x7f); + } while (c & 0x80); + } + return value; +} + +static void read_playevent() { + int c, c1, type; + int running = 0; /* 1 when running status used */ + int status = 0; /* status value (e.g. 0x90==note-on) */ + int delta, needed, lookfor; + + /* This array is indexed by the high half of a status byte. It's */ + /* value is either the number of bytes needed (1 or 2) for a channel */ + /* message, or 0 (meaning it's not a channel message). */ + static int chantype[] = { + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 through 0x70 */ + 2, 2, 2, 2, 1, 1, 2, 0 /* 0x80 through 0xf0 */ + }; + + midi->cdata = midi->data; + midi->length_left = midi->length; + midi->curtime = 0; + midi->ceptr = 0; + + while(midi->length_left > 0) { + midi->curtime += (delta = readvarinum()); /* delta time for midi event */ + + c = midigetc(); + + if ((c & 0x80) == 0) { + running = 1; + } else { + status = c; + running = 0; + } + + needed = chantype[(status >> 4) & 0x0f]; + + if (needed) { /* ie. is it a channel message? */ + + if (running) { + c1 = c; + } else { + c1 = midigetc(); + } + chanmessage(status, c1, (needed > 1) ? midigetc() : 0); + + if ((status & 0xf0) != 0xb0) { + midi->marker = 0; /* maker flag clear */ + } + continue;; + } + + midi->marker = 0; /* maker flag clear */ + + switch (c) { + case 0xFF: /* meta event */ + type = midigetc(); + lookfor = midi->length_left - readvarinum(); + msginit(); + + while(midi->length_left > lookfor) { + msgadd(midigetc()); + } + + metaevent(type); + break; + + case 0xF0: /* system exclusive */ + lookfor = midi->length_left - readvarinum(); + msginit(); + msgadd(0xF0); + while(midi->length_left > lookfor) { + msgadd(midigetc()); + } + NOTICE("system exculsive ( not supported )"); + break; + + case 0xF7: /* system exclusive continuation or arbitrary stuff */ + lookfor = midi->length_left - readvarinum(); + msginit(); + while(midi->length_left > lookfor) { + msgadd(c = midigetc()); + } + NOTICE("system exclusive cont. ( not supporte d)"); + break; + + default: + NOTICE("Unknow Event ( not supported )"); + } + + } +} + +static int read_header(BYTE *stream, off_t len) { + int tracklen, i = 0; + BYTE *stream_top = stream; + + while(i == 0 && stream < (stream_top + len)) { + if (0 == strncmp(stream, "MThd", 4)) { + stream += 4; + i++; + } else { + stream++; + } + } + + if (stream != stream_top) { + stream -= 4; + } + + i = Read32(); + + if (i == RIFF) { + stream += 16; + i = Read32(); + } + + if (i == MThd) { + tracklen = Read32(); + midi->format = Read16(); + midi->ntrks = Read16(); + midi->division = Read16(); + } else { + boolean found = FALSE; + while (!found && stream < (stream_top + len - 8)) { + if (0 == strncmp(stream, "MThd", 4)) { + found = TRUE; + } else { + stream++; + } + } + if (found) { + stream += 4; + tracklen = Read32(); + midi->format = Read16(); + midi->ntrks = Read16(); + midi->division = Read16(); + } else { + WARNING("unknow format\n"); + return NG; + } + } + + if (midi->ntrks != 1) { + WARNING("multiple track (format 1) is not supported"); + return NG; + } + + NOTICE("tracklen = %d, format = %d, ntrks = %d, division = %d\n", + tracklen, midi->format, midi->ntrks, midi->division); + + i = Read32(); + if (i != MTrk) { + WARNING("Unknow format\n"); + } + + tracklen = Read32(); + + if (stream + tracklen > stream_top + len) { + tracklen = stream + len - stream_top; + } + + midi->length = tracklen; + midi->data = stream; + + return OK; +} + +struct midiinfo *mf_read_midifile(BYTE *stream, off_t len) { + midi = g_new(struct midiinfo, 1); + + midi->msgsize = 128; /* Initial msg buffer size */ + midi->msgbuffer = g_new0(unsigned char, midi->msgsize); + + if (0 > read_header(stream, len)) { + return NULL; + } + + read_playevent(); + + return midi; +} + +void mf_remove_midifile(struct midiinfo *m) { + int i; + + g_free(m->msgbuffer); + + for (i = 0; i < m->eventsize; i ++) { + g_free(m->event[i].data); + } + g_free(m); +} diff --git a/src/midifile.h b/src/midifile.h new file mode 100644 index 0000000..9c2d19d --- /dev/null +++ b/src/midifile.h @@ -0,0 +1,94 @@ +/* + * midifile.h standard midifile parser + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * Based on midiplay+ by Daisuke NAGANO + * + * 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 + * +*/ +/* $Id: midifile.h,v 1.2 2001/03/22 11:10:13 chikama Exp $ */ + +#ifndef __MIDIFILE_H__ +#define __MIDIFILE_H__ + +#include +#include + +#include "portab.h" + +/* Non-standard MIDI file formats */ +#define RIFF 0x52494646 +#define CTMF 0x43544d46 +/* Standard MIDI file format definitions */ +#define MThd 0x4d546864 +#define MTrk 0x4d54726b + +/* MIDI COMMANDS */ +#define MIDI_NOTEOFF 0x80 /* Note off */ +#define MIDI_NOTEON 0x90 /* Note on */ +#define MIDI_PRESSURE 0xa0 /* Polyphonic key pressure */ +#define MIDI_CONTROL 0xb0 /* Control change */ +#define MIDI_PROGRAM 0xc0 /* Program change */ +#define MIDI_CHANPRES 0xd0 /* Channel pressure */ +#define MIDI_PITCHB 0xe0 /* Pitch wheel change */ +#define MIDI_SYSEX 0xf0 /* System exclusive data */ + +#define MAXMIDIEVENT 65536 /* maxium event sequence number */ + +struct midievent { + int type; /* Data type + 0: normal + 1: text + 2: tempo change + 3: system35 message + */ + unsigned long ctime; /* steptime */ + int n; /* data length */ + int port; /* midi port */ + unsigned char *data; /* midi data */ +}; + +struct midiinfo { + int format; /* MIDI format version ( only 0 is supported) */ + int division; /* division for delta time*/ + int ntrks; /* number of track */ + + BYTE *data; + BYTE *cdata; + int length; + int length_left; + + struct midievent event[MAXMIDIEVENT]; /* event data */ + int eventsize; /* total event size */ + int ceptr; /* current event pointer */ + + /* work info */ + long curtime; /* current time */ + int msgindex; /* midi message buffer index */ + int msgsize; /* size of current allocaed msg */ + unsigned char *msgbuffer; /* message buffer */ + + /* system35 jump info */ + int sys35_label[127]; + int marker; +}; + +extern struct midiinfo *mf_read_midifile(BYTE *stream, off_t len); +extern void mf_remove_midifile(struct midiinfo *m); + +#endif /* __MIDIFILE_H__ */ diff --git a/src/mixer_alsa.c b/src/mixer_alsa.c new file mode 100644 index 0000000..fea9a78 --- /dev/null +++ b/src/mixer_alsa.c @@ -0,0 +1,244 @@ +/* + * mixer_alsa.c ALSA mixer lowlevel access (for 0.5.x) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: mixer_alsa.c,v 1.11 2006/04/21 16:40:48 chikama Exp $ */ + +#include "config.h" +#include "audio.h" + +#include +#include +#include +#include + +#include "audio_alsa.h" + +#define MIXER_ELEMENT_MAX 100 +static snd_mixer_eid_t eid[MIXER_ELEMENT_MAX]; +static snd_mixer_element_t einit[MIXER_ELEMENT_MAX]; +static int emax; + +/* + level: 0-100 +*/ +static void mixer_set_level(audiodevice_t *dev, int ch, int level) { + snd_mixer_t *mixer_handle; + mixer_alsa05_t *amix = (mixer_alsa05_t *)dev->data_mix; + int i, err; + int lv; + +#if 0 + printf("mixer set '%s',%d,%d = %3d (%3d %3d %3d)\n" , + amix->elem.eid.name,amix->elem.eid.index,amix->elem.eid.type, + level,mix->vol,mix->vol_full,mix->range.scale); +#endif + + if (0 > snd_mixer_open(&mixer_handle, amix->card, amix->mix_dev)) { + WARNING("mixer_set_level(): Opening mixer device %d failed\n", + amix->mix_dev); + return; + } + + for (i = 0; i < amix->e[ch].data.volume1.voices; i++) { + //lv = (amix->ei[ch].data.volume1.prange[i].max * level / 100); + lv = (einit[amix->connect[ch]].data.volume1.pvoices[i] * level / 100); + amix->e[ch].data.volume1.pvoices[i] = lv; + } + + if (0 > (err = snd_mixer_element_write(mixer_handle, &amix->e[ch]))) { + WARNING("mixer_set_level(lv%d): mixer write failed %s\n", + level, snd_strerror(err)); + } + snd_mixer_close(mixer_handle); +} + +static int mixer_get_level(audiodevice_t *dev, int ch) { + // mixer_alsa05_t *amix = (mixer_alsa05_t *)dev->data_mix; + +#if 0 + if (snd_mixer_open(&mixer_handle, amix->card, amix->mix_dev) < 0) { + WARNING("mixer_get_level(): Opening mixer device (%d,%d) failed\n", + amix->card, amix->mix_dev); + return 0; + } + + if (snd_mixer_element_read(mixer_handle, &amix->elem) < 0) { + WARNING("mixer_get_level(): mixser read failed\n"); + return 0; + } + + snd_mixer_close(mixer_handle); + return amix->Epvol1(elem.)[0]; +#endif + return 0; +} + +void mixer_exit(audiodevice_t *dev) { + snd_mixer_t *mixer_handle; + mixer_alsa05_t *amix = (mixer_alsa05_t *)dev->data_mix; + int i; + + if (0 > snd_mixer_open(&mixer_handle, amix->card, amix->mix_dev)) { + WARNING("mixer_exit(): Opening mixer device %d failed\n", + amix->mix_dev); + g_free(dev->data_mix); + return; + } + + for (i = 0; i < emax; i++) { + if (0 > snd_mixer_element_write(mixer_handle, &einit[i])) { + WARNING("mixer_exit(): write device failed\n"); + continue; + } + } + + g_free(dev->data_mix); +} + +int mixer_init(audiodevice_t *dev, int card, int mixdev, snd_ctl_hw_info_t *hwinfo[]) { + snd_mixer_t *handle; + mixer_alsa05_t *mix; + snd_mixer_elements_t es; + int i, j, k; + + if (mixdev == -1) { + // 自動の場合、指定の card から使用可能な mixer device を + // 選択し SND_MIXER_ETYPE_VOLUME1 があれば、そのデバイスを使う + for (i = 0; i < hwinfo[card]->mixerdevs; i++) { + if (0 > snd_mixer_open(&handle, card, i)) { + return NG; + } + memset(&es, 0, sizeof(snd_mixer_elements_t)); + + // 全 element 数を取得 + if (0 > snd_mixer_elements(handle, &es)) { + snd_mixer_close(handle); + return NG; + } + + // elemnt が 1つもない場合はerror + if (es.elements_over < 1) { + snd_mixer_close(handle); + return NG; + } + + // element の情報を格納する場所の確保 + es.pelements = g_new(snd_mixer_eid_t, es.elements_over); + // 実際に elements を取得 + es.elements_size = es.elements_over; + es.elements = 0; + if (0 > snd_mixer_elements(handle, &es)) { + g_free(es.pelements); + snd_mixer_close(handle); + return NG; + } + snd_mixer_close(handle); + + for (k = 0; k < es.elements; k++) { + if (es.pelements[k].type == SND_MIXER_ETYPE_VOLUME1) { + // found + g_free(es.pelements); + mixdev = i; + goto out; + } + } + g_free(es.pelements); + } + } + out: + if (0 > snd_mixer_open(&handle, card, mixdev)) { + return NG; + } + memset(&es, 0, sizeof(snd_mixer_elements_t)); + + // 全 element 数を取得 + if (0 > snd_mixer_elements(handle, &es)) { + snd_mixer_close(handle); + return NG; + } + + // elemnt が 1つもない場合はerror + if (es.elements_over < 1) { + snd_mixer_close(handle); + return NG; + } + + // element の情報を格納する場所の確保 + es.pelements = g_new(snd_mixer_eid_t, es.elements_over); + // 実際に elements を取得 + es.elements_size = es.elements_over; + es.elements = 0; + if (0 > snd_mixer_elements(handle, &es)) { + g_free(es.pelements); + snd_mixer_close(handle); + return NG; + } + + mix = g_new0(mixer_alsa05_t, 1); + mix->card = card; + mix->mix_dev = mixdev; + + for (i = 0, j = 0; i < es.elements && j < MIXER_ELEMENT_MAX; i++) { + if (es.pelements[i].type != SND_MIXER_ETYPE_VOLUME1) continue; + + eid[j] = es.pelements[i]; + + // 初期接続設定 + if (0 == strncmp(SND_MIXER_OUT_MASTER, eid[j].name, strlen(SND_MIXER_OUT_MASTER)) && eid[j].index == 0) { + mix->connect[MIX_MASTER] = j; + } + if (0 == strncmp(SND_MIXER_IN_CD, eid[j].name, strlen(SND_MIXER_IN_CD)) && eid[j].index == 0) { + mix->connect[MIX_CD] = j; + } + if (0 == strncmp(SND_MIXER_IN_SYNTHESIZER, eid[j].name, strlen(SND_MIXER_IN_SYNTHESIZER)) && eid[j].index == 0) { + mix->connect[MIX_MIDI] = j; + } + if (0 == strncmp(SND_MIXER_IN_PCM, eid[j].name, strlen(SND_MIXER_IN_PCM)) && eid[j].index == 0) { + mix->connect[MIX_PCM] = j; + } + + // 初期 volume の保存 + einit[j].eid = eid[j]; + if (0 > snd_mixer_element_build(handle, &einit[j])) { + WARNING("snd_mixer_element fail\n"); + } + NOTICE("%s (%d)\n", eid[j].name, einit[j].data.volume1.pvoices[0]); + j++; + } + emax = j; + + // element と element info の取得 + for (i = 0; i < MIX_NRDEVICES; i++) { + mix->e[i].eid = eid[mix->connect[i]]; + mix->ei[i].eid = eid[mix->connect[i]]; + snd_mixer_element_build(handle, &mix->e[i]); + snd_mixer_element_info_build(handle, &mix->ei[i]); + } + dev->data_mix = mix; + + snd_mixer_close(handle); + + g_free(es.pelements); + + return 0; +} + diff --git a/src/mixer_alsa09.c b/src/mixer_alsa09.c new file mode 100644 index 0000000..96354fa --- /dev/null +++ b/src/mixer_alsa09.c @@ -0,0 +1,61 @@ +/* + * mixer_alsa09.c ALSA mixer lowlevel access (for 0.9.x) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: mixer_alsa09.c,v 1.3 2002/09/01 11:54:51 chikama Exp $ */ + +#include "config.h" +#include "audio.h" + +#include +#include +#include +#include + +#include "audio_alsa09.h" + +#define MIXER_ELEMENT_MAX 100 + +/* + level: 0-100 +*/ +static void mixer_set_level(audiodevice_t *dev, int ch, int level) { + mixer_alsa09_t *amix = (mixer_alsa09_t *)dev->data_mix; +} + +static int mixer_get_level(audiodevice_t *dev, int ch) { + mixer_alsa09_t *amix = (mixer_alsa09_t *)dev->data_mix; + + return 0; +} + +void mixer_exit(audiodevice_t *dev) { + g_free(dev->data_mix); +} + +int mixer_init(audiodevice_t *dev) { + mixer_alsa09_t *mix = g_new0(mixer_alsa09_t, 1); + mix->card = 0; + mix->mix_dev = 0; + dev->data_mix = mix; + return 0; +} + diff --git a/src/mixer_esd.c b/src/mixer_esd.c new file mode 100644 index 0000000..fbbd2d6 --- /dev/null +++ b/src/mixer_esd.c @@ -0,0 +1,70 @@ +/* + * mixer_esd.c esd mixer lowlevel acess + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: mixer_esd.c,v 1.10 2002/12/31 04:11:19 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "audio.h" +#include "audio_esd.h" + +static char *mixlabels[] = {"esd "}; + + +static void mixer_set_level(audiodevice_t *dev, int ch, int level) { + audio_esd_t *esd = (audio_esd_t *)dev->data_pcm; + int lv; + + if (ch == MIX_CD || ch == MIX_MIDI) return; + + if (level < 0) level = 0; + if (level > 100) level = 100; + + lv = (level * 256) / 100; + + esd_set_stream_pan(esd->fdh, esd->sid, lv, lv); + + esd->curvol = lv; +} + +static int mixer_get_level(audiodevice_t *dev, int ch) { + audio_esd_t *esd = (audio_esd_t *)dev->data_pcm; + return esd->curvol; +} + +static int mixer_init(audiodevice_t *dev) { + audio_esd_t *esd = (audio_esd_t *)dev->data_pcm; + esd->curvol = 256; + return OK; +} + +static void mixer_get_allelements(audiodevice_t *dev, char **list[], int *n) { + *list = mixlabels; + *n = 1; +} + +static void mixer_set_element(audiodevice_t *dev, int src, int dst) { + return; +} diff --git a/src/mixer_oss.c b/src/mixer_oss.c new file mode 100644 index 0000000..f67a3ee --- /dev/null +++ b/src/mixer_oss.c @@ -0,0 +1,150 @@ +/* + * mixer_oss.c oss mixer lowlevel access + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * rewrited 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: mixer_oss.c,v 1.13 2003/01/04 17:01:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__FreeBSD__) +# if __FreeBSD__ < 4 +# include +# else +# include +# endif +#elif defined(__OpenBSD__) || defined(__NetBSD__) +# include +#else +# include +#endif +#include + +#include "audio.h" +#include "audio_oss.h" +#include "system.h" + +static char *mixlabels[] = SOUND_DEVICE_LABELS; + +/* + level: 0-100 +*/ +static void mixer_set_level(audiodevice_t *dev, int ch, int level) { + mixer_oss_t *oss = (mixer_oss_t *)dev->data_mix; + int fd, lv; + + if (level < 0) level = 0; + if (level > 100) level = 100; + + if ((fd = open(oss->mdev, O_RDWR)) < 0) return; + + lv = (((oss->vols_org[oss->connect[ch]] & 0xff) * level) / 100) & 0xff; + lv |= (lv << 8); + + if (ioctl(fd, MIXER_WRITE(oss->connect[ch]), &lv) < 0) { + WARNING("mixer write failed (%s)\n", mixlabels[oss->connect[ch]]); + } + close(fd); +} + +/* + 0-100 +*/ +static int mixer_get_level(audiodevice_t *dev, int ch) { + mixer_oss_t *oss = (mixer_oss_t *)dev->data_mix; + int fd, vol; + + if ((fd = open(oss->mdev, O_RDWR)) < 0) return 0; + + if (ioctl(fd, MIXER_READ(oss->connect[ch]), &vol) < 0) { + WARNING("mixer read failed (%s)\n", mixlabels[oss->connect[ch]]); + return 0; + } + close(fd); + + return ((vol & 0xff) * 100) / 256; +} + +static int mixer_init(audiodevice_t *dev, char *devmix) { + mixer_oss_t *mix; + int i, fd; + + if ((fd = open(devmix, O_RDWR)) < 0) return NG; + + mix = g_new0(mixer_oss_t, 1); + mix->mdev = devmix; + dev->data_mix = mix; + + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + int lv; + if (0 > ioctl(fd, MIXER_READ(i), &lv)) { + WARNING("mixer read failed (%s)\n", mixlabels[i]); + } else { + NOTICE("mixer read ok (%s)(%d)\n", mixlabels[i], lv & 0xff); + } + + mix->vols_org[i] = lv; + } + + /* 初期接続設定 */ + mix->connect[MIX_MASTER] = SOUND_MIXER_VOLUME; + mix->connect[MIX_CD] = SOUND_MIXER_CD; + mix->connect[MIX_MIDI] = SOUND_MIXER_SYNTH; + //mix->connect[MIX_MIDI] = SOUND_MIXER_LINE; + mix->connect[MIX_PCM] = SOUND_MIXER_PCM; + + return OK; +} + +static int mixer_exit(audiodevice_t *dev) { + mixer_oss_t *mix = dev->data_mix; + int i, fd; + + if ((fd = open(mix->mdev, O_RDWR)) < 0) return NG; + + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + int lv = mix->vols_org[i]; + if (ioctl(fd, MIXER_WRITE(i), &lv) < 0) { + WARNING("mixer read failed (%s)\n", mixlabels[i]); + } + } + + return OK; +} + +static void mixer_get_allelements(audiodevice_t *dev, char **list[], int *n) { + *list = mixlabels; + *n = SOUND_MIXER_NRDEVICES; +} + +static void mixer_set_element(audiodevice_t *dev, int src, int dst) { + mixer_oss_t *mix = dev->data_mix; + mix->connect[src]= dst; +} + diff --git a/src/mixer_sun.c b/src/mixer_sun.c new file mode 100644 index 0000000..ecffceb --- /dev/null +++ b/src/mixer_sun.c @@ -0,0 +1,23 @@ +#include "audio_sun.h" + +static void mixer_set_level(audiodevice_t *dev, int ch, int level) { + return; +} + +static int mixer_get_level(audiodevice_t *dev, int ch) { + return 0; +} + +static int mixer_exit(audiodevice_t *dev) { + return OK; +} + +static int mixer_init(audiodevice_t *dev, char *devmix) { + mixer_sun_t *mix; + + // mix = g_new0(mixer_sun_t, 1); + + + return OK; +} + diff --git a/src/mt19937-1.c b/src/mt19937-1.c new file mode 100644 index 0000000..324309d --- /dev/null +++ b/src/mt19937-1.c @@ -0,0 +1,106 @@ +/* A C-program for MT19937: Real number version (1998/4/6) */ +/* genrand() generates one pseudorandom real number (double) */ +/* which is uniformly distributed on [0,1]-interval, for each */ +/* call. sgenrand(seed) set initial values to the working area */ +/* of 624 words. Before genrand(), sgenrand(seed) must be */ +/* called once. (seed is any 32-bit integer except for 0). */ +/* Integer generator is obtained by modifying two lines. */ +/* Coded by Takuji Nishimura, considering the suggestions by */ +/* Topher Cooper and Marc Rieffel in July-Aug. 1997. */ + +/* This library is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU Library General Public */ +/* License as published by the Free Software Foundation; either */ +/* version 2 of the License, or (at your option) any later */ +/* version. */ +/* This library is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +/* See the GNU Library General Public License for more details. */ +/* You should have received a copy of the GNU Library General */ +/* Public License along with this library; if not, write to the */ +/* Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */ +/* 02111-1307 USA */ + +/* Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura. */ +/* When you use this, send an email to: matumoto@math.keio.ac.jp */ +/* with an appropriate reference to your work. */ + +/* REFERENCE */ +/* M. Matsumoto and T. Nishimura, */ +/* "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform */ +/* Pseudo-Random Number Generator", */ +/* ACM Transactions on Modeling and Computer Simulation, */ +/* Vol. 8, No. 1, January 1998, pp 3--30. */ + +#include + +/* Period parameters */ +#define N 624 +#define M 397 +#define MATRIX_A 0x9908b0df /* constant vector a */ +#define UPPER_MASK 0x80000000 /* most significant w-r bits */ +#define LOWER_MASK 0x7fffffff /* least significant r bits */ + +/* Tempering parameters */ +#define TEMPERING_MASK_B 0x9d2c5680 +#define TEMPERING_MASK_C 0xefc60000 +#define TEMPERING_SHIFT_U(y) (y >> 11) +#define TEMPERING_SHIFT_S(y) (y << 7) +#define TEMPERING_SHIFT_T(y) (y << 15) +#define TEMPERING_SHIFT_L(y) (y >> 18) + +static unsigned long mt[N]; /* the array for the state vector */ +static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */ + +/* initializing the array with a NONZERO seed */ +void +sgenrand(seed) + unsigned long seed; +{ + /* setting initial seeds to mt[N] using */ + /* the generator Line 25 of Table 1 in */ + /* [KNUTH 1981, The Art of Computer Programming */ + /* Vol. 2 (2nd Ed.), pp102] */ + mt[0]= seed & 0xffffffff; + for (mti=1; mti= N) { /* generate N words at one time */ + int kk; + + if (mti == N+1) /* if sgenrand() has not been called, */ + sgenrand(4357); /* a default initial seed is used */ + + for (kk=0;kk> 1) ^ mag01[y & 0x1]; + } + for (;kk> 1) ^ mag01[y & 0x1]; + } + y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK); + mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1]; + + mti = 0; + } + + y = mt[mti++]; + y ^= TEMPERING_SHIFT_U(y); + y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B; + y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C; + y ^= TEMPERING_SHIFT_L(y); + + return ( (double)y * 2.3283064370807974e-10 ); /* reals */ + /* return y; */ /* for integer generation */ +} diff --git a/src/music.c b/src/music.c new file mode 100644 index 0000000..4e61277 --- /dev/null +++ b/src/music.c @@ -0,0 +1,38 @@ +/* + * music.c music sever/client init and exit + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music.c,v 1.49 2003/11/16 15:29:52 chikama Exp $ */ + +#include "portab.h" +#include "music_server.h" +#include "music_client.h" + +int mus_init() { + musserv_init(); + musclient_init(); + return OK; +} + +int mus_exit() { + musclient_exit(); + musserv_exit(); + return OK; +} diff --git a/src/music.h b/src/music.h new file mode 100644 index 0000000..dddb0b0 --- /dev/null +++ b/src/music.h @@ -0,0 +1,108 @@ +/* + * music.h music sever/client shared information + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music.h,v 1.25 2003/11/16 15:29:52 chikama Exp $ */ + +#ifndef __MUSIC_H__ +#define __MUSIC_H__ + +#include + +/* music command */ +enum { + MUS_CDROM_START, /* 0 */ + MUS_CDROM_STOP, + MUS_CDROM_GETPOSITION, + MUS_CDROM_GETMAXTRACK, + + MUS_PCM_START, + MUS_PCM_STOP, + MUS_PCM_LOAD_NO, + MUS_PCM_LOAD_MEM, + MUS_PCM_LOAD_LRSW, + MUS_PCM_UNLOAD, + MUS_PCM_GETPOSITION, + MUS_PCM_WAITEND, + MUS_PCM_WAITTIME, + MUS_PCM_GETWAVETIME, + + MUS_FADE_START, + MUS_FADE_STOP, + MUS_FADE_GETSTATE, + MUS_FADE_GETLEVEL, + + MUS_MIDI_START, + MUS_MIDI_STOP, + MUS_MIDI_PAUSE, + MUS_MIDI_UNPAUSE, + MUS_MIDI_GETPOSITION, + MUS_MIDI_GETFLAG, + MUS_MIDI_SETFLAG, + + MUS_MIXER_GETLEVEL, + MUS_MIXER_SETVOLVAL, + + MUS_BGM_PLAY, + MUS_BGM_STOP, + MUS_BGM_STOPALL, + MUS_BGM_FADE, + MUS_BGM_GETPOS, + MUS_BGM_GETLEN, + MUS_BGM_WAIT, + MUS_BGM_WAITPOS, + + MUS_GET_VALIDSUBSYSTEM, + MUS_EXIT +}; + +/* socket file */ +#define XSYS35MUSSOCK "/xsystem35_sock" + +#define XSYS35_PROTOCOL_VERSION 1 + +typedef struct { + guint16 version; + guint16 command; + guint32 data_length; +} ClientPktHeader; + +typedef struct { + guint16 version; + guint32 data_length; +} ServerPktHeader; + +typedef struct { + ClientPktHeader hdr; + gpointer data; + gint fd; +} PacketNode; + +typedef struct { + boolean cdrom; + boolean midi; + boolean pcm; +} ValidSubsystem; + +/* init and exit */ +extern int mus_init(); +extern int mus_exit(); + +#endif /* __MUSIC_H__ */ diff --git a/src/music_bgm.c b/src/music_bgm.c new file mode 100644 index 0000000..aa4dc3b --- /dev/null +++ b/src/music_bgm.c @@ -0,0 +1,438 @@ +/* + * music_bgm.c: BGMファイル(*BA.ALD)による再生 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_bgm.c,v 1.9 2003/08/30 21:29:16 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "nact.h" +#include "music_bgm.h" +#include "music_server.h" +#include "music_fader.h" +#include "musstream.h" +#include "audio.h" +#include "ald_manager.h" +#include "wavfile.h" +#include "counter.h" +#include "pcmlib.h" + + +/** + * BGI のデータ構造 + * 0xD0, 0xA0 を終端とするデータチャンクの集合で構成 + * + * 最初の11個または12個のチャンクの内容は不明 + * 9個目のチャンクが 0xF2 で始まっていれば 12個、そうでなければ11個。 + * + * その後は1つのチャンク内に曲毎の番号や長さなどが格納 + * 全曲数分あり、曲チャンクの先頭が 0xD7 の場合、終端 + * + * 曲データチャンクは 0xC2 を終端とする複数のフィールドで構成 + * 曲番号 , 0xC2, ループ回数, 0xC2, ループ時先頭戻りアドレス, 0xC2, 曲長さ, + * 0xC2, 不明, 0xD0, 0xA0 + * + * それぞれのフィールドは 上位4ビットを10進数字とみなし、任意桁の数値を + * 構成(0xC2が終端)。下位4ビットは上位4ビットが1-9の時は3、0の時は2である + * (Rance5Dに例外あり) + * + * 曲番号はシナリオ上での番号 + * ループ回数は0の場合は無限 + * ループ時先頭戻りアドレスは、ループする場合に、ここにもどってくる + * ループ時先頭戻りアドレスと曲長さはサンプル数(バイト長さではない) + * + */ + +struct _bgii { + int no; // シナリオ上での番号 + int loopno; // 繰り返し数 + int looptop; // 巻き戻し位置 + int len; // 曲長さ +}; + +struct _bgi { + int nfile; + struct _bgii *i; +}; +typedef struct _bgi bgi_t; + +// 1回の cb で audio buffer の何分の1を処理するか +#define SLICE 4 + +#define SLOTOFFSET 100 +static bgi_t *bgmindex; +static int bgmslot[10]; + +/* + 0xD0, 0xA0 を終端としてデータの塊があるようなので、次の先頭を探す +*/ +static BYTE *findterm(BYTE *b) { + int c1 = *b++, c2 = *b++; + + while (c1 != 0xd0 && c2 != 0xa0) { + c1 = c2; c2 = *b++; + } + + return b; +} + +/* + 0xC2 を終端とするデータフィールドをデコード +*/ +static int decode(BYTE *b, int *len) { + int c, d = 0; + *len = 1; + + while (*b != 0xc2) { + if (*b == 0x90) { b++; (*len)++; } // r5d だけこの処理がいる + c = *b++; c >>= 4; + d = d * 10 + c; + (*len)++; + } + return d; +} + +/** + * BGI ファイルの解析 + */ +static bgi_t *bgi_read() { + FILE *fp; + BYTE *b, *_b, *blast; + long len; + int i, skip, cnt = 0; + bgi_t *bgi; + + if (nact->files.bgi == NULL) return NULL; + + if (NULL == (fp = fopen(nact->files.bgi, "r"))) { + WARNING("%s file read fail\n", nact->files.bgi); + return NULL; + } + + fseek(fp, 0, SEEK_END); + len = ftell(fp); + fseek(fp, 0, SEEK_SET); + _b = b = g_malloc(len); + fread(b, len, 1, fp); + fclose(fp); + + blast = b + len; + + // XXXX (先頭部分は不明) + for (i = 0; i < 8; i++) { + b = findterm(b); + } + if (b[0] == 0xf2) { + skip = 4; + } else { + skip = 3; + } + for (i = 0; i < skip; i++) { + b = findterm(b); + } + + bgi = g_new(bgi_t, 1); + bgi->nfile = 1 + (len - (b - _b)) / 29; // だいたいこれくらい? + bgi->i = g_new(struct _bgii, bgi->nfile); + + while (b < blast) { + int len; + //printf("adr = %x\n", b - _b); + if (*b == 0xd7) break; + bgi->i[cnt].no = decode(b, &len); b += len; + //printf("cnt = %d, no = %d\n", cnt, bgi->i[cnt].no); + + bgi->i[cnt].loopno = decode(b, &len); b += len; + //printf("cnt = %d, loopno = %d\n", cnt, bgi->i[cnt].loopno); + + bgi->i[cnt].looptop = decode(b, &len); b += len; + //printf("cnt = %d, looptop = %d\n", cnt, bgi->i[cnt].looptop); + + bgi->i[cnt].len = decode(b, &len); b += len; + //printf("cnt = %d, len = %d\n", cnt, bgi->i[cnt].len); + cnt++; + + b = findterm(b); + } + + g_free(_b); + return bgi; +} + +static WAVFILE *bgm_load(int no) { + dridata *dfile; + WAVFILE *wfile; + + dfile = ald_getdata(DRIFILE_BGM, no -1); + if (dfile == NULL) { + WARNING("DRIFILE_BGM fail to open %d\n", no -1); + return NULL; + } + + wfile = wav_getinfo(dfile->data); + if (wfile == NULL) { + WARNING("not .wav file\n"); + ald_freedata(dfile); + return NULL; + } + + wfile->dfile = (void *)dfile; + + return wfile; +} + +// とりあえず8曲くらい同時に鳴らせるようにslotを8つ使う (100-107) (^^;;; +static int slt_getnext(int no) { + int i, j = -1; + + for (i = 0; i < 8; i++) { + if (bgmslot[i] == 0) { + bgmslot[i] = no; + return i + SLOTOFFSET; + } else { + if (!prv.pcm[i + SLOTOFFSET]->playing) { + bgmslot[i] = 0; + j = i; + } + } + } + + if (j != -1) { + bgmslot[j] = no; + return j + SLOTOFFSET; + } + + return -1; +} + +// 指定の曲がどのスロットで演奏中かを調べる +static int slt_find(int no) { + int i; + + for (i = 0; i < 8; i++) { + if (bgmslot[i] == no) { + if (!prv.pcm[i + SLOTOFFSET]->playing) { + bgmslot[i] = 0; + continue; + } + return i + SLOTOFFSET; + } + } + return -1; +} + +// シナリオ番号からデータ番号へ +static int senario2file(int no) { + int i; + + for (i = 0; i < bgmindex->nfile; i++) { + if (bgmindex->i[i].no == no) { + return i; + } + } + + return 0; // 適当に +} + +int musbgm_init() { + bgmindex = bgi_read(); + if (bgmindex == NULL) return NG; + return OK; +} + +int musbgm_play(int no, int time, int vol) { + pcmobj_t *obj; + musstream_t *s; + WAVFILE *wfile; + int slot, dno; + + if (bgmindex == NULL) return NG; + + if (no <= 0) return NG; + + if (-1 != slt_find(no)) { + musbgm_stop(no, 0); + } + slot = slt_getnext(no); + dno = senario2file(no); + + wfile = bgm_load(no); + if (wfile == NULL) { + return NG; + } + + obj = g_new0(pcmobj_t, 1); + obj->sdata = (void *)wfile; + obj->stype = OBJSRC_FILE; + if (bgmindex->i[dno].len == 0) { + s = ms_wav2(wfile, wfile->bytes, bgmindex->i[dno].looptop*4); + } else { + s = ms_wav2(wfile, bgmindex->i[dno].len*4, bgmindex->i[dno].looptop*4); + } + obj->src = s; + obj->fmt.rate = wfile->rate; + obj->fmt.bit = wfile->bits; + obj->fmt.ch = wfile->ch; + + obj->data_len = (wfile->bytes * 1000) / (obj->fmt.rate * (obj->fmt.bit/8) * obj->fmt.ch); + + sndcnv_prepare(obj, prv.audiodev.buf.len / SLICE); + + obj->slot = slot; + + prv.pcm[slot] = obj; + prv.vol_pcm_sub[slot] = 0; // volume valancer は channel 0 を使用 + + obj->loop = bgmindex->i[dno].loopno; + obj->cnt = 0; + obj->vollv = 0; + obj->written_len = 0; + obj->playing = TRUE; + + if (-1 == g_list_index(prv.pcmplist, obj)) { + prv.pcmplist = g_list_append(prv.pcmplist, (gpointer)obj); + } + + musfade_new(MIX_PCM, slot, time, vol, 0); + WARNING("no=%d,time=%d,slot=%d\n", no, time, slot); + + return OK; +} + +int musbgm_stop(int no, int time) { + int slot; + + if (bgmindex == NULL) return NG; + + if (no <= 0) return NG; + + slot = slt_find(no); + WARNING("no=%d,time=%d,slot=%d\n", no, time, slot); + if (slot == -1) return OK; + + musfade_new(MIX_PCM, slot, time, 0, 1); + + return OK; +} + +int musbgm_fade(int no, int time, int vol) { + int slot; + if (bgmindex == NULL) return NG; + + if (no <= 0) return NG; + + slot = slt_find(no); + WARNING("no=%d,time=%d,slot=%d\n", no, time, slot); + if (slot == -1) return OK; + + musfade_new(MIX_PCM, slot, time, vol, 0); + + return OK; +} + +int musbgm_getpos(int no) { + int slot; + pcmobj_t *obj; + guint64 len; + + if (bgmindex == NULL) return 0; + + if (no <= 0) return 0; + + slot = slt_find(no); + if (slot == -1) return 0; + + obj = prv.pcm[slot]; + len = obj->src->hidden.mem.cur - obj->src->hidden.mem.base; + + return (int)(((guint64)len * 100) / (obj->fmt.rate * (obj->fmt.bit/8) * obj->fmt.ch)); +} + +int musbgm_getlen(int no) { + int slot; + pcmobj_t *obj; + guint64 len; + int ilen; + + if (bgmindex == NULL) return 0; + + if (no <= 0) return 0; + + slot = slt_find(no); + if (slot == -1) { + WAVFILE *wfile; + // load and get + wfile = bgm_load(no); + len = wfile->bytes; + ilen = (int)(((guint64)len * 100) / (wfile->rate * (wfile->bits/8) * wfile->ch)); + pcmlib_free(wfile); + } else { + obj = prv.pcm[slot]; + len = obj->src->hidden.mem.end - obj->src->hidden.mem.base; + ilen = (int)(((guint64)len * 100) / (obj->fmt.rate * (obj->fmt.bit/8) * obj->fmt.ch)); + } + + return ilen; +} + +int musbgm_isplaying(int no) { + int slot; + + if (bgmindex == NULL) return 0; + + if (no <= 0) return 0; + + slot = slt_find(no); + + if (slot == -1) goto notplaying; + + if (prv.pcm[slot] == NULL) goto notplaying; + if (!prv.pcm[slot]->playing) goto notplaying; + + return 1; + + notplaying: + if (slot != -1) { + bgmslot[slot - SLOTOFFSET] = 0; + } + return 0; +} + +int musbgm_stopall(int time) { + int i, slot; + + if (bgmindex == NULL) return NG; + + for (i = 0; i < 8; i++) { + slot = bgmslot[i]; + if (slot == -1) continue; + musfade_new(MIX_PCM, i + SLOTOFFSET, time, 0, 1); + bgmslot[i] = 0; + } + + return 0; +} diff --git a/src/music_bgm.h b/src/music_bgm.h new file mode 100644 index 0000000..995b45d --- /dev/null +++ b/src/music_bgm.h @@ -0,0 +1,13 @@ +#ifndef __MUSIC_BGM_H__ +#define __MUSIC_BGM_H__ + +extern int musbgm_init(); +extern int musbgm_play(int no, int time, int vol); +extern int musbgm_stop(int no, int time); +extern int musbgm_fade(int no, int time, int vol); +extern int musbgm_getpos(int no); +extern int musbgm_getlen(int no); +extern int musbgm_isplaying(int no); +extern int musbgm_stopall(int time); + +#endif /* __MUSIC_BGM_H__ */ diff --git a/src/music_cdrom.c b/src/music_cdrom.c new file mode 100644 index 0000000..6d9fa56 --- /dev/null +++ b/src/music_cdrom.c @@ -0,0 +1,126 @@ +/* + * music_cdrom.c music server CDROM part + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_cdrom.c,v 1.2 2002/09/01 11:54:51 chikama Exp $ */ + +#include +#include + +#include "portab.h" +#include "music_server.h" +#include "music_cdrom.h" +#include "cdrom.h" + +enum { + CDROM_START, + CDROM_STOPCHECK, + CDROM_LOOPCHECK, + CDROM_STOP, + CDROM_NOP +}; + +int muscd_init() { + int st = cd_init(&prv.cddev); + int ret; + + if (st == -1) { + prv.cd_valid = FALSE; + ret = NG; + } else { + prv.cd_valid = TRUE; + prv.cdrom.dev = &prv.cddev; + prv.cdrom.st = CDROM_NOP; + prv.cdrom.in_play = FALSE; + ret = OK; + } + + return ret; +} + +int muscd_exit() { + if (prv.cd_valid) { + prv.cddev.exit(); + } + return OK; +} + +int muscd_start(int trk, int loop) { + prv.cdrom.track = trk; + prv.cdrom.loop = loop; + prv.cdrom.cnt = 0; + + prv.cdrom.st = CDROM_START; + prv.cdrom.in_play = FALSE; + + memset(&prv.cdrom.time, 0, sizeof(cd_time)); + + return OK; +} + +int muscd_stop() { + prv.cdrom.st = CDROM_STOP; + return OK; +} + +cd_time muscd_getpos() { + cd_time tm; + prv.cddev.getpos(&tm); + return tm; +} + +int muscd_cb() { + cdobj_t *obj = &prv.cdrom; + + switch(obj->st) { + case CDROM_START: + obj->in_play = TRUE; + obj->dev->start(obj->track); + obj->st = CDROM_STOPCHECK; + break; + case CDROM_STOPCHECK: + if (NG == obj->dev->getpos(&(obj->time))) { + obj->st = CDROM_LOOPCHECK; + } + break; + case CDROM_LOOPCHECK: + obj->cnt++; + if (obj->loop == 0) { + obj->st = CDROM_START; + break; + } + if (--obj->loop == 0) { + obj->st = CDROM_STOP; + } else { + obj->st = CDROM_START; + } + break; + case CDROM_STOP: + obj->dev->stop(); + + obj->in_play = FALSE; + obj->st = CDROM_NOP; + break; + case CDROM_NOP: + break; + } + + return OK; +} diff --git a/src/music_cdrom.h b/src/music_cdrom.h new file mode 100644 index 0000000..d617981 --- /dev/null +++ b/src/music_cdrom.h @@ -0,0 +1,52 @@ +/* + * music_cdrom.h music server CDROM part + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_cdrom.h,v 1.1 2002/08/18 09:35:29 chikama Exp $ */ + +#ifndef __MUSIC_CDROM_H__ +#define __MUSIC_CDROM_H__ + +#include "portab.h" +#include "cdrom.h" + +struct _cdobj { + int st; // オブジェクトの遷移状態 + + int track; // 演奏トラック + int loop; // くりかえし数 (0の場合は無限) + int cnt; // 実際に繰り返した数 + + boolean in_play; // 演奏中? + + cd_time time; // 演奏位置 + + cdromdevice_t *dev; +}; +typedef struct _cdobj cdobj_t; + +extern int muscd_init(); +extern int muscd_exit(); +extern int muscd_start(int trk, int loop); +extern int muscd_stop(); +extern cd_time muscd_getpos(); +extern int muscd_cb(); + +#endif /* __MUSIC_CDROM_H__ */ diff --git a/src/music_client.c b/src/music_client.c new file mode 100644 index 0000000..076ae71 --- /dev/null +++ b/src/music_client.c @@ -0,0 +1,1379 @@ +/* + * music_client.c music client 部 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_client.c,v 1.18 2004/10/31 04:18:06 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "music.h" +#include "music_client.h" +#include "counter.h" +#include "pcmlib.h" +#include "nact.h" + +/* それぞれの sub system が使用可能かどうか */ +static boolean cdrom_available; +static boolean midi_available; +static boolean audio_available; + +static int connect_to_server() { + int fd; + struct sockaddr_un saddr; + + saddr.sun_family = AF_UNIX; + strcpy(saddr.sun_path, nact->tmpdir); + strcat(saddr.sun_path, XSYS35MUSSOCK); + if (-1 != (fd = socket(AF_UNIX, SOCK_STREAM, 0))) { + if (-1 != connect(fd, (struct sockaddr *)&saddr, sizeof(saddr))) { + return fd; + } else { + perror("connect"); + } + } else { + perror("socket"); + } + close(fd); + + return -1; +} + +static void *cl_read_packet(int fd, ServerPktHeader *pkt_hdr) { + void *data = NULL; + + if (sizeof(ServerPktHeader) == read(fd, pkt_hdr, sizeof (ServerPktHeader))) { + if (pkt_hdr->data_length) { + data = g_malloc0(pkt_hdr->data_length); + read(fd, data, pkt_hdr->data_length); + } + } + + return data; +} + +static void cl_read_ack(int fd) { + void *data; + ServerPktHeader pkt_hdr; + + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + g_free(data); + } +} + +static void cl_send_packet(int fd, int command, void * data, int data_length) { + ClientPktHeader pkt_hdr; + + pkt_hdr.version = XSYS35_PROTOCOL_VERSION; + pkt_hdr.command = command; + pkt_hdr.data_length = data_length; + + write(fd, &pkt_hdr, sizeof(ClientPktHeader)); + + if (data_length && data) { + write(fd, data, data_length); + } +} + +static void cl_send_guint32(int cmd, guint32 val) { + int fd; + + if (-1 == (fd = connect_to_server())) { + return; + } + + cl_send_packet(fd, cmd, &val, sizeof(guint32)); + cl_read_ack(fd); + close(fd); +} + +static void cl_send_boolean(int cmd, boolean val) { + int fd; + + if (-1 == (fd = connect_to_server())) { + return; + } + + cl_send_packet(fd, cmd, &val, sizeof(boolean)); + cl_read_ack(fd); + close(fd); +} + +static void cl_send_cmd(int cmd) { + int fd; + + if (-1 == (fd = connect_to_server())) { + return; + } + + cl_send_packet(fd, cmd, NULL, 0); + cl_read_ack(fd); + close(fd); +} + +static boolean cl_get_boolean(int cmd) { + ServerPktHeader pkt_hdr; + boolean ret = FALSE; + void *data; + int fd; + + if (-1 == (fd = connect_to_server())) { + return ret; + } + + cl_send_packet(fd, cmd, NULL, 0); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + ret = *((boolean *) data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + return ret; +} + +static int cl_get_guint32(int cmd) { + ServerPktHeader pkt_hdr; + void *data; + int fd, ret = 0; + + if (-1 == (fd = connect_to_server())) { + return ret; + } + + cl_send_packet(fd, cmd, NULL, 0); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + ret = *((int *) data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + return ret; +} + +int musclient_init() { + ServerPktHeader pkt_hdr; + int fd; + void *data; + int i; + + cdrom_available = FALSE; + midi_available = FALSE; + audio_available = FALSE; + + usleep(100*1000); // initial wait + + for (i = 0; i < 10; i++) { // retry 10 times + if (-1 != (fd = connect_to_server())) { + break; + } + usleep(1000*1000); // The cdrom retry takes many clock. + } + + cl_send_packet(fd, MUS_GET_VALIDSUBSYSTEM, NULL, 0); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + cdrom_available = ((ValidSubsystem *)data)->cdrom; + midi_available = ((ValidSubsystem *)data)->midi; + audio_available = ((ValidSubsystem *)data)->pcm; + g_free(data); + } + cl_read_ack(fd); + close(fd); + + return OK; +} + +int musclient_exit() { + cl_send_cmd(MUS_EXIT); + return OK; +} + +/* + * cdrom の演奏開始 + * track: トラック番号 (第一トラックは 1) + * loop : 繰り返し回数 (0の場合は無限) + */ +int mus_cdrom_start(int track, int loop) { + int v[2]; + int fd; + + if (!cdrom_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = track; + v[1] = loop; + cl_send_packet(fd, MUS_CDROM_START, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + + return OK; +} + +/* + * cdrom の演奏停止 + */ +int mus_cdrom_stop() { + if (!cdrom_available) return NG; + + cl_send_cmd(MUS_CDROM_STOP); + return OK; +} + +/* + * cdrom の演奏状態の取得 + * info: 演奏時間(track/min/sec/frame)の状態を格納する場所 + * 停止している場合は 999/999/999/999 が返る + */ +int mus_cdrom_get_playposition(cd_time *tm) { + ServerPktHeader pkt_hdr; + int fd; + void *data; + + if (!cdrom_available) return NG; + + if (-1 == (fd = connect_to_server())) { + tm->t = tm->m = tm->s = tm->f = 999; + puts("fail to connect"); + return NG; + } + + cl_send_packet(fd, MUS_CDROM_GETPOSITION, NULL, 0); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + *tm = *((cd_time *)data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + return OK; +} + +/* + * cdrom の最大トラック数の取得 + * + */ +int mus_cdrom_get_maxtrack() { + int trk; + + if (!cdrom_available) return 0; + + trk = cl_get_guint32(MUS_CDROM_GETMAXTRACK); + + return trk; +} + +/* + * CDROM の有効/無効 フラグの取得 + * return: FALASE -> 無効 + * TRUE -> 有効 + */ +boolean mus_cdrom_get_state() { + return cdrom_available; +} + +/* + * midi の演奏開始 + * no : ファイル番号( no >= 1) + * loop: 繰り返し回数 (0の場合は無限) + */ +int mus_midi_start(int no, int loop) { + int v[2]; + int fd; + + if (!midi_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = no; + v[1] = loop; + cl_send_packet(fd, MUS_MIDI_START, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +/* + * midi の演奏停止 + */ +int mus_midi_stop(void) { + if (!midi_available) return NG; + + cl_send_cmd(MUS_MIDI_STOP); + return OK; +} + +/* + * midi の一時停止 + */ +int mus_midi_pause(void) { + if (!midi_available) return NG; + + cl_send_cmd(MUS_MIDI_PAUSE); + return OK; +} + +/* + * midi の一時停止解除 + */ +int mus_midi_unpause(void) { + if (!midi_available) return NG; + + cl_send_cmd(MUS_MIDI_UNPAUSE); + return OK; +} + +/* + * midi の演奏状態の取得 + * state: 演奏時間や番号の状態を格納する場所 + * 停止している場合は 0 が入る + */ +int mus_midi_get_playposition(midiplaystate *state) { + ServerPktHeader pkt_hdr; + int fd; + void *data; + + if (!midi_available) return NG; + + if (-1 == (fd = connect_to_server())) { + state->loc_ms = state->play_no = 0; + puts("fail to connect"); + return NG; + } + + cl_send_packet(fd, MUS_MIDI_GETPOSITION, NULL, 0); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + *state = *(midiplaystate *)data; + g_free(data); + } + cl_read_ack(fd); + close(fd); + return OK; +} + +/* + * midi の演奏 flag/variable の状態を設定する + * mode : 0 -> flag mode + * 1 -> variable mode + * index: flag/variable 番号 + * val : 書き込む値 + */ +int mus_midi_set_flag(int mode, int index, int val) { + int v[3]; + int fd; + + if (!midi_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = mode; + v[1] = index; + v[2] = val; + cl_send_packet(fd, MUS_MIDI_SETFLAG, v, 3 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +/* + * midi の演奏 flag/variable の状態を取得する + * mode : 0 -> flag mode + * 1 -> variable mode + * index: flag/variable 番号 + * + * return : flag/variable の値 + */ +int mus_midi_get_flag(int mode, int index) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd, val = 0; + void *data; + + if (!midi_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = mode; + v[1] = index; + cl_send_packet(fd, MUS_MIDI_GETFLAG, v, 2 * sizeof(int)); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + val = *((int *)data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + return val; +} + +/* + * MIDI の有効/無効 フラグの取得 + * return: FALASE -> 無効 + * TRUE -> 有効 + */ +boolean mus_midi_get_state() { + return midi_available; +} + +/* + * WAV の演奏開始 (command S?) + * no : ファイル番号( no >= 1) + * loop: 繰り返し回数 (0の場合は無限) + */ +int mus_pcm_start(int no, int loop) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + /* load file */ + v[0] = 0; + v[1] = no; + cl_send_packet(fd, MUS_PCM_LOAD_NO, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + /* play start */ + v[0] = 0; + v[1] = loop; + cl_send_packet(fd, MUS_PCM_START, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + + return OK; +} + +/* + * WAV を左右 mix して演奏 + * noL : 左用のファイル番号(noL >= 1) + * noR : 右用のファイル番号(noR >= 1) + * loop: 繰り返し数(0の場合は無限ループ) + */ +int mus_pcm_mix(int noL, int noR, int loop) { + int v[2]; + int fd, len; + WAVFILE *wfile; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + /* mix 2 wave files */ + wfile = pcmlib_mixlr(noL, noR); + if (wfile == NULL) { + puts("mixlr fail"); + return NG; + } + + /* load from mem */ + { + ClientPktHeader pkt_hdr; + len = sizeof(WAVFILE) + wfile->bytes; + + v[0] = 0; + pkt_hdr.version = XSYS35_PROTOCOL_VERSION; + pkt_hdr.command = MUS_PCM_LOAD_MEM; + pkt_hdr.data_length = sizeof(int) + len; + + write(fd, &pkt_hdr, sizeof(ClientPktHeader)); + write(fd, v, sizeof(int)); + write(fd, wfile, sizeof(WAVFILE)); + write(fd, wfile->data, wfile->bytes); + } + cl_read_ack(fd); + close(fd); + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + /* play start */ + v[0] = 0; + v[1] = loop; + cl_send_packet(fd, MUS_PCM_START, v, 2 * sizeof(int)); + cl_read_ack(fd); + + close(fd); + + pcmlib_free(wfile); + + return OK; +} + +/* + * WAV の演奏停止 (command S?) + * msec: 止まるまでの時間(msec), 0の場合はすぐに止まる + */ +int mus_pcm_stop(int msec) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = 0; + v[1] = msec; + cl_send_packet(fd, MUS_PCM_STOP, v, 2 * sizeof(int)); + cl_read_ack(fd); + + close(fd); + + return OK; +} + +/* + * WAV ファイルをメモリ上に載せる + * no : ファイル番号( no >= 1) + */ +int mus_pcm_load(int no) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + /* load file */ + v[0] = 0; + v[1] = no; + cl_send_packet(fd, MUS_PCM_LOAD_NO, v, 2 * sizeof(int)); + cl_read_ack(fd); + + close(fd); + + return OK; +} + +/* + * WAV の演奏状態の取得 + * pos: 演奏時間を格納する場所(msec) + * 停止している場合は 0 が入る + * loopしている場合は合計時間 + */ +int mus_pcm_get_playposition(int *pos) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd; + void *data; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return 0; + } + + v[0] = 0; + cl_send_packet(fd, MUS_PCM_GETPOSITION, v, sizeof(int)); + + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + *pos = *(int *)(data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + return OK; +} + + +/* + * フェード開始 + * device: フェードするデバイス(MIX_MAXTER/MIX_PCM/....) + * time : 最終ボリュームまでに達する時間(msec) + * volume: 最終ボリューム + * stop: フェード終了時に演奏をストップするかどうか? + * 0: しない + * 1: する + */ +int mus_mixer_fadeout_start(int device, int time, int volume, int stop) { + int v[5]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = device; + v[1] = 0; + v[2] = time; + v[3] = volume; + v[4] = stop; + cl_send_packet(fd, MUS_FADE_START, v, 5 * sizeof(int)); + cl_read_ack(fd); + + close(fd); + + return OK; +} + +/* + * 指定のデバイスが現在フェード中かどうかを調べる + * device: 指定デバイス + * + * return: TRUE -> フェード中 + * FALSE -> フェード中でない + */ +boolean mus_mixer_fadeout_get_state(int device) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd; + boolean bool = FALSE; + void *data; + + if (!audio_available) return FALSE; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return FALSE; + } + + v[0] = device; + v[1] = 0; + cl_send_packet(fd, MUS_FADE_GETSTATE, v, 2 * sizeof(int)); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + bool = *((boolean *)data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + return bool; +} + +/* + * 指定のデバイスのフェードを途中で止める + * device: 指定デバイス + */ +int mus_mixer_fadeout_stop(int device) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = device; + v[1] = 0; + cl_send_packet(fd, MUS_FADE_STOP, v, 2 * sizeof(int)); + cl_read_ack(fd); + + close(fd); + + return OK; +} + +/* + * 指定のデバイスのミキサーレベルを取得する + * device: 指定デバイス + * + * return: ミキサーレベル(0 - 100) (ゲーム内で設定された値) + */ +int mus_mixer_get_level(int device) { + ServerPktHeader pkt_hdr; + int v, lv = 0; + void *data; + int fd; + + if (!audio_available) return 0; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return 0; + } + + v = device; + cl_send_packet(fd, MUS_MIXER_GETLEVEL, &v, sizeof(int)); + + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + lv = *((int *)data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + return lv; +} + +/* + * 指定のフォーマットで再生可能かどうか調べる + * bit : 8 or 16 bit + * rate: frequency + * ch : Mono or Stereo + * able: 可能かどうかの状態を受け取る場所 + */ +int mus_pcm_check_ability(int bit, int rate, int ch, boolean *able) { + if (!audio_available) { + printf("not available\n"); + *able = FALSE; + return NG; + } + + *able = TRUE; + return OK; +} + +/* + * 指定のチャンネルに wave file をロード + * ch : channel (0-127) + * num: ファイル番号 (1-65535) + */ +int mus_wav_load(int ch, int num) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + /* load file */ + v[0] = ch + 1; + v[1] = num; + cl_send_packet(fd, MUS_PCM_LOAD_NO, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +/* + * 指定のチャンネルから wave file を破棄 + * ch : channel + */ +int mus_wav_unload(int ch) { + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + cl_send_guint32(MUS_PCM_UNLOAD, (guint32)(ch + 1)); + return OK; +} + +/* + * WAV の演奏開始 (wavXXXX) + * ch : 再生するチャンネル (0-127) + (あらかじめ mus_wav_loadでloadしておく) + * loop: 繰り返し回数 (0の場合は無限, それ以外は1回のみ) + */ +int mus_wav_play(int ch, int loop) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = ch + 1; + v[1] = loop; + cl_send_packet(fd, MUS_PCM_START, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +/* + * 指定のチャンネルのWAVの演奏停止 (wavXXX) + * ch: channel + */ +int mus_wav_stop(int ch) { + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + cl_send_guint32(MUS_PCM_STOP, (guint32)(ch +1)); + return OK; +} + +/* + * 指定のチャンネルの演奏状態の取得 + * ch: channel (0-127) + * + * return: 演奏時間(msec) 65535ms で飽和 + */ +int mus_wav_get_playposition(int ch) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd; + void *data; + int ret = 0; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return 0; + } + + v[0] = ch + 1; + cl_send_packet(fd, MUS_PCM_GETPOSITION, v, sizeof(int)); + + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + ret = *(int *)(data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + if (ret > 65565) ret = 65535; + + return ret; +} + + +/* + * 指定のチャンネルのWAVのフェード + * ch: channel(0-127) + * time : 最終ボリュームまでに達する時間(msec) + * volume: 最終ボリューム + * stop : フェード終了時に演奏をストップするかどうか? + * 0: しない + * 1: する + */ +int mus_wav_fadeout_start(int ch, int time, int volume, int stop) { + int v[5]; + int fd; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = MIX_PCM; + v[1] = ch + 1; + v[2] = time; + v[3] = volume; + v[4] = stop; + cl_send_packet(fd, MUS_FADE_START, v, 5 * sizeof(int)); + cl_read_ack(fd); + + close(fd); + + return OK; +} + +/* + * 指定のチャンネルのフェードを途中で止める + * ch: channel (0-127) + */ +int mus_wav_fadeout_stop(int ch) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = MIX_PCM; + v[1] = ch + 1; + cl_send_packet(fd, MUS_FADE_STOP, v, 2 * sizeof(int)); + cl_read_ack(fd); + + close(fd); + + return OK; +} + +/* + * 指定のチャンネルが現在フェード中かどうかを調べる + * ch: channel + * + * return: TRUE -> フェード中 + * FALSE -> フェード中でない + */ +boolean mus_wav_fadeout_get_state(int ch) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd; + boolean bool = FALSE; + void *data; + + if (!audio_available) return FALSE; + + if (ch < 0 || ch > 128) return FALSE; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return FALSE; + } + + v[0] = MIX_PCM; + v[1] = ch + 1; + cl_send_packet(fd, MUS_FADE_GETSTATE, v, 2 * sizeof(int)); + data = cl_read_packet(fd, &pkt_hdr); + + if (data) { + bool = *((boolean *)data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + return bool; +} + + +/* + * 指定のチャンネルの再生が終了するまで待つ + * ch: channel (0-127) + */ +int mus_wav_waitend(int ch) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = ch + 1; + cl_send_packet(fd, MUS_PCM_WAITEND, v, sizeof(int)); + cl_read_ack(fd); + close(fd); + + return OK; +} + +/* + * 指定のチャンネルで時間待ち + * 再生していないならすぐに戻る。コマンドが発行された瞬間に演奏中で + * あれば、演奏が終っても指定時間経過するまで待つ。 + * ch : channel (0-127) + * time: 待ち時間(msec) + */ +int mus_wav_waittime(int ch, int time) { + ServerPktHeader pkt_hdr; + int v[1]; + int fd; + void *data; + int cnt, ret = 0; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + cnt = get_high_counter(SYSTEMCOUNTER_MSEC); + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = ch + 1; + cl_send_packet(fd, MUS_PCM_GETPOSITION, v, sizeof(int)); + + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + ret = *(int *)(data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + if (ret != 0) { + int cntn = get_high_counter(SYSTEMCOUNTER_MSEC); + int sleeptime = time - (cntn - cnt); + if (sleeptime > 0) { + usleep(sleeptime * 1000); + } + } + return OK; +} + +/* + * PCM の有効/無効 フラグの取得 + * return: FALASE -> 無効 + * TRUE -> 有効 + */ +boolean mus_pcm_get_state() { + return audio_available; +} + +/* + * 指定のチャンネルのWAVデータの演奏時間の取得 + * ch: channel + * + * return: 時間(msec) 65535ms で飽和 + */ +int mus_wav_wavtime(int ch) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd; + int ret = 0; + void *data; + + if (!audio_available) return 0; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return FALSE; + } + + v[0] = ch + 1; + cl_send_packet(fd, MUS_PCM_GETWAVETIME, v, sizeof(int)); + data = cl_read_packet(fd, &pkt_hdr); + + if (data) { + ret = *((boolean *)data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + if (ret > 65565) ret = 65535; + return ret; + +} + +/* + * 指定の channel に WAVFILE をセット + * ch: channel + * wfile: WAVFILE + */ +int mus_wav_sendfile(int ch, WAVFILE *wfile) { + int v[2]; + int fd, len; + ClientPktHeader pkt_hdr; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + len = sizeof(WAVFILE) + wfile->bytes; + + v[0] = ch + 1; + pkt_hdr.version = XSYS35_PROTOCOL_VERSION; + pkt_hdr.command = MUS_PCM_LOAD_MEM; + pkt_hdr.data_length = sizeof(int) + len; + + write(fd, &pkt_hdr, sizeof(ClientPktHeader)); + write(fd, v, sizeof(int)); + write(fd, wfile, sizeof(WAVFILE)); + write(fd, wfile->data, wfile->bytes); + + cl_read_ack(fd); + close(fd); + return OK; +} + +/* + * 指定のチャンネルに wave file をLR反転してロード + * ch : channel (0-127) + * num: ファイル番号 (1-65535) + */ +int mus_wav_load_lrsw(int ch, int num) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (ch < 0 || ch > 128) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + /* load file */ + v[0] = ch + 1; + v[1] = num; + cl_send_packet(fd, MUS_PCM_LOAD_LRSW, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +int mus_bgm_play(int no, int time, int vol) { + int v[3]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = no; + v[1] = time; + v[2] = vol; + cl_send_packet(fd, MUS_BGM_PLAY, v, 3 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +int mus_bgm_stop(int no, int time) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = no; + v[1] = time * 10; + cl_send_packet(fd, MUS_BGM_STOP, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +int mus_bgm_fade(int no, int time, int vol) { + int v[3]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = no; + v[1] = time * 10; + v[2] = vol; + cl_send_packet(fd, MUS_BGM_FADE, v, 3 * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} + +int mus_bgm_getpos(int no) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd; + void *data; + int ret = 0; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return 0; + } + + v[0] = no; + cl_send_packet(fd, MUS_BGM_GETPOS, v, sizeof(int)); + + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + ret = *(int *)(data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + if (ret > 65565) ret = 65535; + + return ret; +} + +int mus_bgm_wait(int no, int timeout) { + ServerPktHeader pkt_hdr; + int v[2], ret = 0; + int fd, curtime, maxtime; + void *data; + + if (!audio_available) return NG; + + curtime = get_high_counter(SYSTEMCOUNTER_MSEC); + maxtime = curtime + timeout * 10; + + while (curtime < maxtime) { + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + break; + } + v[0] = no; + cl_send_packet(fd, MUS_BGM_GETPOS, v, sizeof(int)); + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + ret = *(int *)(data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + if (ret == 0) break; + usleep(10*1000); + curtime = get_high_counter(SYSTEMCOUNTER_MSEC); + } + + return OK; +} + +int mus_bgm_waitpos(int no, int index) { + int v[2]; + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + v[0] = no; + v[1] = index; + cl_send_packet(fd, MUS_BGM_WAITPOS, v, 2 * sizeof(int)); + cl_read_ack(fd); + close(fd); + + return OK; +} + +int mus_bgm_stopall(int time) { + if (!audio_available) return NG; + + cl_send_guint32(MUS_BGM_STOPALL, (guint32)time * 10); + return OK; +} + +int mus_bgm_getlength(int no) { + ServerPktHeader pkt_hdr; + int v[2]; + int fd; + void *data; + int ret = 0; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return 0; + } + + v[0] = no; + cl_send_packet(fd, MUS_BGM_GETLEN, v, sizeof(int)); + + data = cl_read_packet(fd, &pkt_hdr); + if (data) { + ret = *(int *)(data); + g_free(data); + } + cl_read_ack(fd); + close(fd); + + if (ret > 65565) ret = 65535; + + return ret; +} + +int mus_vol_set_valance(int *vols, int num) { + int fd; + + if (!audio_available) return NG; + + if (-1 == (fd = connect_to_server())) { + puts("fail to connect"); + return NG; + } + + cl_send_packet(fd, MUS_MIXER_SETVOLVAL, vols, num * sizeof(int)); + cl_read_ack(fd); + close(fd); + return OK; +} diff --git a/src/music_client.h b/src/music_client.h new file mode 100644 index 0000000..55c12e2 --- /dev/null +++ b/src/music_client.h @@ -0,0 +1,97 @@ +/* + * music_client.h music client 部分 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_client.h,v 1.7 2003/11/16 15:29:52 chikama Exp $ */ + +#ifndef __MUSIC_CLIENT_H__ +#define __MUSIC_CLIENT_H__ + +#include "portab.h" +#include "cdrom.h" +#include "midi.h" +#include "audio.h" +#include "wavfile.h" + +extern int musclient_init(); +extern int musclient_exit(void); + +/* cdrom related function */ +extern int mus_cdrom_start(int track, int loop); +extern int mus_cdrom_stop(void); +extern int mus_cdrom_get_playposition(cd_time *tm); +extern int mus_cdrom_get_maxtrack(void); +extern boolean mus_cdrom_get_state(void); + +/* midi related function */ +extern int mus_midi_start(int no, int loop); +extern int mus_midi_stop(void); +extern int mus_midi_pause(void); +extern int mus_midi_unpause(void); +extern int mus_midi_get_playposition(midiplaystate *state); +extern int mus_midi_set_flag(int mode, int index, int val); +extern int mus_midi_get_flag(int mode, int index); +extern boolean mus_midi_get_state(void); + +/* pcm (Scommand) related function */ +extern int mus_pcm_start(int no, int loop); +extern int mus_pcm_mix(int noL, int noR, int loop); +extern int mus_pcm_stop(int msec); +extern int mus_pcm_load(int no); +extern int mus_pcm_get_playposition(int *pos); +extern int mus_pcm_check_ability(int bit, int rate, int ch, boolean *able); +extern boolean mus_pcm_get_state(void); + +/* fader/mixer related function */ +extern int mus_mixer_fadeout_start(int device, int time, int volume, int stop); +extern boolean mus_mixer_fadeout_get_state(int device); +extern int mus_mixer_fadeout_stop(int device); +extern int mus_mixer_get_level(int device); + +/* wav (command2F) related function */ +extern int mus_wav_load(int ch, int num); +extern int mus_wav_unload(int ch); +extern int mus_wav_play(int ch, int loop); +extern int mus_wav_stop(int ch); +extern int mus_wav_get_playposition(int ch); +extern int mus_wav_fadeout_start(int ch, int time, int volume, int stop); +extern int mus_wav_fadeout_stop(int ch); +extern boolean mus_wav_fadeout_get_state(int ch); +extern int mus_wav_waitend(int ch); +extern int mus_wav_waittime(int ch, int time); +extern int mus_wav_wavtime(int ch); +extern int mus_wav_sendfile(int ch, WAVFILE *wfile); +extern int mus_wav_load_lrsw(int ch, int num); + +/* Music Stream */ +extern int mus_bgm_play(int no, int time, int vol); +extern int mus_bgm_stop(int no, int time); +extern int mus_bgm_stopall(int time); +extern int mus_bgm_fade(int no, int time, int vol); +extern int mus_bgm_getpos(int no); +extern int mus_bgm_getlen(int no); +extern int mus_bgm_wait(int no, int timeout); +extern int mus_bgm_waitpos(int no, int index); +extern int mus_bgm_getlength(int no); + +/* volume valaner */ +extern int mus_vol_set_valance(int *vols, int num); + +#endif /* MUSIC_CLIENT_H__ */ diff --git a/src/music_ctrlsocket.c b/src/music_ctrlsocket.c new file mode 100644 index 0000000..97270c7 --- /dev/null +++ b/src/music_ctrlsocket.c @@ -0,0 +1,61 @@ +/* + * music_ctlsocket.c music server socket control funciton + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_ctrlsocket.c,v 1.1 2002/08/18 09:35:29 chikama Exp $ */ + +#include +#include + +static void ctrl_write_packet(gint fd, gpointer data, gint length) { + ServerPktHeader pkthdr; + + pkthdr.version = XSYS35_PROTOCOL_VERSION; + pkthdr.data_length = length; + write(fd, &pkthdr, sizeof (ServerPktHeader)); + if (data && length > 0) { + write(fd, data, length); + } +} + +static void ctrl_write_gint(gint fd, gint val) { + ctrl_write_packet(fd, &val, sizeof (gint)); +} + +static void ctrl_write_gfloat(gint fd, gfloat val) { + ctrl_write_packet(fd, &val, sizeof (gfloat)); +} + +static void ctrl_write_gboolean(gint fd, gboolean bool) { + ctrl_write_packet(fd, &bool, sizeof (gboolean)); +} + +static void ctrl_write_string(gint fd, gchar * string) { + ctrl_write_packet(fd, string, string ? strlen(string) + 1 : 0); +} + +static void ctrl_ack_packet(PacketNode * pkt) { + ctrl_write_packet(pkt->fd, NULL, 0); + close(pkt->fd); + if (pkt->data) { + g_free(pkt->data); + } + g_free(pkt); +} diff --git a/src/music_fader.c b/src/music_fader.c new file mode 100644 index 0000000..cc023a8 --- /dev/null +++ b/src/music_fader.c @@ -0,0 +1,373 @@ +/* + * music_fader.c music server fader part + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_fader.c,v 1.5 2003/07/14 16:22:51 chikama Exp $ */ + +#include +#include + +#include "portab.h" +#include "system.h" +#include "music_server.h" +#include "counter.h" + +struct _fadeobj { + /* フェード volume を設定する callback */ + int (*setvol)(int mdev, int subdev, int vol); + + /* フェード終了時に演奏を終了させる callback */ + // int (*stop_playback)(); + + /* mixer main device type */ + int mdev; + + /* mixer subdevice number */ + int subdev; /* 1-128 */ + + /* start / end / current / previous volume */ + int st_vol, ed_vol, cur_vol, pre_vol; + + /* start / end / current time in 10 msec */ + long st_time, ed_time, cur_time; + + /* 終了時に cd/midi/pcm を止めるかどうか */ + boolean stop_at_end; +}; +typedef struct _fadeobj fadeobj_t; + +static int musfade_free(fadeobj_t *obj); +static int musfade_setvol(int dev, int lv); +static int musfade_setvol_dev(int dev, int subdev, int lv); +static int musfade_stop_playback(int dev, int subdev); +static void fade_calc_time(fadeobj_t *obj); +static int setvolcd(int lv); +static int setvolmidi(int lv); + +int musfade_init() { + int i; + + if (prv.cddev.setvol == NULL) { + prv.cddev.setvol = setvolcd; + } + if (prv.mididev.setvol == NULL) { + prv.mididev.setvol = setvolmidi; + } + + // init counter for fader + reset_counter_high(SYSTEMCOUNTER_FADE, 10, 0); + + // init workarea volume + prv.vol_cd = 100; + prv.vol_midi = 100; + prv.vol_pcm = 100; + prv.vol_master = 100; + + for (i = 0; i < 16; i++) { + prv.volval[i] = 100; + } + return OK; +} + +int musfade_exit() { + return OK; +} + +static int setvolcd(int lv) { + prv.audiodev.mix_set(&prv.audiodev, MIX_CD, lv); + return OK; +} + +static int setvolmidi(int lv) { + prv.audiodev.mix_set(&prv.audiodev, MIX_MIDI, lv); + return OK; +} + +/* + * 新しいフェード用オブジェクトの作成 + * dev : 対象ミキサー device (MASTER/CD/MIDI/PCM) + * subdev : PCM device の場合、subdevice 番号 (0-130) + * time : フェード終了時間 + * ed_vol : フェード最終ボリューム + * stop : フェード終了時に再生を終了するかどうか (1:止める, 0:止めない) + */ +int musfade_new(int dev, int subdev, int time, int ed_vol, int stop) { + fadeobj_t *obj = g_new0(fadeobj_t, 1); + + // printf("fade new %d, %d, %d, %d, %d\n", dev, subdev, time, vol, stop); + + obj->mdev = dev; + obj->subdev = subdev; + + obj->st_time = get_high_counter(SYSTEMCOUNTER_FADE); + obj->ed_time = obj->st_time + time / 10; /* fade counter は 10msec */ + + obj->ed_vol = ed_vol; + obj->stop_at_end = (stop == 1 ? TRUE : FALSE); + + // if subdev == 0 then set real mixer deive + if (subdev == 0) { + // set volumeset function + obj->setvol = musfade_setvol_dev; + + // set start volume + switch(dev) { + case MIX_CD: + obj->st_vol = prv.vol_cd; + break; + case MIX_MIDI: + obj->st_vol = prv.vol_midi; + break; + case MIX_PCM: + obj->st_vol = prv.vol_pcm; + } + } else { + // set volumeset function + obj->setvol = muspcm_setvol; + + // set start volume + if (prv.pcm[subdev] == NULL) { + // null になるってことは startしていない pcm を stop + // しようとしているんだけど、もっと前で弾くべきか? + obj->st_vol = -1; + } else { + obj->st_vol = prv.pcm[subdev]->vollv; + } + } + + prv.fadelist = g_list_append(prv.fadelist, obj); + + return OK; +} + +/* + 指定のフェードオブジェクトを削除 + obj: 消すオブジェクト +*/ +static int musfade_free(fadeobj_t *obj) { + prv.fadelist = g_list_remove(prv.fadelist, (gpointer)obj); + g_free(obj); + return OK; +} + +/* + フェード停止 + dev: main device + subdev: sub device +*/ +int musfade_stop(int dev, int subdev) { + GList *node; + fadeobj_t *obj; + + for (node = prv.fadelist; node; node = g_list_next(node)) { + obj = (fadeobj_t *)node->data; + if (obj == NULL) continue; + + if (obj->mdev == dev && + obj->subdev == subdev) { + musfade_free(obj); + break; + } + } + return OK; +} + +/* + フェード中かどうか + dev: main device + subdev: sub device + + ret: TRUE or FALSE +*/ +boolean musfade_getstate(int dev, int subdev) { + GList *node; + fadeobj_t *obj; + + for (node = prv.fadelist; node; node = g_list_next(node)) { + obj = (fadeobj_t *)node->data; + if (obj == NULL) continue; + + if (obj->mdev == dev && + obj->subdev == subdev) { + return TRUE; + } + } + + return FALSE; +} + +/* + 指定のデバイスのゲーム内でのボリュームの取得 + dev: 取得するデバイス +*/ +int musfade_getvol(int dev) { + switch(dev) { + case MIX_MASTER: + return prv.vol_master; + case MIX_PCM: + return prv.vol_pcm; + case MIX_MIDI: + return prv.vol_midi; + case MIX_CD: + return prv.vol_cd; + default: + return 0; + } +} + +/* + 指定のデバイスのゲーム内でのボリュームの設定 + dev: 設定するデバイス + val: 設定する値 +*/ +static int musfade_setvol(int dev, int lv) { + switch(dev) { + case MIX_MASTER: + prv.vol_master = lv; + break; + + case MIX_PCM: + prv.vol_pcm = lv; + break; + + case MIX_MIDI: + prv.vol_midi = lv; + break; + + case MIX_CD: + prv.vol_cd = lv; + break; + + default: + break; + } + return OK; +} + +static int musfade_setvol_dev(int dev, int subdev, int lv) { + switch(dev) { + case MIX_MASTER: + case MIX_PCM: + prv.audiodev.mix_set(&prv.audiodev, dev, lv); + break; + case MIX_CD: + prv.cddev.setvol(lv); + break; + case MIX_MIDI: + prv.mididev.setvol(lv); + break; + default: + break; + } + + return OK; +} + +static int musfade_stop_playback(int dev, int subdev) { + switch(dev) { + case MIX_CD: + muscd_stop(); + break; + case MIX_MIDI: + musmidi_stop(); + break; + case MIX_PCM: + muspcm_stop(subdev); + break; + default: + break; + } + return OK; +} + +static void fade_calc_time(fadeobj_t *obj) { + /* 現在の時刻を取得 */ + // usleep(1); + obj->cur_time = get_high_counter(SYSTEMCOUNTER_FADE); + + obj->pre_vol = obj->cur_vol; + + /* 終了時刻が過ぎていたら最終ボリュームへ */ + if (obj->cur_time > obj->ed_time) { + obj->cur_vol = obj->ed_vol; + goto out; + } + + /* フェード時間が0の場合も最終ボリュームへ */ + if (obj->ed_time == obj->st_time) { + obj->cur_vol = obj->ed_vol; + goto out; + } + + /* 線形でボリューム制御 */ + obj->cur_vol = ((obj->ed_vol - obj->st_vol) * (obj->cur_time - obj->st_time) / ( obj->ed_time - obj->st_time)) + obj->st_vol; + + out: + /* prv. 領域へ反映 */ + if (obj->subdev == 0) { + musfade_setvol(obj->mdev, obj->cur_vol); + } +} + +int musfade_cb() { + fadeobj_t *obj; + GList *node; + + for (node = prv.fadelist; node; node = g_list_next(node)) { + obj = (fadeobj_t *)node->data; + if (obj == NULL) continue; + + // ed_vol = -1 : すぐに終了 + if (obj->ed_vol == -1) { + musfade_stop_playback(obj->mdev, obj->subdev); + musfade_free(obj); + continue; + } + + // フェード時間計算 + fade_calc_time(obj); + + if (obj->cur_vol != obj->pre_vol) { + // set 内では現在の volume の obj->cur_vol % で出力 + obj->setvol(obj->mdev, obj->subdev, obj->cur_vol); + } + + if (obj->cur_vol == obj->ed_vol) { + if (obj->stop_at_end) { + // stop + musfade_stop_playback(obj->mdev, obj->subdev); + } + // remove fadeobj + musfade_free(obj); + } + } + + return OK; +} + +int musfade_setvolval(int *valance, int num) { + int i; + + for (i = 0; i < MIN(num, 16); i++) { + prv.volval[i] = valance[i]; + } + + return OK; +} diff --git a/src/music_fader.h b/src/music_fader.h new file mode 100644 index 0000000..056e5a6 --- /dev/null +++ b/src/music_fader.h @@ -0,0 +1,39 @@ +/* + * music_fader.h music server fader part + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_fader.h,v 1.3 2003/04/25 17:23:55 chikama Exp $ */ + +#ifndef __MUSIC_FADER_H__ +#define __MUSIC_FADER_H__ + +#include "portab.h" + +extern int musfade_init(); +extern int musfade_exit(); +extern int musfade_new(int dev, int subdev, int time, int ed_vol, int stop); +extern int musfade_stop(int dev, int subdev); +extern boolean musfade_getstate(int dev, int subdev); +extern int musfade_getvol(int dev); +extern int musfade_cb(); +extern int musfade_setvolval(int *valance, int num); + + +#endif /* __MUSIC_FADER_H__ */ diff --git a/src/music_midi.c b/src/music_midi.c new file mode 100644 index 0000000..e1b5117 --- /dev/null +++ b/src/music_midi.c @@ -0,0 +1,170 @@ +/* + * music_midi.c music server MIDI part + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_midi.c,v 1.2 2002/08/29 12:41:39 chikama Exp $ */ + +#include + +#include "portab.h" +#include "music_server.h" +#include "music_midi.h" +#include "midi.h" +#include "ald_manager.h" + +enum { + MIDI_START, + MIDI_STOPCHECK, + MIDI_LOOPCHECK, + MIDI_STOP, + MIDI_PAUSE, + MIDI_UNPAUSE, + MIDI_NOP +}; + +int musmidi_init() { + int st = midi_init(&prv.mididev); + + if (st == -1) { + prv.midi_valid = FALSE; + return NG; + } else { + prv.midi_valid = TRUE; + prv.midi.dev = &prv.mididev; + prv.midi.st = MIDI_NOP; + return OK; + } +} + +int musmidi_exit() { + if (prv.midi_valid) { + prv.mididev.exit(); + } + return OK; +} + +int musmidi_start(int no, int loop) { + dridata *dfile; + + dfile = ald_getdata(DRIFILE_MIDI, no -1); + if (dfile == NULL) { + prv.midi.dfile = NULL; + return NG; + } + + prv.midi.no = no; + prv.midi.loop = loop; + prv.midi.cnt = 0; + + prv.midi.st = MIDI_START; + prv.midi.in_play = FALSE; + + prv.midi.dfile = dfile; + + return OK; +} + +int musmidi_stop() { + prv.midi.st = MIDI_STOP; + return OK; +} + +int musmidi_pause() { + prv.midi.st = MIDI_PAUSE; + return OK; +} + +int musmidi_unpause() { + prv.midi.st = MIDI_UNPAUSE; + return OK; +} + +midiplaystate musmidi_getpos() { + midiplaystate st; + prv.midi.dev->getpos(&st); + return st; +} + +int musmidi_setflag(int mode, int index, int val) { + prv.midi.dev->setflag(mode, index, val); + return OK; +} + +int musmidi_getflag(int mode, int index) { + return prv.midi.dev->getflag(mode, index); +} + +int musmidi_cb() { + midiobj_t *obj = &prv.midi; + + switch(obj->st) { + case MIDI_START: + obj->in_play = TRUE; + obj->dev->start(obj->no, obj->dfile->data, obj->dfile->size); + obj->st = MIDI_STOPCHECK; + break; + + case MIDI_STOPCHECK: { + midiplaystate st; + if (NG == obj->dev->getpos(&st)) { + obj->st = MIDI_LOOPCHECK; + } + break; + } + case MIDI_LOOPCHECK: + obj->cnt++; + if (obj->loop == 0) { + // infinity loop + obj->st = MIDI_START; + break; + } + if (--obj->loop == 0) { + obj->st = MIDI_STOP; + } else { + obj->st = MIDI_START; + } + break; + + case MIDI_STOP: + obj->dev->stop(); + obj->in_play = FALSE; + obj->st = MIDI_NOP; + if (obj->dfile) { + ald_freedata(obj->dfile); + obj->dfile = NULL; + } + break; + + case MIDI_PAUSE: + obj->dev->pause(); + obj->st = MIDI_NOP; + break; + + case MIDI_UNPAUSE: + obj->dev->unpause(); + obj->st = MIDI_STOPCHECK; + break; + + case MIDI_NOP: + break; + } + + return OK; +} diff --git a/src/music_midi.h b/src/music_midi.h new file mode 100644 index 0000000..22dbb2d --- /dev/null +++ b/src/music_midi.h @@ -0,0 +1,33 @@ +#ifndef __MUSIC_MIDI_H__ +#define __MUSIC_MIDI_H__ + +#include "portab.h" +#include "midi.h" +#include "ald_manager.h" + +struct _midiobj { + int st; // オブジェクトの遷移状態 + + boolean in_play; // 演奏中? + + int no; + int loop; + int cnt; + mididevice_t *dev; + + dridata *dfile; +}; +typedef struct _midiobj midiobj_t; + +extern int musmidi_init(); +extern int musmidi_exit(); +extern int musmidi_start(int no, int loop); +extern int musmidi_stop(); +extern int musmidi_pause(); +extern int musmidi_unpause(); +extern midiplaystate musmidi_getpos(); +extern int musmidi_setflag(int mode, int index, int val); +extern int musmidi_getflag(int mode, int index); +extern int musmidi_cb(); + +#endif /* __MUSIC_MIDI_H__ */ diff --git a/src/music_pcm.c b/src/music_pcm.c new file mode 100644 index 0000000..dcb86eb --- /dev/null +++ b/src/music_pcm.c @@ -0,0 +1,539 @@ +/* + * music_pcm.c music server PCM part + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_pcm.c,v 1.16 2003/11/09 15:06:13 chikama Exp $ */ + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "music_pcm.h" +#include "music_server.h" +#include "musstream.h" +#include "audio.h" +#include "ald_manager.h" +#include "wavfile.h" +#include "counter.h" +#include "pcmlib.h" + +// 1回の cb で audio buffer の何分の1を処理するか +#define SLICE 4 + +#define IS_LOADED(slot) (prv.pcm[(slot)]) + + +static int pcmmix_mix(short *src, int len); +static int pcmmix_send2devbuf(); + +extern void Ima_initImaTable(void); + + +#include "music_pcm_wai.c" + +int muspcm_init() { + int st = audio_init(&prv.audiodev); + chanfmt_t fmt; + + if (st == NG) { + prv.pcm_valid = FALSE; + return NG; + } + + fmt.rate = 44100; fmt.bit = 16; fmt.ch = 2; + if (OK == prv.audiodev.open(&prv.audiodev, fmt)) { + prv.ofmt = fmt; + } else if (fmt.rate = 48000, + OK == prv.audiodev.open(&prv.audiodev, fmt)) { + prv.ofmt = fmt; + } else { + prv.pcm_valid = FALSE; + return NG; + } + + { + // device buffer の設定 + audiodevbuf_t *buf = &prv.audiodev.buf; + + buf->b[0] = g_malloc0(buf->len); + buf->b[1] = g_malloc0(buf->len); + + buf->cur = buf->b[0]; + buf->end = (char *)(buf->cur + buf->len); + buf->sw = 0; + buf->lenmax = 0; + buf->ready[0] = buf->ready[1] = FALSE; + } + + prv.pcm_valid = TRUE; + + Ima_initImaTable(); + muspcm_load_wai(); + + return OK; +} + +int muspcm_exit() { + prv.audiodev.close(&prv.audiodev); + prv.audiodev.exit(&prv.audiodev); + return OK; +} + +// 番号指定のPCMファイル読み込み +int muspcm_load_no(int slot, int no) { + pcmobj_t *obj; + WAVFILE *wfile; + + if (IS_LOADED(slot)) muspcm_unload(slot); + + wfile = pcmlib_load(no); + if (wfile == NULL) { + return NG; + } + + // if has .wai file + if (wai_mapadr) { + int ch = WAIMIXCH(no); + prv.vol_pcm_sub[slot] = ch < 0 ? 0: ch; + } else { + prv.vol_pcm_sub[slot] = 0; + } + //printf("rate = %d, bits = %d, ch = %d\n", wfile->rate, wfile->bits, wfile->ch); + + obj = g_new0(pcmobj_t, 1); + obj->sdata = (void *)wfile; + obj->stype = OBJSRC_FILE; + + switch(wfile->type) { + case SND_WAVE: + obj->src = ms_wav(wfile); break; + case SND_WAVE_IMAADPCM: + obj->src = ms_wav_ima(wfile); break; + case SND_OGG: + obj->src = ms_ogg(wfile); break; + } + + obj->fmt.rate = wfile->rate; + obj->fmt.bit = wfile->bits; + obj->fmt.ch = wfile->ch; + obj->data_len = (wfile->bytes * 1000) / (obj->fmt.rate * (obj->fmt.bit/8) * obj->fmt.ch); + obj->slot = slot; + obj->playing = FALSE; + + sndcnv_prepare(obj, prv.audiodev.buf.len / SLICE); + + prv.pcm[slot] = obj; + + // printf("pcm load slot = %d, no = %d\n", slot, no); + + return OK; +} + +// メモリ上のPCMデータの読み込み +int muspcm_load_mem(int slot, void *mem) { + pcmobj_t *obj; + WAVFILE *wfile; + + if (IS_LOADED(slot)) muspcm_unload(slot); + + wfile = (WAVFILE *)((BYTE *)mem + sizeof(int)); + // printf("rate = %d, bits = %d, ch = %d\n", wfile->rate, wfile->bits, wfile->ch); + + obj = g_new0(pcmobj_t, 1); + obj->sdata = mem; + obj->stype = OBJSRC_MEM; + obj->src = ms_memory((BYTE *)mem + sizeof(int) + sizeof(WAVFILE), wfile->bytes); + obj->fmt.rate = wfile->rate; + obj->fmt.bit = wfile->bits; + obj->fmt.ch = wfile->ch; + obj->data_len = (wfile->bytes * 1000) / (obj->fmt.rate * (obj->fmt.bit/8) * obj->fmt.ch); + obj->slot = slot; + obj->playing = FALSE; + + sndcnv_prepare(obj, prv.audiodev.buf.len / SLICE); + + prv.pcm[slot] = obj; + + // printf("pcm load slot = %d, mem = %p\n", slot, mem); + + return OK; +} + +// パイプからのPCMデータからの読み込み +int muspcm_load_pipe(int slot, char *cmd) { + pcmobj_t *obj; + + if (IS_LOADED(slot)) muspcm_unload(slot); + + obj = g_new0(pcmobj_t, 1); + obj->sdata = NULL; + obj->stype = OBJSRC_PIPE; + obj->src = ms_pipe(cmd); + obj->fmt = prv.ofmt; + obj->data_len = -1; + obj->slot = slot; + obj->playing = FALSE; + + sndcnv_prepare(obj, prv.audiodev.buf.len / SLICE); + + prv.pcm[slot] = obj; + + return OK; +} + +// 左右を入れ換えたファイルからのPCMの再生のための読み込み +int muspcm_load_no_lrsw(int slot, int no) { + pcmobj_t *obj; + int ret = muspcm_load_no(slot, no); + if (ret == NG) return NG; + + obj = prv.pcm[slot]; + if (((WAVFILE *)(obj->sdata))->bits == 8) { + obj->src->lrswap8 = TRUE; + } else { + obj->src->lrswap16 = TRUE; + } + + return OK; +} + +// PCMデータを再生 +int muspcm_start(int slot, int loop) { + pcmobj_t *obj; + // printf("pcm start slot = %d, loop = %d\n", slot, loop); + + obj = prv.pcm[slot]; + if (obj == NULL) return NG; + + obj->loop = loop; + obj->cnt = 0; + obj->vollv = 100; + obj->written_len = 0; + obj->src->seek(obj->src, 0, SEEK_SET); + obj->playing = TRUE; + + if (-1 == g_list_index(prv.pcmplist, obj)) { + prv.pcmplist = g_list_append(prv.pcmplist, (gpointer)obj); + } + + return OK; +} + +// PCMデータの再生停止 +int muspcm_stop(int slot) { + pcmobj_t *obj; + + obj = prv.pcm[slot]; + if (obj == NULL) return NG; + + prv.pcmplist = g_list_remove(prv.pcmplist, obj); + obj->playing = FALSE; + + return OK; +} + +// PCMデータのメモリ上からのアンロード +int muspcm_unload(int slot) { + pcmobj_t *obj; + + obj = prv.pcm[slot]; + if (obj == NULL) return NG; + + if (obj->playing) muspcm_stop(slot); + + switch(obj->stype) { + case OBJSRC_FILE: + pcmlib_free((WAVFILE *)(obj->sdata)); + break; + case OBJSRC_MEM: + g_free(obj->sdata); + break; + } + sndcnv_drain(obj); + obj->src->close(obj->src); + g_free(obj); + + prv.pcm[slot] = NULL; + + return OK; +} + +// PCMデータ再生一時停止 +int muspcm_pause(int slot) { + if (prv.pcm[slot] != NULL) { + prv.pcm[slot]->paused = TRUE; + } + return OK; +} + +// PCMデータ再生一時停止解除 +int muspcm_unpause(int slot) { + if (prv.pcm[slot] != NULL) { + prv.pcm[slot]->paused = FALSE; + } + return OK; +} + +static WORD clip(int v) { + if (v > 32767) return 32767; + if (v < -32768) return -32768; + return v; +} + +static int pcmmix_mix(short *src, int len) { + int len1, len2, i; + audiodevbuf_t *buf = &prv.audiodev.buf; + short *dst = (short *)buf->cur; + + // WARNING("mix to buf (%d) ptr=%p len = %d\n", buf->sw, buf->cur, len); + + buf->lenmax = MAX(buf->lenmax, len); + + if (buf->cur + len >= buf->end) { + len1 = buf->end - buf->cur; + len2 = len - len1; + } else { + len1 = len; + len2 = 0; + } + + for (i = 0; i < len1; i+=2) { + *dst = clip((int)*src + (int)*dst); + src++; dst++; + } + + // 次のバッファへ + if (len2 != 0) { + dst = (short *)buf->b[!buf->sw]; + for (i = 0; i < len2; i+=2) { + *dst = clip((int)*src + (int)*dst); + src++; dst++; + } + } + return OK; +} + +static int pcmmix_send2devbuf() { + audiodevbuf_t *buf = &prv.audiodev.buf; + int len2; + + if (buf->cur + buf->lenmax >= buf->end) { + // 次のバッファに切替え + len2 = buf->lenmax - (buf->end - buf->cur); + buf->ready[buf->sw] = TRUE; + buf->sw = !(buf->sw); + buf->cur = buf->b[buf->sw] + len2; + buf->end = buf->b[buf->sw] + buf->len; + } else { + buf->cur += buf->lenmax; + } + + buf->lenmax = 0; + + return OK; +} + +// defice にデータが送られたときに cb を設定してあるとそれを呼ぶ +static GSList *cb_flush[2]; +static void cb_at_devflush4each(gpointer data, gpointer userdata) { + pcmobj_t *obj = (pcmobj_t *)data; + obj->cb_atend(obj->fd); +} + +static void cb_at_devflush(int sw) { + if (cb_flush[sw]) { + g_slist_foreach(cb_flush[sw],cb_at_devflush4each, NULL); + g_slist_free(cb_flush[sw]); + cb_flush[sw] = NULL; + } +} + +// PCM再生リスト中のPCMソースからデータを読み込んで合成 +int muspcm_cb() { + audiodevbuf_t *buf = &prv.audiodev.buf; + pcmobj_t *obj; + GList *node; + GSList *removelist = NULL, *snode; + int len; + + // 再生リストが空の場合はなにもしない + if (g_list_length(prv.pcmplist) == 0) { + return 0; + } + + // 次のバッファがいっぱいのときはなにもしない + if (buf->ready[!buf->sw]) { + //printf("buffer is full\n"); + return 0; + } + + // 全ての再生リスト中のチャンネルを合成 + for (node = prv.pcmplist; node; node = g_list_next(node)) { + obj = (pcmobj_t *)node->data; + if (obj == NULL) continue; // why ? + + // 停止中の場合 + if (obj->paused) continue; + + len = obj->conv.convert(obj, obj->vollv * prv.volval[prv.vol_pcm_sub[obj->slot]] / 100, prv.audiodev.buf.len/SLICE); + if (len <= 0) { // エラーまたは終端に到達した場合 + if (obj->cb_atend) { + // 演奏終了を知らせて欲しい + // フェードやpcm_stopでの終了の際は知らせなくてよい? + cb_flush[buf->sw] = g_slist_append(cb_flush[buf->sw], obj); + } + // loop check + if (obj->loop == 0) { // 無限ループ + obj->src->seek(obj->src, 0, SEEK_SET); + obj->written_len = 0; + continue; + } + if (--obj->loop == 0) { // 繰り返し終了 + // remove + // muspcm_stop(obj->slot); + removelist = g_slist_append(removelist, obj); + continue; + } else { // 先頭へ + obj->src->seek(obj->src, 0, SEEK_SET); + obj->written_len = 0; + continue; + } + } + // 合成 + pcmmix_mix(obj->conv.buf, len); + obj->written_len += len; + } + + len = prv.audiodev.buf.lenmax; + if (len > 0) pcmmix_send2devbuf(); + + // 最後に pcm playlist から stop した pcmobj を削除 + for (snode = removelist; snode; snode = g_slist_next(snode)) { + obj = (pcmobj_t *)snode->data; + if (obj == NULL) continue; + muspcm_stop(obj->slot); + } + + return len; // 実際に合成した長さ +} + +// バッファ中のPCMデータをデバイスに出力 (pollout時に呼ばれる) +int muspcm_write2dev(void) { + audiodevbuf_t *buf = &prv.audiodev.buf; + int sw; + + // バッファがaudiodeviceに書き込みOKの方を選択 + sw = (buf->ready[0] ? 0 : buf->ready[1] ? 1 : -1); + while (sw < 0) { + int len = 0; + if (g_list_length(prv.pcmplist) != 0) { + // playlist中にPCMデータソースがある場合は + // バッファがいっぱいになるまで読み込む + len = muspcm_cb(); + } + if (len == 0) { + // 実際に読み込めたデータが0の場合 + sw = buf->sw; + if (buf->cur == buf->b[sw]) return OK; + // 残りのデータの吐き出しとバッファのクリア + // audiodeviceのバッファサイズ全体を送出しないと + // FreeBSD+OSSでデバイスがwrite readyにならない。 + prv.audiodev.write(&prv.audiodev, buf->b[sw], buf->len); + memset(buf->b[sw], 0, buf->len); + buf->ready[sw] = FALSE; + buf->cur = buf->b[sw]; + buf->end = buf->cur + buf->len; + + cb_at_devflush(sw); + return OK; + } + sw = (buf->ready[0] ? 0 : buf->ready[1] ? 1 : -1); + } + + // 書き込みの準備ができている方をデバイスへ + prv.audiodev.write(&prv.audiodev, buf->b[sw], buf->len); + memset(buf->b[sw], 0, buf->len); + buf->ready[sw] = FALSE; + + // デバイスに書き込む際に callback があればそれを呼び出す + cb_at_devflush(sw); + return OK; +} + +// 現在の再生位置を返す +int muspcm_getpos(int slot) { + pcmobj_t *obj; + guint64 len; + + obj = prv.pcm[slot]; + if (obj == NULL) return 0; + + if (!obj->playing) return 0; + + len = obj->written_len; +#if 0 + if (prv.audiodev.buf.ready[!prv.audiodev.buf.sw]) { + len -= prv.audiodev.buf.len; + } + if (len < 0) return 0; +#endif + return (int)(((guint64)(len * 1000) / (obj->fmt.rate * (obj->fmt.bit/8) * obj->fmt.ch))); +} + +// PCMオブジェクトに対してボリュームをセット +int muspcm_setvol(int dev, int slot, int lv) { + pcmobj_t *obj; + + obj = prv.pcm[slot]; + if (obj == NULL) return NG; + + obj->vollv = lv; + + return OK; +} + +// PCMデータの長さを取得 +int muspcm_getwavelen(int slot) { + pcmobj_t *obj; + + obj = prv.pcm[slot]; + if (obj == NULL) return 0; + + if (obj->data_len == -1) return 0; + + if (obj->data_len > 65535) return 65535; + + return obj->data_len; +} + +// 指定のスロットが現在演奏中かどうかを取得 +boolean muspcm_isplaying(int slot) { + pcmobj_t *obj; + + obj = prv.pcm[slot]; + if (obj == NULL) return FALSE; + + if (!obj->playing) return FALSE; + + return TRUE; +} diff --git a/src/music_pcm.h b/src/music_pcm.h new file mode 100644 index 0000000..c7f2d23 --- /dev/null +++ b/src/music_pcm.h @@ -0,0 +1,120 @@ +/* + * music_pcm.h music server PCM part + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_pcm.h,v 1.4 2003/08/22 17:09:23 chikama Exp $ */ + +#ifndef __MUSIC_PCM_H__ +#define __MUSIC_PCM_H__ + +#include "musstream.h" +#include "dri.h" +#include "audio.h" + +#define SLOT_CDROMPIPE 129 +#define SLOT_MIDIPIPE 130 + +#define OBJSRC_FILE 1 +#define OBJSRC_MEM 2 +#define OBJSRC_PIPE 3 + +#define MAX_PRIVATE 10 + +struct _pcmobj; + +// PCM 変換に関するオブジェクト +struct _sndcnv { + // 入力フォーマット + chanfmt_t ifmt; + + // 出力フォーマット + chanfmt_t ofmt; + + /* private area for effect */ + char priv[MAX_PRIVATE * 8]; + + // src から読み込む長さ + int isample; + + // 周波数変換ありなし別変換関数 + int (*convert)(struct _pcmobj *, int, int); + + // バッファ + void *buf; +}; +typedef struct _sndcnv sndcnv_t; + +struct _pcmobj { + chanfmt_t fmt; + musstream_t *src; + + sndcnv_t conv; // フォーマット変換用 + + int vollv; /* volume level */ + int loop; /* くりかえし数 */ + int cnt; /* 実際に繰り返した数 */ + + int slot; // ロードされているスロット番号 + + int stype; // ソースデータオブジェクトタイプ (FILE,MEM,PIPE) + void *sdata; // ソースデータオブジェクト + + /* 終了時に client に知らせるかどうか */ + void (* cb_atend)(int fd); + + /* 終了時に知らせる client の file discpriter */ + int fd; + + /* wavefile のデータの長さ(ms単位) */ + long data_len; + + /* 合計再生時間(バイト数) */ + long written_len; + + /* 一時停止中 */ + boolean paused; + + /* 演奏中 */ + boolean playing; +}; +typedef struct _pcmobj pcmobj_t; + + +extern int muspcm_init(); +extern int muspcm_exit(); +extern int muspcm_load_no(int slot, int no); +extern int muspcm_load_no_lrsw(int slot, int no); +extern int muspcm_load_mem(int slot, void *mem); +extern int muspcm_load_pipe(int slot, char *cmd); +extern int muspcm_start(int slot, int loop); +extern int muspcm_stop(int slot); +extern int muspcm_unload(int slot); +extern int muspcm_pause(int slot); +extern int muspcm_unpause(int slot); +extern int muspcm_getpos(int slot); +extern int muspcm_setvol(int dev, int slot, int lv); +extern int muspcm_getwavelen(int slot); +extern int muspcm_cb(); +extern int muspcm_write2dev(void); +extern boolean muspcm_isplaying(int slot); +extern int sndcnv_prepare(pcmobj_t *pcm, int outlen); +extern int sndcnv_drain(pcmobj_t *pcm); + +#endif /* __MUSIC_PCM_H__ */ diff --git a/src/music_pcm_wai.c b/src/music_pcm_wai.c new file mode 100644 index 0000000..40f72a1 --- /dev/null +++ b/src/music_pcm_wai.c @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "nact.h" +#include "LittleEndian.h" + +static char *wai_mapadr; + +// Volume mixer channel +#define WAIMIXCH(no) LittleEndian_getDW(wai_mapadr, 36 + (no -1) * 4 * 3 + 8) + +// WAVFILE マーカー? +#define WAIMARK(no) LittleEndian_getDW(wai_mapadr, 36 + (no -1) * 4 * 3 + 4) + + +int muspcm_load_wai() { + struct stat sbuf; + char *adr; + int fd; + + wai_mapadr = NULL; + if (nact->files.wai == NULL) goto endwai; + + if (0 > (fd = open(nact->files.wai, O_RDONLY))) { + WARNING("open: %s\n", strerror(errno)); + goto endwai; + } + + if (0 > fstat(fd, &sbuf)) { + WARNING("fstat:%s\n", strerror(errno)); + close(fd); + goto endwai; + } + + if (MAP_FAILED == (adr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, fd, 0))) { + WARNING("mmap: %s\n", strerror(errno)); + close(fd); + goto endwai; + } + + if (*adr != 'X' || *(adr+1) != 'I' || *(adr+2) != '2') { + WARNING("not WAI file\n"); + munmap(adr, sbuf.st_size); + close(fd); + goto endwai; + } + + wai_mapadr = adr; + + endwai: + return OK; +} + diff --git a/src/music_server.c b/src/music_server.c new file mode 100644 index 0000000..63a31f8 --- /dev/null +++ b/src/music_server.c @@ -0,0 +1,474 @@ +/* + * music_server.c music server main + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_server.c,v 1.13 2004/10/31 04:18:06 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "music.h" +#include "system.h" +#include "music_server.h" +#include "music_fader.h" +#include "music_bgm.h" +#include "music_ctrlsocket.c" +#include "nact.h" + +extern void sys_set_signalhandler(int SIG, void (*handler)(int)); + +/* music server 内共通変数 */ +struct _musprvdat musprv; + +static pid_t sv_pid; +static int socketfd; +static struct sockaddr_un saddr; + +static int get_command() { + int len, fd; + int v[10]; + PacketNode *pkt; + + if (prv.audiodev.fd != -1) { + prv.ufds[1].fd = prv.audiodev.fd; + prv.ufds[1].events = POLLOUT; + prv.nfds = 2; + } else { + prv.nfds = 1; + } + + len = sizeof(saddr); + + if (-1 == poll(prv.ufds, prv.nfds, 10)) { + perror("poll"); + return 0; + } + + if (prv.nfds == 2) { + if (prv.ufds[1].revents & POLLOUT) { + muspcm_write2dev(); + } + } + + if ((prv.ufds[0].revents & POLLIN) == 0) { + //puts("timeout"); + return 0; + } + + if (-1 == (fd = accept(socketfd, (struct sockaddr *)&saddr, &len))) { + perror("accept"); + return 0; + } + + pkt = g_malloc0(sizeof(PacketNode)); + read(fd, &pkt->hdr, sizeof(ClientPktHeader)); + if (pkt->hdr.data_length) { + BYTE *p; + int l; + p = pkt->data = g_malloc0(pkt->hdr.data_length); + l = pkt->hdr.data_length; + while(l) { + int len; + len = read(fd, p, pkt->hdr.data_length); + l -= len; + p += len; + } + } + pkt->fd = fd; + + //printf("get command %d, len = %d\n", pkt->hdr.command, pkt->hdr.data_length); + switch(pkt->hdr.command) { + case MUS_CDROM_START: + v[0] = ((int *)pkt->data)[0]; + v[1] = ((int *)pkt->data)[1]; + muscd_start(v[0], v[1]); + ctrl_ack_packet(pkt); + break; + + case MUS_CDROM_STOP: + muscd_stop(); + ctrl_ack_packet(pkt); + break; + + case MUS_CDROM_GETPOSITION: { + cd_time tm = muscd_getpos(); + ctrl_write_packet(pkt->fd, &tm, sizeof(tm)); + ctrl_ack_packet(pkt); + break; + } + + case MUS_CDROM_GETMAXTRACK: { + int trk = prv.cd_maxtrk; + ctrl_write_packet(pkt->fd, &trk, sizeof(trk)); + ctrl_ack_packet(pkt); + break; + } + + case MUS_PCM_START: + v[0] = ((int *)pkt->data)[0]; // ch + v[1] = ((int *)pkt->data)[1]; // loop + muspcm_start(v[0], v[1]); + ctrl_ack_packet(pkt); + break; + + case MUS_PCM_STOP: + v[0] = ((int *)pkt->data)[0]; /* ch */ + v[1] = ((int *)pkt->data)[1]; /* msec */ + musfade_new(MIX_PCM, v[0], v[1], -1, 1); + ctrl_ack_packet(pkt); + break; + + case MUS_PCM_LOAD_NO: + v[0] = ((int *)pkt->data)[0]; /* ch */ + v[1] = ((int *)pkt->data)[1]; /* no */ + muspcm_load_no(v[0], v[1]); + ctrl_ack_packet(pkt); + break; + + case MUS_PCM_LOAD_MEM: + v[0] = ((int *)pkt->data)[0]; /* ch */ + muspcm_load_mem(v[0], pkt->data); + ctrl_write_packet(pkt->fd, NULL, 0); + close(pkt->fd); + g_free(pkt); + break; + + case MUS_PCM_LOAD_LRSW: + v[0] = ((int *)pkt->data)[0]; /* ch */ + v[1] = ((int *)pkt->data)[1]; /* no */ + muspcm_load_no_lrsw(v[0], v[1]); + ctrl_ack_packet(pkt); + break; + + case MUS_PCM_UNLOAD: + v[0] = ((int *)pkt->data)[0]; /* ch */ + muspcm_unload(v[0]); + ctrl_ack_packet(pkt); + break; + + case MUS_PCM_GETPOSITION: { + int time; + v[0] = ((int *)pkt->data)[0]; /* ch */ + time = muspcm_getpos(v[0]); + ctrl_write_gint(pkt->fd, time); + ctrl_ack_packet(pkt); + break; + } + + case MUS_PCM_WAITEND: + v[0] = ((int *)pkt->data)[0]; /* ch */ + if (!muspcm_isplaying(v[0])) { + ctrl_ack_packet(pkt); + break; + } + prv.pcm[v[0]]->cb_atend = musserv_send_ack; + prv.pcm[v[0]]->fd = pkt->fd; + g_free(pkt->data); + g_free(pkt); + break; + + case MUS_PCM_GETWAVETIME: { + int time; + v[0] = ((int *)pkt->data)[0]; /* ch */ + time = muspcm_getwavelen(v[0]); + ctrl_write_gint(pkt->fd, time); + ctrl_ack_packet(pkt); + break; + } + + case MUS_MIDI_START: + v[0] = ((int *)pkt->data)[0]; /* no */ + v[1] = ((int *)pkt->data)[1]; /* loop */ + musmidi_start(v[0], v[1]); + ctrl_ack_packet(pkt); + break; + + case MUS_MIDI_STOP: + musmidi_stop(); + ctrl_ack_packet(pkt); + break; + + case MUS_MIDI_PAUSE: + musmidi_pause(); + ctrl_ack_packet(pkt); + break; + + case MUS_MIDI_UNPAUSE: + musmidi_unpause(); + ctrl_ack_packet(pkt); + break; + + case MUS_MIDI_GETPOSITION: { + midiplaystate state = musmidi_getpos(); + ctrl_write_packet(pkt->fd, &state, sizeof(state)); + ctrl_ack_packet(pkt); + break; + + } + case MUS_MIDI_SETFLAG: + v[0] = ((int *)pkt->data)[0]; /* mode */ + v[1] = ((int *)pkt->data)[1]; /* index */ + v[2] = ((int *)pkt->data)[2]; /* val */ + musmidi_setflag(v[0], v[1], v[2]); + ctrl_ack_packet(pkt); + break; + + case MUS_MIDI_GETFLAG: { + int val; + v[0] = ((int *)pkt->data)[0]; /* mode */ + v[1] = ((int *)pkt->data)[1]; /* index */ + val = musmidi_getflag(v[0], v[1]); + ctrl_write_gint(pkt->fd, val); + ctrl_ack_packet(pkt); + break; + } + + case MUS_FADE_START: + v[0] = ((int *)pkt->data)[0]; /* device */ + v[1] = ((int *)pkt->data)[1]; /* pcm subdev */ + v[2] = ((int *)pkt->data)[2]; /* time */ + v[3] = ((int *)pkt->data)[3]; /* vol */ + v[4] = ((int *)pkt->data)[4]; /* stop */ + musfade_new(v[0], v[1], v[2], v[3], v[4]); + ctrl_ack_packet(pkt); + break; + + case MUS_FADE_STOP: + v[0] = ((int *)pkt->data)[0]; /* device */ + v[1] = ((int *)pkt->data)[1]; /* pcm subdev */ + musfade_stop(v[0], v[1]); + ctrl_ack_packet(pkt); + break; + + case MUS_FADE_GETSTATE: { + boolean st; + + v[0] = ((int *)pkt->data)[0]; /* device */ + v[1] = ((int *)pkt->data)[1]; /* pcm subdev */ + st = musfade_getstate(v[0], v[1]); + ctrl_write_gboolean(pkt->fd, st); + ctrl_ack_packet(pkt); + break; + } + + case MUS_MIXER_GETLEVEL: { + int lv; + v[0] = ((int *)pkt->data)[0]; /* dev */ + + lv = musfade_getvol(v[0]); + ctrl_write_gint(pkt->fd, lv); + ctrl_ack_packet(pkt); + break; + } + + case MUS_MIXER_SETVOLVAL: { + int num = pkt->hdr.data_length / sizeof(int); + musfade_setvolval((int *)pkt->data, num); + ctrl_ack_packet(pkt); + break; + } + + case MUS_BGM_PLAY: + v[0] = ((int *)pkt->data)[0]; /* no */ + v[1] = ((int *)pkt->data)[1]; /* time */ + v[2] = ((int *)pkt->data)[2]; /* vol */ + musbgm_play(v[0], v[1], v[2]); + ctrl_ack_packet(pkt); + break; + + case MUS_BGM_STOP: + v[0] = ((int *)pkt->data)[0]; /* no */ + v[1] = ((int *)pkt->data)[1]; /* time */ + musbgm_stop(v[0], v[1]); + ctrl_ack_packet(pkt); + break; + + case MUS_BGM_STOPALL: + v[0] = ((int *)pkt->data)[1]; /* time */ + musbgm_stopall(v[0]); + ctrl_ack_packet(pkt); + break; + + case MUS_BGM_FADE: + v[0] = ((int *)pkt->data)[0]; /* no */ + v[1] = ((int *)pkt->data)[1]; /* time */ + v[2] = ((int *)pkt->data)[2]; /* vol */ + musbgm_fade(v[0], v[1], v[2]); + ctrl_ack_packet(pkt); + break; + + case MUS_BGM_GETPOS: { + int val; + v[0] = ((int *)pkt->data)[0]; /* no */ + if (!musbgm_isplaying(v[0])) { + val = 0; + } else { + val = musbgm_getpos(v[0]); + } + ctrl_write_gint(pkt->fd, val); + ctrl_ack_packet(pkt); + break; + } + + case MUS_BGM_GETLEN: { + int val; + v[0] = ((int *)pkt->data)[0]; /* no */ + if (!musbgm_isplaying(v[0])) { + val = 0; + } else { + val = musbgm_getlen(v[0]); + } + ctrl_write_gint(pkt->fd, val); + ctrl_ack_packet(pkt); + break; + } + + case MUS_BGM_WAIT: + v[0] = ((int *)pkt->data)[0]; /* no */ + v[1] = ((int *)pkt->data)[1]; /* time */ + if (!musbgm_isplaying(v[0])) { + ctrl_ack_packet(pkt); + break; + } + + ctrl_ack_packet(pkt); + break; + + case MUS_BGM_WAITPOS: + v[0] = ((int *)pkt->data)[0]; /* no */ + v[1] = ((int *)pkt->data)[1]; /* timeout */ + ctrl_ack_packet(pkt); + WARNING("NOT IMPLEMENTED\n"); + break; + + case MUS_GET_VALIDSUBSYSTEM: { + ValidSubsystem sub; + sub.cdrom = prv.cd_valid; + sub.midi = prv.midi_valid; + sub.pcm = prv.pcm_valid; + ctrl_write_packet(pkt->fd, &sub, sizeof(sub)); + ctrl_ack_packet(pkt); + break; + } + + case MUS_EXIT: + if (prv.cd_valid) muscd_exit(); + if (prv.midi_valid) musmidi_exit(); + if (prv.pcm_valid) musfade_exit(); + if (prv.pcm_valid) muspcm_exit(); + ctrl_ack_packet(pkt); + return -1; + + default: + break; + } + + return 0; +} + +static void do_command() { + if (prv.pcm_valid) musfade_cb(); + if (prv.cd_valid) muscd_cb(); + if (prv.midi_valid) musmidi_cb(); + if (prv.pcm_valid) muspcm_cb(); +} + +static void do_music_server() { + saddr.sun_family = AF_UNIX; + strcpy(saddr.sun_path, nact->tmpdir); + strcat(saddr.sun_path, XSYS35MUSSOCK); + + if (0 > (socketfd = socket(PF_UNIX, SOCK_STREAM, 0))) { + perror("socket"); + _exit(1); + } + + if (0 > bind(socketfd, (struct sockaddr *)&saddr, sizeof(saddr))) { + perror("bind"); + _exit(1); + } + + if (0 > listen(socketfd, 100)) { + perror("listen"); + _exit(1); + } + + prv.nfds = 1; + prv.ufds[0].fd = socketfd; + prv.ufds[0].events = POLLIN; + + /* XXXX */ + close(0); + + { + int cnt = 0; + while(0 == get_command()) { + do_command(); + if (cnt > 100) { + cnt = 0; + usleep(10); // avoid packet storm + } + cnt++; + } + } + unlink(saddr.sun_path); + _exit(1); +} + +void musserv_send_ack(int fd) { + ctrl_write_packet(fd, NULL, 0); + close(fd); +} + +int musserv_init() { + sv_pid = fork(); + + if (sv_pid == 0) { + muscd_init(); + musmidi_init(); + muspcm_init(); + musfade_init(); + musbgm_init(); + + sys_set_signalhandler(SIGABRT, SIG_DFL); + sys_set_signalhandler(SIGSEGV, SIG_DFL); + sys_set_signalhandler(SIGINT, SIG_IGN); + do_music_server(); + } + + return OK; +} + +int musserv_exit() { + int status; + + waitpid(sv_pid, &status, 0); + + return OK; +} diff --git a/src/music_server.h b/src/music_server.h new file mode 100644 index 0000000..72a3f73 --- /dev/null +++ b/src/music_server.h @@ -0,0 +1,88 @@ +/* + * music_server.h music server main + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: music_server.h,v 1.3 2003/04/25 17:23:55 chikama Exp $ */ + +#ifndef __MUSIC_SERVER_H__ +#define __MUSIC_SERVER_H__ + +#include +#include + +#include "portab.h" +#include "cdrom.h" +#include "midi.h" +#include "audio.h" +#include "music_cdrom.h" +#include "music_midi.h" +#include "music_pcm.h" + +struct _musprvdat { + boolean cd_valid; + boolean midi_valid; + boolean pcm_valid; + + cdromdevice_t cddev; + mididevice_t mididev; + audiodevice_t audiodev; + + chanfmt_t ofmt; /* audio output format */ + + cdobj_t cdrom; // cdrom object + midiobj_t midi; // midi object + + // pcm object + /* + 0: S comman 用 + 1-128: wavXXX 用 + 129: cdrom pipe 用 + 130: midi pipe 用 + */ + pcmobj_t *pcm[128 + 1 + 2]; + + // ゲーム内での volume 設定 (%値) + int vol_master; + int vol_pcm; + int vol_midi; + int vol_cd; + int vol_pcm_sub[128 + 1 + 2]; // volval の channel + int volval[16]; // 各channel 毎の volume valance + + // 最大トラック数 + int cd_maxtrk; + + GList *pcmplist; // PCM多重再生用リスト + GList *fadelist; // Faderリスト + + // for polling + int nfds; + struct pollfd ufds[2]; + +}; + +extern int musserv_init(); +extern int musserv_exit(); +extern void musserv_send_ack(int); + +#define prv musprv +extern struct _musprvdat musprv; + +#endif /* __MUSIC_SERVER_H__ */ diff --git a/src/musstream.c b/src/musstream.c new file mode 100644 index 0000000..21ef74f --- /dev/null +++ b/src/musstream.c @@ -0,0 +1,267 @@ +/* + * musstream.c wrapper for file/pipe/memory + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: musstream.c,v 1.5 2002/12/31 04:11:19 chikama Exp $ */ + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "musstream.h" +#include "counter.h" + +static int file_seek(struct _musstream *this, int off, int where); +static int file_read(struct _musstream *this, void *ptr, int size, int maxnum); +static int file_close(struct _musstream *this); +static int pipe_seek(struct _musstream *this, int off, int where); +static int pipe_read(struct _musstream *this, void *ptr, int size, int maxnum); +static int pipe_close(struct _musstream *this); +static int mem_seek(struct _musstream *this, int off, int where); +static int mem_read(struct _musstream *this, void *ptr, int size, int maxnum); +static int mem_close(struct _musstream *this); + +static int file_seek(struct _musstream *this, int off, int where) { + if (0 == fseek(this->hidden.stdio.fp, off, where)) { + return ftell(this->hidden.stdio.fp); + } else { + return -1; + } +} + +static int file_read(struct _musstream *this, void *ptr, int size, int maxnum) { + size_t nread; + + nread = fread(ptr, size, maxnum, this->hidden.stdio.fp); + + return nread; +} + +static int file_close(struct _musstream *this) { + if (this) { + fclose(this->hidden.stdio.fp); + g_free(this); + } + return 0; +} + +static int pipe_seek(struct _musstream *this, int off, int where) { + FILE *fp; + char *tbuf = g_new(char, off); + int num = 0; + + switch(where) { + case SEEK_SET: + if (this->hidden.pipe.fp) { + pclose(this->hidden.pipe.fp); + } + + fp = popen(this->hidden.pipe.cmd, "r"); + if (fp == NULL) return -1; + + this->hidden.pipe.fp = fp; + if (off != 0) { + num = pipe_read(this, tbuf, 1, off); + } + break; + case SEEK_CUR: + if (off != 0) { + num = pipe_read(this, tbuf, 1, off); + } + break; + case SEEK_END: + // no + num = -1; + break; + default: + WARNING("Unknown value for 'whence'\n"); + g_free(tbuf); + return -1; + } + + g_free(tbuf); + return num; +} + +static int pipe_read(struct _musstream *this, void *ptr, int size, int maxnum) { + size_t nread; + + nread = fread(ptr, size, maxnum, this->hidden.pipe.fp); + if (nread == 0 && !feof(this->hidden.pipe.fp)) { + while(nread == 0) { + nread = fread(ptr, size, maxnum, this->hidden.pipe.fp); + } + } + + //printf("nread = %d\n", nread); + + return nread; +} + +static int pipe_close(struct _musstream *this) { + if (this) { + if (this->hidden.pipe.fp) { + pclose(this->hidden.pipe.fp); + this->hidden.pipe.fp = NULL; + } + g_free(this); + } + return 0; +} + +static int mem_seek(struct _musstream *this, int offset, int where) { + void *newpos; + + switch(where) { + case SEEK_SET: + newpos = this->hidden.mem.base + offset; + break; + case SEEK_CUR: + newpos = this->hidden.mem.cur + offset; + break; + case SEEK_END: + newpos = this->hidden.mem.end + offset; + break; + default: + WARNING("Unknown value for 'whence'\n"); + return -1; + } + + if (newpos < this->hidden.mem.base) { + newpos = this->hidden.mem.base; + } + if (newpos > this->hidden.mem.end) { + newpos = this->hidden.mem.end; + } + + this->hidden.mem.cur = newpos; + + return (this->hidden.mem.cur - this->hidden.mem.base); +} + +static int mem_read(struct _musstream *this, void *ptr, int size, int maxnum) { + int num = maxnum; + + if ((this->hidden.mem.cur + (num*size)) > this->hidden.mem.end) { + num = (this->hidden.mem.end - this->hidden.mem.cur) / size; + } + + if (num == 0) return 0; + + //printf("copy len = %d, cur = %p\n", num * size, this->hidden.mem.cur); + memcpy(ptr, this->hidden.mem.cur, num * size); + this->hidden.mem.cur += (num * size); + + return num; +} + +static int mem_close(struct _musstream *this) { + if (this) { + g_free(this); + } + return 0; +} + +musstream_t *ms_file(char *filename) { + FILE *fp; + musstream_t *s; + + fp = fopen(filename, "r"); + if (fp == NULL) { + WARNING("file open(%s) error\n", filename); + return NULL; + } + + s = g_new0(musstream_t, 1); + s->hidden.stdio.fp = fp; + s->seek = file_seek; + s->read = file_read; + s->close = file_close; + + return s; +} + +musstream_t *ms_pipe(char *cmd) { + FILE *fp; + musstream_t *s; + +#if 0 + fp = popen(cmd, "r"); + if (fp == NULL) { + WARNING("pipe open(%s) error\n", cmd); + return NULL; + } +#endif + fp = NULL; + + s = g_new0(musstream_t, 1); + s->hidden.pipe.fp = fp; + s->hidden.pipe.cmd = cmd; + + s->seek = pipe_seek; + s->read = pipe_read; + s->close = pipe_close; + + return s; +} + +musstream_t *ms_memory(void *ptr, int size) { + musstream_t *s; + + s = g_new0(musstream_t, 1); + s->hidden.mem.base = ptr; + s->hidden.mem.cur = ptr; + s->hidden.mem.end = ptr + size; + + s->seek = mem_seek; + s->read = mem_read; + s->close = mem_close; + + return s; +} + +#if 0 +int main(int argc, char *argv[]) { + musstream_t *ms; + char buf[256]; + char readbuf[4096] = {255}; + int num, i; + + sprintf(buf, "mpg123-esd -s -q %s", argv[1]); + printf("buf = %s\n", buf); + + ms = ms_pipe(buf); sleep(2); + if (ms == NULL) { + puts("fail"); + exit(1); + } + ms->seek(ms, 0, SEEK_SET); + for (i = 0; num != 0; i++) { + num = ms->read(ms, readbuf, 1, sizeof(readbuf)); + printf("%d %d, %d\n", num, readbuf[100], readbuf[105]); + usleep(100*1000); + } + ms->close(ms); +} +#endif diff --git a/src/musstream.h b/src/musstream.h new file mode 100644 index 0000000..42669f5 --- /dev/null +++ b/src/musstream.h @@ -0,0 +1,98 @@ +/* + * musstream.h wrapper for file/pipe/memory + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: musstream.h,v 1.3 2003/11/09 15:06:13 chikama Exp $ */ + +#ifndef __MUSSTREAM_H__ +#define __MUSSTREAM_H__ + +#include +#include "wavfile.h" + +struct _musstream { + int (*seek)(struct _musstream *this, int off, int where); + int (*read)(struct _musstream *this, void *ptr, int size, int maxnum); + int (*close)(struct _musstream *this); + int type; + + boolean byteswap; + + boolean lrswap8; + boolean lrswap16; + + boolean lrmix8; + boolean lrmix16; + + union { + struct { + FILE *fp; + } stdio; + struct { + void *base; + void *cur; + void *end; + void *lpp; + } mem; + struct { + FILE *fp; + char *cmd; + char *buf; + } pipe; + + struct { + void *base; + void *cur; + void *end; + void *lpp; + } memm[2]; // multi stream + + struct { + void *vf; /* OggVorbis_File */ + } ogg; + + struct { + void *base; + void *cur; + void *end; + void *wf; + void *obuf; + void *obufcur; + int left; + } ima; + } hidden; +}; +typedef struct _musstream musstream_t; + +extern musstream_t *ms_file(char *filename); +extern musstream_t *ms_pipe(char *cmd); +extern musstream_t *ms_memory(void *prt, int size); + +/* musstream_wav.c */ +extern musstream_t *ms_wav(WAVFILE *snd); +extern musstream_t *ms_wav2(WAVFILE *snd, int size, int looppoint); + +/* musstream_ogg.c */ +extern musstream_t *ms_ogg(WAVFILE *snd); + +/* musstream_wav_ima.c */ +extern musstream_t *ms_wav_ima(WAVFILE *snd); + +#endif /* __MUSSTREAM_H__*/ diff --git a/src/musstream_ogg.c b/src/musstream_ogg.c new file mode 100644 index 0000000..bf04269 --- /dev/null +++ b/src/musstream_ogg.c @@ -0,0 +1,199 @@ +/* + * musstream_ogg.c music strema for .ogg file + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: musstream_ogg.c,v 1.3 2004/10/31 04:18:06 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "musstream.h" +#include "wavfile.h" + +struct _ogg2pcm { + void *top; + void *cur; + ogg_int64_t size; +}; +typedef struct _ogg2pcm ogg2pcm_t; + +static size_t ovcb_read(void *ptr, size_t size, size_t nmemb, void *ds); +static int ovcb_seek(void *ds, ogg_int64_t offset, int whence); +static int ovcb_close(void *ds); +static long ovcb_tell(void *ds); + +static ov_callbacks ovcb = { + ovcb_read, + ovcb_seek, + ovcb_close, + ovcb_tell +}; + +static size_t ovcb_read(void *ptr, size_t size, size_t nmemb, void *ds) { + ogg2pcm_t *i = (ogg2pcm_t *)ds; + int len = MIN(size * nmemb, i->size - (i->cur - i->top)); + // fprintf(stderr, "my read %d, %d, %ld\n", size, nmemb, len); + + if (len < 0) len = 0; + + memcpy(ptr, i->cur, len); + i->cur += len; + return len; +} + +static int ovcb_seek(void *ds, ogg_int64_t offset, int whence) { + ogg2pcm_t *i = (ogg2pcm_t *)ds; + + switch(whence) { + case SEEK_SET: + i->cur = i->top + offset; + break; + case SEEK_CUR: + i->cur += offset; + break; + case SEEK_END: + i->cur = i->top + i->size + offset; + break; + } + return 0; +} + +static int ovcb_close(void *ds) { + g_free(ds); + return 0; +} + +static long ovcb_tell(void *ds) { + long off; + ogg2pcm_t *i = (ogg2pcm_t *)ds; + + off = i->cur - i->top; + // fprintf(stderr, "my tell %ld\n", off); + return off; +} + +WAVFILE *ogg_getinfo(char *data, long size) { + WAVFILE *wfile; + ogg2pcm_t *o2p; + OggVorbis_File *vf; + vorbis_info *vinfo; + + o2p = g_new(ogg2pcm_t, 1); + o2p->top = o2p->cur = data; + o2p->size = size; + + vf = g_new(OggVorbis_File, 1); + + if (0 > ov_open_callbacks(o2p, vf, NULL, 0, ovcb)) { + goto eexit; + } + wfile = g_new0(WAVFILE, 1); + + wfile->bytes = (int)ov_pcm_total(vf, -1); + vinfo = ov_info(vf, -1); + wfile->type = SND_OGG; + wfile->rate = vinfo->rate; + wfile->ch = vinfo->channels; + wfile->bits = 16; // ? + wfile->samples = wfile->bytes / (wfile->ch * 2); + wfile->data = vf; // とりあえず突っ込んどけ + + return wfile; + eexit: + g_free(vf); + g_free(o2p); + + return NULL; +} + + +static int ogg_read(musstream_t *this, void *ptr, int size, int nmemb) { + long len = size * nmemb; + long offset; + int current_section; + char *buf = ptr; + +#ifdef WORDS_BIGENDIAN + int be = 1; +#else + int be = 0; +#endif + + offset = 0; + + while(1) { + int ret = ov_read(this->hidden.ogg.vf, buf + offset, len, be, 2, 1, ¤t_section); + if (ret <= 0) break; + + len -= ret; + offset += ret; + } + + if (this->lrswap16) { + WORD d; + WORD *src = ptr; + int i, sample = offset / 4; + + for (i = 0; i < sample; i++) { + d = *src; + *src = *(src + 1); + *(src + 1) = d; + src += 2; + } + } + + return offset; +} + +static int ogg_seek(musstream_t *this, int offset, int whence) { + switch(whence) { + case SEEK_SET: + ov_pcm_seek(this->hidden.ogg.vf, offset); + break; + case SEEK_CUR: + break; + case SEEK_END: + break; + } + return OK; +} + +static int ogg_close(musstream_t *this) { + ov_clear(this->hidden.ogg.vf); + g_free(this); + return 0; +} + +musstream_t *ms_ogg(WAVFILE *wfile) { + musstream_t *ms = g_new0(musstream_t, 1); + + ms->hidden.ogg.vf = wfile->data; + + ms->read = ogg_read; + ms->seek = ogg_seek; + ms->close = ogg_close; + + return ms; +} diff --git a/src/musstream_wav.c b/src/musstream_wav.c new file mode 100644 index 0000000..195b32b --- /dev/null +++ b/src/musstream_wav.c @@ -0,0 +1,182 @@ +/* + * musstream_wav.c music strema for .wav file + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: musstream_wav.c,v 1.3 2003/08/22 17:09:23 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "musstream.h" +#include "wavfile.h" + +static int wav_read(musstream_t *this, void *ptr, int size, int nmemb) { + int len = MIN(size * nmemb, this->hidden.mem.end - this->hidden.mem.cur); + int i; + + if (len <= 0) return 0; + +#ifdef WORDS_BIGENDIAN + if (this->byteswap) { // 16bitのときのみ立てる + WORD *src = (WORD *)this->hidden.mem.cur; + WORD *dst = (WORD *)ptr; + int sample = len /2; + for (i = 0; i < sample; i++) { + *dst = GINT16_FROM_LE(*src); + src++; dst++; + } + } else +#endif + memcpy(ptr, this->hidden.mem.cur, len); + + if (this->lrswap8) { + BYTE d; + BYTE *src = ptr; + int sample = len / 2; + for (i = 0; i < sample; i++) { + d = *src; + *src = *(src + 1); + *(src + 1) = d; + src += 2; + } + } + + if (this->lrswap16) { + WORD d; + WORD *src = ptr; + int sample = len / 4; + for (i = 0; i < sample; i++) { + d = *src; + *src = *(src + 1); + *(src + 1) = d; + src += 2; + } + } + + this->hidden.mem.cur += len; + + return len; +} + +static int wav_seek(musstream_t *this, int offset, int whence) { + void *newpos = NULL; + + switch(whence) { + case SEEK_SET: + newpos = this->hidden.mem.base + offset; + break; + case SEEK_CUR: + newpos = this->hidden.mem.cur + offset; + break; + case SEEK_END: + newpos = this->hidden.mem.end + offset; + break; + } + + if (newpos < this->hidden.mem.base) { + newpos = this->hidden.mem.base; + } + if (newpos > this->hidden.mem.end) { + newpos = this->hidden.mem.end; + } + + this->hidden.mem.cur = newpos; + + return (this->hidden.mem.cur - this->hidden.mem.base); +} + +static int wav_seek2(struct _musstream *this, int offset, int where) { + void *newpos = NULL; + + switch(where) { + case SEEK_SET: + newpos = this->hidden.mem.lpp + offset; // うひひ + break; + case SEEK_CUR: + newpos = this->hidden.mem.cur + offset; + break; + case SEEK_END: + newpos = this->hidden.mem.end + offset; + break; + } + + if (newpos < this->hidden.mem.base) { + newpos = this->hidden.mem.lpp; + } + if (newpos > this->hidden.mem.end) { + newpos = this->hidden.mem.end; + } + + this->hidden.mem.cur = newpos; + + return (this->hidden.mem.cur - this->hidden.mem.base); +} + + +static int wav_close(musstream_t *this) { + g_free(this); + return 0; +} + + +musstream_t *ms_wav(WAVFILE *snd) { + musstream_t *ms = g_new0(musstream_t, 1); + + ms->hidden.mem.base = snd->data; + ms->hidden.mem.cur = snd->data; + ms->hidden.mem.end = snd->data + snd->bytes; + +#ifdef WORDS_BIGENDIAN + if (snd->bits == 16) { + ms->byteswap = TRUE; + } +#endif + ms->read = wav_read; + ms->seek = wav_seek; + ms->close = wav_close; + + return ms; +} + +musstream_t *ms_wav2(WAVFILE *snd, int size, int looptop) { + musstream_t *ms = g_new0(musstream_t, 1); + + ms->hidden.mem.base = snd->data; + ms->hidden.mem.cur = snd->data; + ms->hidden.mem.end = snd->data + size; + ms->hidden.mem.lpp = snd->data + looptop; + +#ifdef WORDS_BIGENDIAN + if (snd->bits == 16) { + ms->byteswap = TRUE; + } +#endif + ms->seek = wav_seek2; + ms->read = wav_read; + ms->close = wav_close; + + return ms; +} diff --git a/src/musstream_wav_ima.c b/src/musstream_wav_ima.c new file mode 100644 index 0000000..8741227 --- /dev/null +++ b/src/musstream_wav_ima.c @@ -0,0 +1,262 @@ +/* + * musstream_wav_ima.c music stream for .wav IMA ADPCM file (from sox/ima_rw.c) + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * Based on wavfile.c (c) Erik de Castro Lopo erikd@zip.com.au + * + * 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 + * +*/ +/* $Id: musstream_wav_ima.c,v 1.1 2003/11/09 15:06:13 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "musstream.h" +#include "wavfile.h" + +/* + * + * Lookup tables for IMA ADPCM format + * + */ +#define ISSTMAX 88 + +static const int imaStepSizeTable[ISSTMAX + 1] = { + 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, + 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, + 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, + 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, + 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, + 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, + 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, + 27086, 29794, 32767 +}; + +#define imaStateAdjust(c) (((c)<4)? -1:(2*(c)-6)) +/* +0 - +3, decrease step size */ +/* +4 - +7, increase step size */ +/* -0 - -3, decrease step size */ +/* -4 - -7, increase step size */ + +static unsigned char imaStateAdjustTable[ISSTMAX+1][8]; + +void Ima_initImaTable(void) { + int i, j, k; + for (i = 0; i <= ISSTMAX; i++) { + for (j = 0; j<8; j++) { + k = i + imaStateAdjust(j); + if (k < 0) k = 0; + else if (k > ISSTMAX) k = ISSTMAX; + imaStateAdjustTable[i][j] = k; + } + } +} + +static void ImaExpandS(int ch, int chans, const unsigned char *ibuff, short *obuff, int n, int o_inc) { + const unsigned char *ip; + int i_inc; + short *op; + int i, val, state; + + ip = ibuff + 4*ch; /* input pointer to 4-byte block state-initializer */ + i_inc = 4*(chans-1); /* amount by which to incr ip after each 4-byte read */ + val = (short)(ip[0] + (ip[1]<<8)); /* need cast for sign-extend */ + state = ip[2]; + if (state > ISSTMAX) { + fprintf(stderr, "IMA_ADPCM block ch%d initial-state (%d) out of range\n", ch, state); + state = 0; + } + /* specs say to ignore ip[3] , but write it as 0 */ + ip += 4+i_inc; + + op = obuff; + *op = val; /* 1st output sample for this channel */ + op += o_inc; + + for (i = 1; i < n; i++) { + int step,dp,c,cm; + + if (i&1) { /* 1st of pair */ + cm = *ip & 0x0f; + } else { + cm = (*ip++)>>4; + if ((i&7) == 0) /* ends the 8-sample input block for this channel */ + ip += i_inc; /* skip ip for next group */ + } + step = imaStepSizeTable[state]; + /* Update the state for the next sample */ + c = cm & 0x07; + state = imaStateAdjustTable[state][c]; + + dp = 0; + if (c & 4) dp += step; + step = step >> 1; + if (c & 2) dp += step; + step = step >> 1; + if (c & 1) dp += step; + step = step >> 1; + dp += step; + if (c != cm) { + val -= dp; + if (val<-0x8000) val = -0x8000; + } else { + val += dp; + if (val>0x7fff) val = 0x7fff; + } + *op = val; + op += o_inc; + } + return; +} + +int ImaBytesPerBlock(WORD chans, WORD samplesPerBlock) { + int n; + n = (samplesPerBlock + 14)/8 * 4 * chans; + return n; +} + +int ImaSamplesIn(int dataLen, WORD chans, WORD blockAlign, WORD samplesPerBlock) { + int n, m; + + if (samplesPerBlock) { + n = (dataLen / blockAlign) * samplesPerBlock; + m = (dataLen % blockAlign); + } else { + n = 0; + m = blockAlign; + } + if (m >= 4*chans) { + m -= 4 * chans; + m /= 4 * chans; + m = 8 * m + 1; + if (samplesPerBlock && m > samplesPerBlock) m = samplesPerBlock; + n += m; + } + return n; +} + +static int wav_read(musstream_t *this, void *ptr, int size, int nmemb) { + int len = MIN(size * nmemb, this->hidden.ima.end - this->hidden.ima.cur); + WAVFILE *w = (WAVFILE *)this->hidden.ima.wf; + char *obuff; + int i, offset = 0; + + if (len <= 0) return 0; + + obuff = (char *)ptr; + + if (this->hidden.ima.left < len) { + int n; + memcpy(obuff, this->hidden.ima.obufcur, this->hidden.ima.left); + offset += this->hidden.ima.left; + obuff += this->hidden.ima.left; + len -= this->hidden.ima.left; + n = w->samples_per_block; + ImaExpandS(0, 1, this->hidden.ima.cur, this->hidden.ima.obuf, n, 1); + this->hidden.ima.cur += w->bytes_per_block; + this->hidden.ima.obufcur = this->hidden.ima.obuf; + this->hidden.ima.left = n*2; + } + memcpy(obuff, this->hidden.ima.obufcur, len); + this->hidden.ima.left -= len; + this->hidden.ima.obufcur += len; + offset += len; + + if (this->lrswap8) { + BYTE d; + BYTE *src = ptr; + int sample = offset / 2; + for (i = 0; i < sample; i++) { + d = *src; + *src = *(src + 1); + *(src + 1) = d; + src += 2; + } + } + + if (this->lrswap16) { + WORD d; + WORD *src = ptr; + int sample = offset / 4; + for (i = 0; i < sample; i++) { + d = *src; + *src = *(src + 1); + *(src + 1) = d; + src += 2; + } + } + + return offset; +} + +static int wav_seek(musstream_t *this, int offset, int whence) { + void *newpos = NULL; + + switch(whence) { + case SEEK_SET: + newpos = this->hidden.ima.base + offset; + break; + case SEEK_CUR: + return 0; + case SEEK_END: + return 0; + } + + if (newpos < this->hidden.ima.base) { + newpos = this->hidden.ima.base; + } + if (newpos > this->hidden.ima.end) { + newpos = this->hidden.ima.end; + } + + this->hidden.ima.cur = newpos; + + return (this->hidden.ima.cur - this->hidden.ima.base); +} + +static int wav_close(musstream_t *this) { + g_free(this->hidden.ima.obuf); + g_free(this); + return 0; +} + +musstream_t *ms_wav_ima(WAVFILE *snd) { + musstream_t *ms = g_new0(musstream_t, 1); + + ms->hidden.ima.wf = snd; + ms->hidden.ima.base = snd->data; + ms->hidden.ima.cur = snd->data; + ms->hidden.ima.end = snd->data + snd->bytes; + ms->hidden.ima.obuf = g_malloc(snd->samples_per_block * 2); + ms->hidden.ima.obufcur = ms->hidden.ima.obuf; + ms->hidden.ima.left = 0; + + ms->read = wav_read; + ms->seek = wav_seek; + ms->close = wav_close; + + return ms; +} + diff --git a/src/nact.c b/src/nact.c new file mode 100644 index 0000000..138b5a1 --- /dev/null +++ b/src/nact.c @@ -0,0 +1,232 @@ +/* + * nact.c シナリオデータの解析 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: nact.c,v 1.24 2003/11/09 15:06:13 chikama Exp $ */ + +#include +#include +#include +#include + +#include "portab.h" +#include "scenario.h" +#include "xsystem35.h" +#include "ags.h" +#include "counter.h" +#include "nact.h" +#include "selection.h" +#include "message.h" +#include "imput.h" +#include "menu.h" + +/* + +SCOでのコード ZH 0 ZH 1 +半角カナ 全角平仮名 半角カナ +全角平仮名 全角平仮名 全角平仮名 +全角片仮名 全角片仮名 半角カナ + +MS コマンド: 表示時の ZH に依存, MS cali,str(:) のstrは常に全角文字が格納. +MG コマンド: 表示時の ZH に依存 + +*/ + +/* defined in hankaku.c */ +extern BYTE *zen2han(BYTE *src); +extern BYTE *han2zen(BYTE *src); +/* defined by hankan2sjis.c */ +extern char *hankana2sjis(int index); +/* defined by cmd_check.c */ +extern void check_command(int c0); +/* defined by cmdv.c */ +extern void va_animation(); +/* コマンド解析時の展開バッファ */ +static char msgbuf[512]; +/* 半角モード */ +static int msg_msgHankakuMode = 0; /* 0:全角 1:半角, 2: 無変換 */ + +/* ゲームシステム情報 */ +static NACTINFO nactprv; +NACTINFO *nact = &nactprv; + +/* メッセージの半角化 */ +void sys_setHankakuMode(int mode) { + msg_msgHankakuMode = mode; +} + +/* 文字列の取り出し */ +char *sys_getString(char term) { + int c0; + char *index = msgbuf; + + while ((c0 = sl_getc()) != (int)term) { + *index++ = c0; + } + *index = 0; + return msgbuf; +} + +/* 特殊 const string */ +char *sys_getConstString() { + int c0; + char *index = msgbuf; + + c0 = sl_getc(); + + while ((c0 = sl_getc()) != 0) { + *index++ = ((c0 & 0xf0) >> 4) + ((c0 & 0x0f) << 4); + } + + *index = 0; + return msgbuf; +} + +/* 加工済み(半カナ->全カナ) 文字列抽出 */ +char* sys_getConvString(char term) { + int c0; + char *index = msgbuf; + char *kindex; + + while ((c0 = sl_getc()) != (int)term) { + if (c0 == 0x20) { + *index++ = 0x81; *index++ = 0x40; + } else if (c0 >= 0xe0) { + *index++ = (char)c0; *index++ = (char)sl_getc(); + } else if (c0 >= 0xa0) { + kindex = hankana2sjis(c0); + *index++ = *kindex; *index++ = *(kindex+1); + } else { + *index++ = (char)c0; *index++ = (char)sl_getc(); + } + } + *index = 0; + return msgbuf; +} + +/* 選択肢・通常メッセージ振り分け */ +void sys_addMsg(char *str) { + char *msg = NULL; + + switch(msg_msgHankakuMode) { + case 0: + msg = han2zen(str); break; + case 1: + msg = zen2han(str); break; + case 2: + msg = str; break; + default: + return; + } + + if (nact->sel.in_setting) { + // 選択肢のバッファへ + sel_addElement(msg); + } else { + // 通常のメッセージ + DEBUG_MESSAGE("%s", msg); + if (nact->is_msg_out) { + msg_putMessage(msg); + } + if (nact->msgout) { + nact->msgout(msg); + } + } + + if (msg && msg_msgHankakuMode < 2) { + free(msg); + } +} + +/* 文字列抽出 */ +static int checkMessage() { + char *index = msgbuf; + int c0 = sl_getc(); + + while (c0 == 0x20 || c0 > 0x80) { + if (c0 == 0x20) { + *index++ = (char)c0; + } else if (c0 >= 0xe0) { + *index++ = (char)c0; *index++ = (char)sl_getc(); + } else if (c0 >= 0xa0) { + *index++ = (char)c0; + } else { + *index++ = (char)c0; *index++ = (char)sl_getc(); + } + c0 = sl_getc(); + } + if (index != msgbuf) { + *index = 0; + sys_addMsg(msgbuf); + } + return c0; +} + +#define MAINLOOP_EVENTCHECK_INTERVAL 16 /* 16 msec */ +void nact_main() { + int c0; + static int cnt = 0; + + reset_counter_high(SYSTEMCOUNTER_MSEC, 1, 0); + reset_counter_high(SYSTEMCOUNTER_MAINLOOP, MAINLOOP_EVENTCHECK_INTERVAL, 0); + + while (!nact->is_quit) { + DEBUG_MESSAGE("%d:%x\n", sl_getPage(), sl_getIndex()); + if (!nact->popupmenu_opened) { + c0 = checkMessage(); + check_command(c0); + } + if (!nact->is_message_locked) { + if (get_high_counter(SYSTEMCOUNTER_MAINLOOP)) { + sys_getInputInfo(); + reset_counter_high(SYSTEMCOUNTER_MAINLOOP, MAINLOOP_EVENTCHECK_INTERVAL, 0); + } + } + if (cnt == 10000) { + usleep(10); /* XXXX */ + cnt = 0; + } + cnt++; + nact->callback(); + } +} + +static void nact_callback() { + if (nact->is_va_animation) { + va_animation(); + } + if (nact->is_cursor_animation) { + /* cursor animation */ + } + if (nact->popupmenu_opened) { + menu_gtkmainiteration(); + if (nact->is_quit) sys_exit(0); + } +} + +void nact_init() { + nact->sys_mouse_movesw = 2; + nact->is_quit = FALSE; + nact->is_va_animation = FALSE; + nact->is_cursor_animation = FALSE; + nact->is_message_locked = FALSE; + nact->is_msg_out = TRUE; + nact->callback = nact_callback; +} diff --git a/src/nact.h b/src/nact.h new file mode 100644 index 0000000..4c7facb --- /dev/null +++ b/src/nact.h @@ -0,0 +1,149 @@ +/* + * nact.h NACT SYSTEM + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: nact.h,v 1.25 2003/11/09 15:06:13 chikama Exp $ */ + +#ifndef __NACT_H__ +#define __NACT_H__ + +#include "portab.h" +#include "graphics.h" +#include "scenario.h" +#include "font.h" +#include "s39ain.h" +#include "selection.h" +#include "message.h" +#include "ags.h" + +/* コマンド解析時に参照する */ +#define sys_getc sl_getc +#define sys_getw sl_getw +#define sys_getdw sl_getdw +#define sys_getaddress sl_getadr +#define sys_getCaliValue getCaliValue +#define sys_getCaliVariable getCaliVariable +extern int getCaliValue(); +extern int *getCaliVariable(); +extern int *getVariable(); +extern char *sys_getString(char term); +extern char *sys_getConvString(char term); +extern void sys_addMsg(char *str); +extern void sys_setHankakuMode(int mode); +extern char *sys_getConstString(); + +// extern boolean sys_nact_engine(); +extern void nact_main(); +extern void nact_init(); + +typedef struct { + /* general */ + boolean is_quit; /* quit command */ + void (*callback)(void); /* main の callback */ + boolean is_va_animation; /* VA command working */ + boolean is_cursor_animation; /* animation cursor working */ + boolean is_message_locked; /* pointer 等の event handler を呼び出さない */ + boolean popupmenu_opened; /* popup menu が 開いているか */ + boolean mmx_is_ok; /* MMX が有効かどうか */ + + char *tmpdir; + char game_title_name[31]; + int scenario_version; + + + /* variables */ + void *datatbl_addr; /* データテーブルのアドレス */ + int fnc_return_value; /* 関数の戻り値として返す値 (~0,cali:で渡す値) */ + +#if 1 + /* ags info */ + Pallet256 *sys_pal; + boolean sys_pal_changed; + MyRectangle sys_view_area; + MyDimension sys_world_size; + int sys_world_depth; + int sys_mouse_movesw; /* 0:IZを無視, 1: 直接指定場所へ, 2: スムーズに指定場所に */ + boolean sys_fullscreen_capable; + boolean sys_fullscreen_on; + +#endif + + /* for fader/ecopy */ + int effect_rate; + int effect_step; /* 0 to 255 , 0 と 255 は必ず通る*/ + + /* key wait */ + int waittime; + int waitcancel_key; + int waitcancel_key_mask; + boolean waitcancel_enabled; + + /* message wait */ + boolean messagewait_enable; + boolean messagewait_enable_save; + int messagewait_time; + boolean messagewait_cancel; + + + /* ags */ + ags_t ags; + boolean noantialias; /* antialias を使用しない */ + boolean noimagecursor; /* リソースファイルのカーソルを読みこまない */ + fontdev_t fontdev; // 選択された fontdevice + + /* メッセージ関連 */ + msg_t msg; + boolean is_msg_out; /* 通常メッセージを表示するか */ + void (*msgout)(char *msg); // 通常以外(DLL等)のメッセージ表示関数 + + /* 選択肢関連 */ + sel_t sel; + + /* patch 関連 */ + int patch_ec; /* see patch_ec command */ + int patch_emen; /* see patch_emen command */ + int patch_g0; /* see patch g0 command */ + + /* ain 関連 */ + S39AIN ain; + + /* データのファイル名 */ + struct { + char *scenario[2]; + char *graphics[2]; + char *wav[2]; + char *midi[2]; + char *data[2]; + char *resource[2]; + char *bgm[2]; + char *save[27]; + char *savedir; + char *init; + char *bgi; + char *wai; + char *sact01; + char *alk[10]; + } files; + +} NACTINFO; + +extern NACTINFO *nact; + +#endif /* __NACT_H__ */ diff --git a/src/nasm.h b/src/nasm.h new file mode 100644 index 0000000..b4e6451 --- /dev/null +++ b/src/nasm.h @@ -0,0 +1,178 @@ + +; Copyright (C) 1999 URURI + +; nasm用マクロ +; 1999/08/21 作成 +; 1999/10/10 幾つか追加 +; 1999/10/27 aout対応 +; 1999/11/07 pushf, popf のNASMのバグ対応 +; 1999/12/02 for BCC ( Thanks to Miquel ) + +; for Windows Visual C++ -> define WIN32 +; Borland or cygwin -> WIN32 and COFF +; for FreeBSD 2.x -> AOUT +; for TownsOS -> __tos__ +; otherwise -> none + +;名前の付け方 + +BITS 32 + +%ifdef WIN32 + %define _NAMING + %define segment_code segment .text align=16 class=CODE use32 + %define segment_data segment .data align=16 class=DATA use32 +%ifdef __BORLANDC__ + %define segment_bss segment .data align=16 class=DATA use32 +%else + %define segment_bss segment .bss align=16 class=DATA use32 +%endif +%elifdef AOUT + %define _NAMING + %define segment_code segment .text + %define segment_data segment .data + %define segment_bss segment .bss +%else + %define segment_code segment .text align=16 class=CODE use32 + %define segment_data segment .data align=16 class=DATA use32 + %define segment_bss segment .bss align=16 class=DATA use32 +%endif + +%ifdef __tos__ +group CGROUP text +group DGROUP data +%endif + +;単精度浮動小数点形式 + +%idefine float dword +%idefine fsize 4 +%idefine fsizen(a) (fsize*(a)) + +;ワード形式 + +%idefine wsize 2 +%idefine wsizen(a) (wsize*(a)) +%idefine dwsize 4 +%idefine dwsizen(a) (dwsize*(a)) + +;REG + +%define r0 eax +%define r1 ebx +%define r2 ecx +%define r3 edx +%define r4 esi +%define r5 edi +%define r6 ebp +%define r7 esp + +;MMX,3DNow!,SSE + +%define pmov movq +%define pmovd movd + +%define pupldq punpckldq +%define puphdq punpckhdq +%define puplwd punpcklwd +%define puphwd punpckhwd + +%define xm0 xmm0 +%define xm1 xmm1 +%define xm2 xmm2 +%define xm3 xmm3 +%define xm4 xmm4 +%define xm5 xmm5 +%define xm6 xmm6 +%define xm7 xmm7 + +;シャッフル用の4進マクロ + +%define R4(a,b,c,d) (a*64+b*16+c*4+d) + +;Cライクな簡易マクロ + +%imacro globaldef 1 + %ifdef _NAMING + %define %1 _%1 + %endif + global %1 +%endmacro + +%imacro externdef 1 + %ifdef _NAMING + %define %1 _%1 + %endif + extern %1 +%endmacro + +%imacro proc 1 + %push proc + %ifdef _NAMING + global _%1 + %else + global %1 + %endif + + align 32 +%1: +_%1: + + %assign %$STACK 0 + %assign %$STACKN 0 + %assign %$ARG 4 +%endmacro + +%imacro endproc 0 + %ifnctx proc + %error expected 'proc' before 'endproc'. + %else + %if %$STACK > 0 + add esp, %$STACK + %endif + + %if %$STACK <> (-%$STACKN) + %error STACKLEVEL mismatch check 'local', 'alloc', 'pushd', 'popd' + %endif + + ret + %pop + %endif +%endmacro + +%idefine sp(a) esp+%$STACK+a + +%imacro arg 1 + %00 equ %$ARG + %assign %$ARG %$ARG+%1 +%endmacro + +%imacro local 1 + %assign %$STACKN %$STACKN-%1 + %00 equ %$STACKN +%endmacro + +%imacro alloc 0 + sub esp, (-%$STACKN)-%$STACK + %assign %$STACK (-%$STACKN) +%endmacro + +%imacro pushd 1-* + %rep %0 + push %1 + %assign %$STACK %$STACK+4 + %rotate 1 + %endrep +%endmacro + +%imacro popd 1-* + %rep %0 + %rotate -1 + pop %1 + %assign %$STACK %$STACK-4 + %endrep +%endmacro + +; bug of NASM-0.98 +%define pushf db 0x66, 0x9C +%define popf db 0x66, 0x9D diff --git a/src/network.c b/src/network.c new file mode 100644 index 0000000..c9b7a66 --- /dev/null +++ b/src/network.c @@ -0,0 +1,54 @@ +/* + * network.c network main + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * +*/ +/* $Id: network.c,v 1.3 2000/11/25 13:09:11 chikama Exp $ */ + +#include "portab.h" +#include "network.h" + +int network_create_channel(int portnum, int use_max) { + return 0; +} + +void network_close(int user_num) { + +} + +int network_get_channel() { + return 0; +} + +int network_get_user_state(int num) { + return 0; +} + +int network_check_buffer() { + return 0; +} + +void network_read_buffer(int *var) { + +} + +void network_write_buffer(int *var, int cnt) { + +} diff --git a/src/network.h b/src/network.h new file mode 100644 index 0000000..a52d7f7 --- /dev/null +++ b/src/network.h @@ -0,0 +1,34 @@ +/* + * network.h network main + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: network.h,v 1.3 2000/11/25 13:09:12 chikama Exp $ */ +#ifndef __NETWORK_H__ +#define __NETWORK_H__ + +int network_create_channel(int portnum, int use_max); +void network_close(int user_num); +int network_get_channel(); +int network_get_user_state(int num); +int network_check_buffer(); +void network_read_buffer(int *var); +void network_write_buffer(int *var, int cnt); + +#endif /* __NETWORK_H__ */ diff --git a/src/pcmlib.c b/src/pcmlib.c new file mode 100644 index 0000000..c0f5be3 --- /dev/null +++ b/src/pcmlib.c @@ -0,0 +1,118 @@ +/* + * pcmlib.c PCM miscライブラリ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: pcmlib.c,v 1.8 2003/08/02 13:10:32 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "ald_manager.h" +#include "dri.h" +#include "wavfile.h" +#include "pcmlib.h" + +extern WAVFILE *ogg_getinfo(char *data, long size); + +/** + * noL と noR の .WAV をロードし、左右合成 + * + * @param noL: 左の WAV ファイルの番号 + * @param noR: 右の WAV ファイルの番号 + * @return : 合成後の WAVFILE データ + */ +WAVFILE *pcmlib_mixlr(int noL, int noR) { + WAVFILE *wfileL, *wfileR, *wfile; + + wfileL = pcmlib_load(noL); + wfileR = pcmlib_load(noR); + if (wfileL == NULL || wfileR == NULL) { + goto eexit; + } + + wfile = wav_mix(wfileL, wfileR); + if (wfile == NULL) { + goto eexit; + } + + pcmlib_free(wfileL); + pcmlib_free(wfileR); + + wfile->dfile = NULL; + + return wfile; + + eexit: + pcmlib_free(wfileL); + pcmlib_free(wfileR); + + return NULL; +} + +/** + * 指定の番号の .WAV|.OGG をロードする。 + * @param no: DRIファイル番号 + * @return: WAVFILE object + */ +WAVFILE *pcmlib_load(int no) { + dridata *dfile; + WAVFILE *wfile; + + dfile = ald_getdata(DRIFILE_WAVE, no -1); + if (dfile == NULL) { + WARNING("DRIFILE_WAVE fail to open %d\n", no -1); + return NULL; + } + + wfile = wav_getinfo(dfile->data); + if (wfile == NULL) { + wfile = ogg_getinfo(dfile->data, dfile->size); + if (wfile == NULL) { + WARNING("not .wav or .ogg file\n"); + ald_freedata(dfile); + return NULL; + } + } + + wfile->dfile = dfile; + + return wfile; +} + +/** + * pcmlib_{load|mixlr}で読み込んだWAVFILEの解放 + * @param wfile: 解放するデータ + * @return なし + */ +void pcmlib_free(WAVFILE *wfile) { + if (wfile == NULL) return; + + if (wfile->dfile) { + ald_freedata((dridata *)(wfile->dfile)); + } else { + g_free(wfile->data); + } + + g_free(wfile); +} diff --git a/src/pcmlib.h b/src/pcmlib.h new file mode 100644 index 0000000..84afec0 --- /dev/null +++ b/src/pcmlib.h @@ -0,0 +1,35 @@ +/* + * pcmlib.h PCM miscライブラリ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: pcmlib.h,v 1.4 2003/04/22 16:34:28 chikama Exp $ */ + +#ifndef __PCMLIB_H__ +#define __PCMLIB_H__ + +#include "wavfile.h" +#include "dri.h" + +extern WAVFILE *pcmlib_mixlr(int noL, int noR); +extern WAVFILE *pcmlib_load(int no); +extern void pcmlib_free(WAVFILE *wfile); + +#endif /*__PCM_LIB_H__ */ + diff --git a/src/pms.c b/src/pms.c new file mode 100644 index 0000000..9c9b47f --- /dev/null +++ b/src/pms.c @@ -0,0 +1,321 @@ +/* + * pms.c extract 8/16 bit PMS cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * pms256.c + * 0.00 97/11/06 初版 + * 0.01 97/11/13 ヘッダ情報の返しかたの変更 + * 0.01-01 97/11/27 記憶子の変更 + * 0.02 98/02/26 デバッグ完了 + * pms64k.c + * 0.00 97/11/06 初版 + * 0.01 97/11/13 ヘッダ情報の返しかたの変更 + * 0.02 98/02/26 デバッグ完了 + * 0.03 98/07/27 うそぷ〜。透明色の展開まずってた。 + * @version 1.1 00/09/17 rewrite for changeing interface +*/ +/* $Id: pms.c,v 1.2 2000/11/25 18:31:49 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "LittleEndian.h" +#include "graphics.h" +#include "cg.h" +#include "pms.h" + +/* + * static methods +*/ +static pms_header *extract_header(BYTE *b); +static void getpal(Pallet256 *pal, BYTE *b); +static void extract_8bit(pms_header *pms, BYTE *pic, BYTE *b); +static void extract_16bit(pms_header *pms, WORD *pic, BYTE *b); + +/* + * Get information from cg header + * b: raw data (pointer to header) + * return: acquired pms information object +*/ +static pms_header *extract_header(BYTE *b) { + pms_header *pms = g_new(pms_header, 1); + + pms->pmsVer = LittleEndian_getW(b, 2); + pms->pmsHdrSize = LittleEndian_getW(b, 4); + pms->pmsBpp = b[6]; + pms->pmsBppS = b[7]; + pms->pmsSf = b[8]; + pms->pmsBf = LittleEndian_getW(b, 10); + pms->pmsX0 = LittleEndian_getDW(b, 16); + pms->pmsY0 = LittleEndian_getDW(b, 20); + pms->pmsXW = LittleEndian_getDW(b, 24); + pms->pmsYW = LittleEndian_getDW(b, 28); + pms->pmsDp = LittleEndian_getDW(b, 32); + pms->pmsPp = LittleEndian_getDW(b, 36); + pms->pmsCp = LittleEndian_getDW(b, 40); + + return pms; +} + +/* + * Get pallet from raw data + * pal: pallet to be stored + * b : raw data (pointer to pallet) +*/ +static void getpal(Pallet256 *pal, BYTE *b) { + int i; + + for (i = 0; i < 256; i++) { + pal->red[i] = *b++; + pal->green[i] = *b++; + pal->blue[i] = *b++; + } +} + +/* + * Do extract 8bit pms image + * pms: pms header information + * pic: pixel to be stored + * b : raw data (pointer to pixel) +*/ +static void extract_8bit(pms_header *pms, BYTE *pic, BYTE *b) { + int c0, c1; + int x, y, loc, l, i; + int scanline = pms->pmsXW; + + for (y = 0; y < pms->pmsYW; y ++) { + for (x = 0; x < pms->pmsXW; ) { + loc = y * scanline + x; + c0 = *b++; + if (c0 <= 0xf7) { + *(pic + loc) = c0; x++; + } else if (c0 == 0xff) { + l = (*b) + 3; x+=l; b++; + memcpy(pic + loc, pic + loc - scanline, l); + } else if (c0 == 0xfe) { + l = (*b) + 3; x+=l; b++; + memcpy(pic + loc, pic + loc - scanline * 2, l); + } else if (c0 == 0xfd) { + l = (*b) + 4; x+=l; b++; + c0 = *b++; + memset(pic + loc, c0, l); + } else if (c0 == 0xfc) { + l = ((*b) + 3) * 2; x+=l; b++; + c0 = *b++; c1 = *b++; + for (i = 0; i < l; i+=2) { + *(pic + loc + i ) = c0; + *(pic + loc + i + 1) = c1; + } + } else { + *(pic + loc) = *b++; x++; + } + } + } +} + +/* + * Do extract 16bit pms image + * pms: pms header information + * pic: pixel to be stored + * b : raw data (pointer to pixel) +*/ +static void extract_16bit(pms_header *pms, WORD *pic, BYTE *b) { + int c0, c1, pc0, pc1; + int x, y, i, l, loc; + int scanline = pms->pmsXW; + + for (y = 0; y < pms->pmsYW; y++) { + for (x = 0; x < pms->pmsXW;) { + loc = y * scanline + x; + c0 = *b++; + if (c0 <= 0xf7) { + c1 = *b++; x++; + *(pic + loc) = c0 | (c1 << 8); + } else if (c0 == 0xff) { + l = (*b) + 2; x+=l; b++; + for (i = 0; i < l; i++) { + *(pic + loc + i) = *(pic + loc + i - scanline); + } + } else if (c0 == 0xfe) { + l = (*b) + 2; x+=l; b++; + for (i = 0; i < l; i++) { + *(pic + loc + i) = *(pic + loc + i - scanline * 2); + } + } else if (c0 == 0xfd) { + l = (*b) + 3; x+=l; b++; + c0 = *b++; c1 = *b++; + pc0 = c0 | (c1 << 8); + for (i = 0; i < l; i++) { + *(pic + loc + i) = pc0; + } + } else if (c0 == 0xfc) { + l = ((*b) + 2) * 2; x+=l; b++; + c0 = *b++; c1 = *b++; pc0 = c0 | (c1 << 8); + c0 = *b++; c1 = *b++; pc1 = c0 | (c1 << 8); + for (i = 0; i < l; i+=2) { + *(pic + loc + i ) = pc0; + *(pic + loc + i + 1) = pc1; + } + } else if (c0 == 0xfb) { + x++; + *(pic + loc) = *(pic + loc - scanline - 1); + } else if (c0 == 0xfa) { + x++; + *(pic + loc) = *(pic + loc - scanline + 1); + } else if (c0 == 0xf9) { + l = (*b) + 1; x+=l; b++; + c0 = *b++; c1 = *b++; + pc0 = ((c0 & 0xe0) << 8) + ((c0 & 0x18) << 6) + ((c0 & 0x07) << 2); + pc1 = ((c1 & 0xc0) << 5) + ((c1 & 0x3c) << 3) + (c1 & 0x03); + *(pic + loc) = pc0 + pc1; + for (i = 1; i < l; i++) { + c1 = *b++; + pc1 = ((c1 & 0xc0) << 5) + ((c1 & 0x3c) << 3) + (c1 & 0x03); + *(pic + loc + i) = pc0 | pc1; + } + } else { + c0 = *b++; c1 = *b++; x++; + *(pic + loc) = c0 | (c1 << 8); + } + } + } +} + +/* + * Check data is 8bit pms format cg or not + * data: raw data (pointer to data top) + * return: TRUE if data is pms +*/ +boolean pms256_checkfmt(BYTE *data) { + int x, y, w, h; + + if (data[0] != 0x50 || data[1] != 0x4d) return FALSE; + if (data[6] != 8) return FALSE; + + x = LittleEndian_getDW(data, 16); + y = LittleEndian_getDW(data, 20); + w = LittleEndian_getDW(data, 24); + h = LittleEndian_getDW(data, 28); + + if (x < 0 || y < 0 || w < 0 || h < 0) return FALSE; + + return TRUE; +} + +/* + * Extract 8bit pms, header, pallet and pixel + * data: raw data (pointer to data top) + * return: extracted image data and information +*/ +cgdata *pms256_extract(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + pms_header *pms = extract_header(data); + + cg->pal = g_new(Pallet256, 1); + getpal(cg->pal, data + pms->pmsPp); + + /* +10: margin for broken cg */ + cg->pic = g_new(BYTE, (pms->pmsXW + 10) * (pms->pmsYW + 10)); + extract_8bit(pms, cg->pic, data + pms->pmsDp); + + cg->type = ALCG_PMS8; + cg->x = pms->pmsX0; + cg->y = pms->pmsY0; + cg->width = pms->pmsXW; + cg->height = pms->pmsYW; + cg->pms_bank = pms->pmsBf; + cg->alpha = NULL; + + g_free(pms); + + return cg; +} + +/* + * Check data is 16bit pms format cg or not + * data: raw data (pointer to data top) + * return: TRUE if data is pms +*/ +boolean pms64k_checkfmt(BYTE *data) { + int x, y, w, h; + + if (data[0] != 0x50 || data[1] != 0x4d) return FALSE; + if (data[6] != 16) return FALSE; + + x = LittleEndian_getDW(data, 16); + y = LittleEndian_getDW(data, 20); + w = LittleEndian_getDW(data, 24); + h = LittleEndian_getDW(data, 28); + + if (x < 0 || y < 0 || w < 0 || h < 0) return FALSE; + + return TRUE; +} + +/* + * Extract 16bit pms, header, pallet and pixel + * data: raw data (pointer to data top) + * return: extracted image data and information +*/ +cgdata *pms64k_extract(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + pms_header *pms = extract_header(data); + + /* +10: margin for broken cg */ + cg->pic = (BYTE *)g_new(WORD, (pms->pmsXW + 10) * (pms->pmsYW + 10)); + extract_16bit(pms, (WORD *)cg->pic, data + pms->pmsDp); + + cg->alpha = NULL; + if (pms->pmsPp != 0) { + cg->alpha = g_new(BYTE, (pms->pmsXW + 10) * (pms->pmsYW + 10)); + extract_8bit(pms, cg->alpha, data + pms->pmsPp); + } + + cg->type = ALCG_PMS16; + cg->x = pms->pmsX0; + cg->y = pms->pmsY0; + cg->width = pms->pmsXW; + cg->height = pms->pmsYW; + cg->pal = NULL; + + g_free(pms); + + return cg; +} + +/* + * Extract pms pallet only + * data: raw data (pointer to data top) + * return: extracted pallet data +*/ +cgdata *pms_getpal(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + pms_header *pms = extract_header(data); + + cg->pal = g_new(Pallet256, 1); + getpal(cg->pal, data + pms->pmsPp); + + cg->type = ALCG_PMS8; + cg->pic = NULL; + cg->alpha = NULL; + + g_free(pms); + + return cg; +} diff --git a/src/pms.h b/src/pms.h new file mode 100644 index 0000000..cadb557 --- /dev/null +++ b/src/pms.h @@ -0,0 +1,69 @@ +/* + * pms.h extract 8/16 bit PMS cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * @version 1.1 00/09/17 rewrite for changeing interface +*/ +/* $Id: pms.h,v 1.1 2000/09/20 10:33:17 chikama Exp $ */ + +#ifndef __PMS__ +#define __PMS__ + +#include "portab.h" +#include "cg.h" + +typedef struct { + int pmsVer; /* pms data version */ + int pmsHdrSize; /* size of header */ + int pmsBpp; /* pms data depth, 8 or 16 */ + int pmsBppS; /* shadow data depth, if exists */ + int pmsSf; /* sprite flag (not used?) */ + int pmsBf; /* pallet bank */ + int pmsX0; /* display location x */ + int pmsY0; /* display location y */ + int pmsXW; /* image width */ + int pmsYW; /* image height */ + int pmsDp; /* pointer to data */ + int pmsPp; /* pointer to pallet or shadow */ + int pmsCp; /* pointer to comment */ +} pms_header; +/* + * pmsBppS + * If pmsBpp is 16 and pmsPp is not 0, shadow (alpha data) is exists and + * pmsBppS shows shadow's depth (normally 8). + * + * pmsBf + * If pmsBpp is 8, pmsBf determine which pallets is used in this data and + * needed to copy. The pmsBf is mask and if bit is on then copy. + * For example, if pmsBf=0xff00, then copy pal[128] ~ pal[255]. + * + * pmsPp + * If pmsBpp is 8 then this is pointer to pallet. If pmsBpp is 16 and + * pmsPp is not 0, then shadow is exists and this is pointer to it's data. + * +*/ + +extern boolean pms256_checkfmt(BYTE *data); +extern cgdata *pms256_extract(BYTE *data); +extern boolean pms64k_checkfmt(BYTE *data); +extern cgdata *pms64k_extract(BYTE *data); +extern cgdata *pms_getpal(BYTE *data); + +#endif /* !__PMS__ */ + diff --git a/src/portab.h b/src/portab.h new file mode 100644 index 0000000..d6a36a3 --- /dev/null +++ b/src/portab.h @@ -0,0 +1,100 @@ +/* + * portab.h 汎用定義 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: portab.h,v 1.20 2003/08/30 21:29:16 chikama Exp $ */ + +#ifndef __PORTAB__ +#define __PORTAB__ + +#include "config.h" + +#ifdef DMALLOC +#include +#endif + +#define YES 1 +#define NO 0 +#define OK 0 +#define ERROR (-1) +#define NG (-1) +#define true 1 +#define false 0 + +#ifndef FALSE +#define FALSE 0 +#undef TRUE +#define TRUE (!FALSE) +#endif + +#define min(x,y) ((x) < (y) ? (x) : (y)) +#define max(x,y) ((x) > (y) ? (x) : (y)) + +typedef unsigned char ___BYTE; +typedef unsigned short ___WORD; +typedef unsigned int ___DWORD; +typedef char ___boolean; + +#ifndef BYTE +#define BYTE ___BYTE +#endif + +#ifndef WORD +#define WORD ___WORD +#endif + +#ifndef DWORD +#define DWORD ___DWORD +#endif + +#ifndef boolean +#define boolean ___boolean +#endif + +/* + * Standard gettext macros. + */ +#ifdef ENABLE_NLS +# include +# undef _ +# define _(String) dgettext (PACKAGE, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + +#define swap16(a) ( (((a) & 0xff) << 8) | ((unsigned short)(a) >> 8) ) +#define swap32(a) ( ((a) << 24) | \ + (((a) << 8) & 0x00ff0000) | \ + (((a) >> 8) & 0x0000ff00) | \ + ((unsigned int)(a) >>24) ) + + +#endif /* !__PORTAB__ */ diff --git a/src/profile.c b/src/profile.c new file mode 100644 index 0000000..1c160f6 --- /dev/null +++ b/src/profile.c @@ -0,0 +1,158 @@ +/* + * profile.c rcfile analizer + * + * Original GICQ Copyright 1998 Sean Gabriel + * ja extension Patch Copyright Takashi Mizuhiki + * modified for xsystem35 Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: profile.c,v 1.6 2001/04/02 21:00:44 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include + +#include "profile.h" + +static char **profile_name = NULL, **profile_value = NULL; +static int profile_values = 0; +static int profile_ready = FALSE; + +int load_profile(char *path) +{ + FILE *fp = NULL; + char *home_dir = NULL, profile_path[PATH_MAX], rc_line[RC_LINE_CHARS_MAX]; + char *p, *q; + int now_values = 0, is_flag, line = 0; + + /* 指定の path をまず探す */ + if (path) { + + } else { + + } + + /* $(HOME)/.xsys35rc を探す */ + home_dir = getenv("HOME"); + if (home_dir) { + sprintf(profile_path, "%s/%s", home_dir, RC_NAME); + fp = fopen(profile_path, "r"); + } + + if (!fp) { + /* 見つからなかったら、CWD から .gicqjarc を探す */ + strcpy(profile_path, RC_NAME); + fp = fopen(RC_NAME, "r"); + if (!fp) { + /* CWD からも見つからなかったら、エラーを表示して終了 */ + char *error_msg; + error_msg = g_malloc(strlen(profile_path) + 12); + sprintf(error_msg, "fopen() '%s'", profile_path); + perror(error_msg); + g_free(error_msg); + return 1; + } + } + + while (1) { + if (!fgets(rc_line, sizeof(rc_line), fp)) { + if (feof(fp)) + break; + else { + perror("fgets()"); + return 1; + } + } + line++; + + /* 読み込んだ行をパースする */ + p = q = rc_line; + is_flag = FALSE; + + while (*q) { + if (*q == ':') + is_flag = TRUE; + + if (iscntrl(*q) || (is_flag == TRUE)?*q == '\n':isspace(*q)) + q++; + else + *p++ = *q++; + } + + *p = '\0'; + + /* 行頭が # だった場合と、空行の場合は記憶しない */ + if (rc_line[0] == '#' || rc_line[0] == '\0') + continue; + + if (!(p = strchr(rc_line, ':'))) { + fprintf(stderr, "XSYSTEM35: Syntax Error in '%s' line %d.\n", profile_path, line); + return 1; + } + + *p = '\0'; + + while (*++p) + if (!isspace(*p) && !iscntrl(*p)) + break; + + /* ANSI の realloc と glib の g_realloc は ptr に NULL ポインタが */ + /* 含まれていた場合の挙動が違うようだ */ + profile_name = realloc(profile_name, sizeof(char *) * (now_values + 1)); + if (!profile_name) { + perror("realloc()"); + return 1; + } + + profile_value = realloc(profile_value, sizeof(char *) * (now_values + 1)); + if (!profile_value) { + perror("realloc()"); + return 1; + } + + *(profile_name + now_values) = g_malloc(strlen(rc_line) + 1); + strcpy(*(profile_name + now_values), rc_line); + *(profile_value + now_values) = g_malloc(strlen(p) + 1); + strcpy(*(profile_value + now_values), p); + now_values++; + } + + profile_values = now_values; + profile_ready = TRUE; + return 0; +} + +char *get_profile(const char *name) +{ + int i; + + if (profile_ready == FALSE) + return NULL; + + for (i = 0; i < profile_values; i++) + if (strcmp(name, *(profile_name + i)) == 0) + break; + + if (i == profile_values) + return NULL; + + return *(profile_value + i); +} + diff --git a/src/profile.h b/src/profile.h new file mode 100644 index 0000000..0d7c019 --- /dev/null +++ b/src/profile.h @@ -0,0 +1,36 @@ +/* + * profile.h rcfile analizer + * + * Original GICQ Copyright 1998 Sean Gabriel + * ja extension Patch Copyright Takashi Mizuhiki + * modified for xsystem35 Masaki Chikama (Wren) + * + * 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 + * +*/ +/* $Id: profile.h,v 1.5 2001/03/13 18:01:17 chikama Exp $ */ + +#ifndef __PROFILE_H__ +#define __PROFILE_H__ + +#define RC_NAME ".xsys35rc" + +/* 一行は 256 文字を越えない */ +#define RC_LINE_CHARS_MAX 256 + +int load_profile(char *path); +char *get_profile(const char *name); + +#endif /* __PROFILE_H__ */ diff --git a/src/qnt.c b/src/qnt.c new file mode 100644 index 0000000..afcea7f --- /dev/null +++ b/src/qnt.c @@ -0,0 +1,263 @@ +/* + * qnt.c extract QNT cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * @version 1.0 01/07/30 initial version + * @version 1.1 01/08/10 fix alpha map extraction + * @version 1.2 01/11/26 zlibの展開バッファが画像サイズよりも大きなものを + * 要求するときの workaround + * @version 1.2 01/11/28 format version 1 に対応 + * *(top + 4) is 0 -> version 0 + * *(top + 4) is 1 -> version 1 + * @version 1.3 03/02/22 縦横奇数サイズ時にpixel/alphaともおかしかったのをfix + * zlib展開バッファを縦横それぞれ1byteづつ多くとる + * ようにした +*/ +/* $Id: qnt.c,v 1.4 2003/04/22 16:34:28 chikama Exp $ */ + +#include +#include + +#include "portab.h" +#include "LittleEndian.h" +#include "cg.h" +#include "qnt.h" +#include "system.h" + +/* + zlib の展開バッファで、幅×高さ×3に、さらにどれくらい余裕をとるか + (リクルスで 1164バイトというのがあった) +*/ +#define ZLIBBUF_MARGIN 5*1024 + +/* + static methods +*/ +static qnt_header *extract_header(BYTE *b); +static void extract_pixel(qnt_header *qnt, BYTE *pic, BYTE *b); +static void extract_alpha(qnt_header *qnt, BYTE *pic, BYTE *b); + + +/* + Get information from header + + b: raw data + + return: acquired qnt information object +*/ +static qnt_header *extract_header(BYTE *b) { + qnt_header *qnt = g_new(qnt_header, 1); + int rsv0; + + rsv0 = LittleEndian_getDW(b, 4); + if (rsv0 == 0) { + qnt->hdr_size = 48; + qnt->x0 = LittleEndian_getDW(b, 8); + qnt->y0 = LittleEndian_getDW(b, 12); + qnt->width = LittleEndian_getDW(b, 16); + qnt->height = LittleEndian_getDW(b, 20); + qnt->bpp = LittleEndian_getDW(b, 24); + qnt->rsv = LittleEndian_getDW(b, 28); + qnt->pixel_size = LittleEndian_getDW(b, 32); + qnt->alpha_size = LittleEndian_getDW(b, 36); + } else { + qnt->hdr_size = LittleEndian_getDW(b, 8); + qnt->x0 = LittleEndian_getDW(b, 12); + qnt->y0 = LittleEndian_getDW(b, 16); + qnt->width = LittleEndian_getDW(b, 20); + qnt->height = LittleEndian_getDW(b, 24); + qnt->bpp = LittleEndian_getDW(b, 28); + qnt->rsv = LittleEndian_getDW(b, 32); + qnt->pixel_size = LittleEndian_getDW(b, 36); + qnt->alpha_size = LittleEndian_getDW(b, 40); + } + + return qnt; +} + +/* + Do extract qnt pixel image + + qnt: qnt header information + pic: pixel to be stored + b : raw data (pointer to pixel) +*/ +static void extract_pixel(qnt_header *qnt, BYTE *pic, BYTE *b) { + int i, j, x, y, w, h; + long ucbuf = (qnt->width+1) * (qnt->height+1) * 3 + ZLIBBUF_MARGIN; + BYTE *raw = g_new(BYTE, ucbuf); + + if (Z_OK != uncompress(raw, &ucbuf, b, qnt->pixel_size)) { + WARNING("uncompress failed\n"); + g_free(raw); + return; + } + + w = qnt->width; + h = qnt->height; + + j = 0; + for (i = 2; i >= 0; i--) { + for (y = 0; y < (h -1); y+=2) { + for (x = 0; x < (w -1); x+=2) { + pic[( y *w+x) *3 +i] = raw[j]; + pic[((y+1)*w+x) *3 +i] = raw[j+1]; + pic[( y *w+x+1)*3 +i] = raw[j+2]; + pic[((y+1)*w+x+1)*3 +i] = raw[j+3]; + j+=4; + } + if (x != w) { + pic[( y *w+x)*3 +i] = raw[j]; + pic[((y+1)*w+x)*3 +i] = raw[j+1]; + j+=4; + } + } + if (y != h) { + for (x = 0; x < (w -1); x+=2) { + pic[(y*w+x )*3+i] = raw[j]; + pic[(y*w+x+1)*3+i] = raw[j+2]; + j+=4; + } + if (x != w) { + pic[( y *w+x)*3 +i] = raw[j]; + j+=4; + } + } + } + + if (w > 1) { + for (x = 1; x < w; x++) { + pic[x*3 ] = pic[(x-1)*3 ] - pic[x*3 ]; + pic[x*3+1] = pic[(x-1)*3+1] - pic[x*3+1]; + pic[x*3+2] = pic[(x-1)*3+2] - pic[x*3+2]; + } + } + + if (h > 1) { + for (y = 1; y < h; y++) { + pic[(y*w)*3 ] = pic[((y-1)*w)*3 ] - pic[(y*w)*3 ]; + pic[(y*w)*3+1] = pic[((y-1)*w)*3+1] - pic[(y*w)*3+1]; + pic[(y*w)*3+2] = pic[((y-1)*w)*3+2] - pic[(y*w)*3+2]; + + for (x = 1; x < w; x++) { + int px, py; + py = pic[((y-1)*w+x )*3]; + px = pic[( y *w+x-1)*3]; + pic[(y*w+x)*3] = ((py+px)>>1) - pic[(y*w+x)*3]; + py = pic[((y-1)*w+x )*3+1]; + px = pic[( y *w+x-1)*3+1]; + pic[(y*w+x)*3+1] = ((py+px)>>1) - pic[(y*w+x)*3+1]; + py = pic[((y-1)*w+x )*3+2]; + px = pic[( y *w+x-1)*3+2]; + pic[(y*w+x)*3+2] = ((py+px)>>1) - pic[(y*w+x)*3+2]; + } + } + } + + g_free(raw); +} + +/* + Do extract qnt alpha image + + qnt: qnt header information + pic: pixel to be stored + b : raw data (pointer to alpha pixel) +*/ +static void extract_alpha(qnt_header *qnt, BYTE *pic, BYTE *b) { + int i, x, y, w, h; + long ucbuf = (qnt->width+1) * (qnt->height+1) + ZLIBBUF_MARGIN; + BYTE *raw = g_new(BYTE, ucbuf); + + if (Z_OK != uncompress(raw, &ucbuf, b, qnt->alpha_size)) { + WARNING("uncompress failed\n"); + g_free(raw); + return; + } + + w = qnt->width; + h = qnt->height; + + i = 1; + if (w > 1) { + pic[0] = raw[0]; + for (x = 1; x < w; x++) { + pic[x] = pic[x-1] - raw[i]; + i++; + } + if (w%2) i++; + } + + if (h > 1) { + for (y = 1; y < h; y++) { + pic[y*w] = pic[(y-1) *w] - raw[i]; i++; + for (x = 1; x < w; x++) { + int pax, pay; + pax = pic[ y * w + x -1]; + pay = pic[(y-1)* w + x ]; + pic[y*w+x] = ((pax+pay) >> 1) - raw[i]; + i++; + } + if (w%2) i++; + } + } + + g_free(raw); +} + +/* + Check data is qnt format cg or not + + data: raw data (pointer to data top) + + return: TRUE if data is qnt +*/ +boolean qnt_checkfmt(BYTE *data) { + if (data[0] != 'Q' || data[1] != 'N' || data[2] != 'T') return FALSE; + return TRUE; +} + +/* + Extract qnt header and pixel + + data: raw data (pointer to data top) + + return: extracted image data and information +*/ +cgdata *qnt_extract(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + qnt_header *qnt = extract_header(data); + + cg->pic = g_new(BYTE, (qnt->width+10) * (qnt->height+10) * 3); + extract_pixel(qnt, cg->pic, data + qnt->hdr_size); + + if (qnt->alpha_size != 0) { + cg->alpha = g_new(BYTE, (qnt->width+10) * (qnt->height+10)); + extract_alpha(qnt, (BYTE *)cg->alpha, data + qnt->hdr_size + qnt->pixel_size); + } + + cg->type = ALCG_QNT; + cg->x = qnt->x0; + cg->y = qnt->y0; + cg->width = qnt->width; + cg->height = qnt->height; + cg->pal = NULL; + + return cg; +} diff --git a/src/qnt.h b/src/qnt.h new file mode 100644 index 0000000..2c9f490 --- /dev/null +++ b/src/qnt.h @@ -0,0 +1,47 @@ +/* + * qnt.h extract QNT cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * @version 1.0 01/07/30 initial version + * @version 1.1 01/11/28 add header size information +*/ +/* $Id: qnt.h,v 1.2 2001/11/29 11:21:44 chikama Exp $ */ + +#ifndef __QNT_H__ +#define __QNT_H__ + +#include "portab.h" +#include "cg.h" + +typedef struct { + int hdr_size; /* header size */ + int x0; /* display location x */ + int y0; /* display location y */ + int width; /* image width */ + int height; /* image height */ + int bpp; /* image data depth */ + int rsv; /* reserved data */ + int pixel_size; /* compressed pixel size */ + int alpha_size; /* compressed alpha pixel size */ +} qnt_header; + +extern boolean qnt_checkfmt(BYTE *data); +extern cgdata *qnt_extract(BYTE *data); + +#endif /* __QNT_H__ */ diff --git a/src/randMT.h b/src/randMT.h new file mode 100644 index 0000000..588bec5 --- /dev/null +++ b/src/randMT.h @@ -0,0 +1,11 @@ +/* + A C-program for MT19937: Real number version interface +*/ + +#ifndef __RANDMT__ +#define __RANDMT__ + +extern double genrand(); +extern void sgenrand(unsigned long seed); + +#endif /* __RANDMT__ */ diff --git a/src/s2utbl.h b/src/s2utbl.h new file mode 100644 index 0000000..edf9cbe --- /dev/null +++ b/src/s2utbl.h @@ -0,0 +1,1682 @@ +unsigned short s2u_80[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_81[]={ + 0x3000,0x3001,0x3002,0xFF0C,0xFF0E,0x30FB,0xFF1A,0xFF1B, + 0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E, + 0xFFE3,0xFF3F,0x30FD,0x30FE,0x309D,0x309E,0x3003,0x4EDD, + 0x3005,0x3006,0x3007,0x30FC,0x2015,0x2010,0xFF0F,0xFF3C, + 0xFF5E,0x2225,0xFF5C,0x2026,0x2025,0x2018,0x2019,0x201C, + 0x201D,0xFF08,0xFF09,0x3014,0x3015,0xFF3B,0xFF3D,0xFF5B, + 0xFF5D,0x3008,0x3009,0x300A,0x300B,0x300C,0x300D,0x300E, + 0x300F,0x3010,0x3011,0xFF0B,0xFF0D,0x00B1,0x00D7,0x30FB, + 0x00F7,0xFF1D,0x2260,0xFF1C,0xFF1E,0x2266,0x2267,0x221E, + 0x2234,0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFFE5, + 0xFF04,0xFFE0,0xFFE1,0xFF05,0xFF03,0xFF06,0xFF0A,0xFF20, + 0x00A7,0x2606,0x2605,0x25CB,0x25CF,0x25CE,0x25C7,0x25C6, + 0x25A1,0x25A0,0x25B3,0x25B2,0x25BD,0x25BC,0x203B,0x3012, + 0x2192,0x2190,0x2191,0x2193,0x3013,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x2208,0x220B,0x2286,0x2287,0x2282,0x2283,0x222A,0x2229, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x2227,0x2228,0xFFE2,0x21D2,0x21D4,0x2200,0x2203,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x2220,0x22A5,0x2312,0x2202,0x2207,0x2261, + 0x2252,0x226A,0x226B,0x221A,0x223D,0x221D,0x2235,0x222B, + 0x222C,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x212B,0x2030,0x266F,0x266D,0x266A,0x2020,0x2021,0x00B6, + 0x30FB,0x30FB,0x30FB,0x30FB,0x25EF,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_82[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0xFF10, + 0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18, + 0xFF19,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28, + 0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30, + 0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38, + 0xFF39,0xFF3A,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47, + 0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F, + 0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57, + 0xFF58,0xFF59,0xFF5A,0x30FB,0x30FB,0x30FB,0x30FB,0x3041, + 0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048,0x3049, + 0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050,0x3051, + 0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058,0x3059, + 0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060,0x3061, + 0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068,0x3069, + 0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070,0x3071, + 0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078,0x3079, + 0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080,0x3081, + 0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088,0x3089, + 0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090,0x3091, + 0x3092,0x3093,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_83[]={ + 0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, + 0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, + 0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, + 0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, + 0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, + 0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, + 0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, + 0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF,0x30FB, + 0x30E0,0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7, + 0x30E8,0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF, + 0x30F0,0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x0391, + 0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398,0x0399, + 0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0,0x03A1, + 0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x03B1, + 0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8,0x03B9, + 0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0,0x03C1, + 0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_84[]={ + 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, + 0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, + 0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, + 0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, + 0x042F,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, + 0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x30FB, + 0x043E,0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445, + 0x0446,0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D, + 0x044E,0x044F,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x2500, + 0x2502,0x250C,0x2510,0x2518,0x2514,0x251C,0x252C,0x2524, + 0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B,0x2517, + 0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F,0x2528, + 0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_85[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_86[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_87[]={ + 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, + 0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, + 0x2470,0x2471,0x2472,0x2473,0x2160,0x2161,0x2162,0x2163, + 0x2164,0x2165,0x2166,0x2167,0x2168,0x2169,0x30FB,0x3349, + 0x3314,0x3322,0x334D,0x3318,0x3327,0x3303,0x3336,0x3351, + 0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,0x333B,0x339C, + 0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x337B,0x30FB, + 0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6, + 0x32A7,0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C, + 0x2252,0x2261,0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220, + 0x221F,0x22BF,0x2235,0x2229,0x222A,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_88[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x4E9C, + 0x5516,0x5A03,0x963F,0x54C0,0x611B,0x6328,0x59F6,0x9022, + 0x8475,0x831C,0x7A50,0x60AA,0x63E1,0x6E25,0x65ED,0x8466, + 0x82A6,0x9BF5,0x6893,0x5727,0x65A1,0x6271,0x5B9B,0x59D0, + 0x867B,0x98F4,0x7D62,0x7DBE,0x9B8E,0x6216,0x7C9F,0x88B7, + 0x5B89,0x5EB5,0x6309,0x6697,0x6848,0x95C7,0x978D,0x674F, + 0x4EE5,0x4F0A,0x4F4D,0x4F9D,0x5049,0x56F2,0x5937,0x59D4, + 0x5A01,0x5C09,0x60DF,0x610F,0x6170,0x6613,0x6905,0x70BA, + 0x754F,0x7570,0x79FB,0x7DAD,0x7DEF,0x80C3,0x840E,0x8863, + 0x8B02,0x9055,0x907A,0x533B,0x4E95,0x4EA5,0x57DF,0x80B2, + 0x90C1,0x78EF,0x4E00,0x58F1,0x6EA2,0x9038,0x7A32,0x8328, + 0x828B,0x9C2F,0x5141,0x5370,0x54BD,0x54E1,0x56E0,0x59FB, + 0x5F15,0x98F2,0x6DEB,0x80E4,0x852D,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_89[]={ + 0x9662,0x9670,0x96A0,0x97FB,0x540B,0x53F3,0x5B87,0x70CF, + 0x7FBD,0x8FC2,0x96E8,0x536F,0x9D5C,0x7ABA,0x4E11,0x7893, + 0x81FC,0x6E26,0x5618,0x5504,0x6B1D,0x851A,0x9C3B,0x59E5, + 0x53A9,0x6D66,0x74DC,0x958F,0x5642,0x4E91,0x904B,0x96F2, + 0x834F,0x990C,0x53E1,0x55B6,0x5B30,0x5F71,0x6620,0x66F3, + 0x6804,0x6C38,0x6CF3,0x6D29,0x745B,0x76C8,0x7A4E,0x9834, + 0x82F1,0x885B,0x8A60,0x92ED,0x6DB2,0x75AB,0x76CA,0x99C5, + 0x60A6,0x8B01,0x8D8A,0x95B2,0x698E,0x53AD,0x5186,0x30FB, + 0x5712,0x5830,0x5944,0x5BB4,0x5EF6,0x6028,0x63A9,0x63F4, + 0x6CBF,0x6F14,0x708E,0x7114,0x7159,0x71D5,0x733F,0x7E01, + 0x8276,0x82D1,0x8597,0x9060,0x925B,0x9D1B,0x5869,0x65BC, + 0x6C5A,0x7525,0x51F9,0x592E,0x5965,0x5F80,0x5FDC,0x62BC, + 0x65FA,0x6A2A,0x6B27,0x6BB4,0x738B,0x7FC1,0x8956,0x9D2C, + 0x9D0E,0x9EC4,0x5CA1,0x6C96,0x837B,0x5104,0x5C4B,0x61B6, + 0x81C6,0x6876,0x7261,0x4E59,0x4FFA,0x5378,0x6069,0x6E29, + 0x7A4F,0x97F3,0x4E0B,0x5316,0x4EEE,0x4F55,0x4F3D,0x4FA1, + 0x4F73,0x52A0,0x53EF,0x5609,0x590F,0x5AC1,0x5BB6,0x5BE1, + 0x79D1,0x6687,0x679C,0x67B6,0x6B4C,0x6CB3,0x706B,0x73C2, + 0x798D,0x79BE,0x7A3C,0x7B87,0x82B1,0x82DB,0x8304,0x8377, + 0x83EF,0x83D3,0x8766,0x8AB2,0x5629,0x8CA8,0x8FE6,0x904E, + 0x971E,0x868A,0x4FC4,0x5CE8,0x6211,0x7259,0x753B,0x81E5, + 0x82BD,0x86FE,0x8CC0,0x96C5,0x9913,0x99D5,0x4ECB,0x4F1A, + 0x89E3,0x56DE,0x584A,0x58CA,0x5EFB,0x5FEB,0x602A,0x6094, + 0x6062,0x61D0,0x6212,0x62D0,0x6539,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_8a[]={ + 0x9B41,0x6666,0x68B0,0x6D77,0x7070,0x754C,0x7686,0x7D75, + 0x82A5,0x87F9,0x958B,0x968E,0x8C9D,0x51F1,0x52BE,0x5916, + 0x54B3,0x5BB3,0x5D16,0x6168,0x6982,0x6DAF,0x788D,0x84CB, + 0x8857,0x8A72,0x93A7,0x9AB8,0x6D6C,0x99A8,0x86D9,0x57A3, + 0x67FF,0x86CE,0x920E,0x5283,0x5687,0x5404,0x5ED3,0x62E1, + 0x64B9,0x683C,0x6838,0x6BBB,0x7372,0x78BA,0x7A6B,0x899A, + 0x89D2,0x8D6B,0x8F03,0x90ED,0x95A3,0x9694,0x9769,0x5B66, + 0x5CB3,0x697D,0x984D,0x984E,0x639B,0x7B20,0x6A2B,0x30FB, + 0x6A7F,0x68B6,0x9C0D,0x6F5F,0x5272,0x559D,0x6070,0x62EC, + 0x6D3B,0x6E07,0x6ED1,0x845B,0x8910,0x8F44,0x4E14,0x9C39, + 0x53F6,0x691B,0x6A3A,0x9784,0x682A,0x515C,0x7AC3,0x84B2, + 0x91DC,0x938C,0x565B,0x9D28,0x6822,0x8305,0x8431,0x7CA5, + 0x5208,0x82C5,0x74E6,0x4E7E,0x4F83,0x51A0,0x5BD2,0x520A, + 0x52D8,0x52E7,0x5DFB,0x559A,0x582A,0x59E6,0x5B8C,0x5B98, + 0x5BDB,0x5E72,0x5E79,0x60A3,0x611F,0x6163,0x61BE,0x63DB, + 0x6562,0x67D1,0x6853,0x68FA,0x6B3E,0x6B53,0x6C57,0x6F22, + 0x6F97,0x6F45,0x74B0,0x7518,0x76E3,0x770B,0x7AFF,0x7BA1, + 0x7C21,0x7DE9,0x7F36,0x7FF0,0x809D,0x8266,0x839E,0x89B3, + 0x8ACC,0x8CAB,0x9084,0x9451,0x9593,0x9591,0x95A2,0x9665, + 0x97D3,0x9928,0x8218,0x4E38,0x542B,0x5CB8,0x5DCC,0x73A9, + 0x764C,0x773C,0x5CA9,0x7FEB,0x8D0B,0x96C1,0x9811,0x9854, + 0x9858,0x4F01,0x4F0E,0x5371,0x559C,0x5668,0x57FA,0x5947, + 0x5B09,0x5BC4,0x5C90,0x5E0C,0x5E7E,0x5FCC,0x63EE,0x673A, + 0x65D7,0x65E2,0x671F,0x68CB,0x68C4,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_8b[]={ + 0x6A5F,0x5E30,0x6BC5,0x6C17,0x6C7D,0x757F,0x7948,0x5B63, + 0x7A00,0x7D00,0x5FBD,0x898F,0x8A18,0x8CB4,0x8D77,0x8ECC, + 0x8F1D,0x98E2,0x9A0E,0x9B3C,0x4E80,0x507D,0x5100,0x5993, + 0x5B9C,0x622F,0x6280,0x64EC,0x6B3A,0x72A0,0x7591,0x7947, + 0x7FA9,0x87FB,0x8ABC,0x8B70,0x63AC,0x83CA,0x97A0,0x5409, + 0x5403,0x55AB,0x6854,0x6A58,0x8A70,0x7827,0x6775,0x9ECD, + 0x5374,0x5BA2,0x811A,0x8650,0x9006,0x4E18,0x4E45,0x4EC7, + 0x4F11,0x53CA,0x5438,0x5BAE,0x5F13,0x6025,0x6551,0x30FB, + 0x673D,0x6C42,0x6C72,0x6CE3,0x7078,0x7403,0x7A76,0x7AAE, + 0x7B08,0x7D1A,0x7CFE,0x7D66,0x65E7,0x725B,0x53BB,0x5C45, + 0x5DE8,0x62D2,0x62E0,0x6319,0x6E20,0x865A,0x8A31,0x8DDD, + 0x92F8,0x6F01,0x79A6,0x9B5A,0x4EA8,0x4EAB,0x4EAC,0x4F9B, + 0x4FA0,0x50D1,0x5147,0x7AF6,0x5171,0x51F6,0x5354,0x5321, + 0x537F,0x53EB,0x55AC,0x5883,0x5CE1,0x5F37,0x5F4A,0x602F, + 0x6050,0x606D,0x631F,0x6559,0x6A4B,0x6CC1,0x72C2,0x72ED, + 0x77EF,0x80F8,0x8105,0x8208,0x854E,0x90F7,0x93E1,0x97FF, + 0x9957,0x9A5A,0x4EF0,0x51DD,0x5C2D,0x6681,0x696D,0x5C40, + 0x66F2,0x6975,0x7389,0x6850,0x7C81,0x50C5,0x52E4,0x5747, + 0x5DFE,0x9326,0x65A4,0x6B23,0x6B3D,0x7434,0x7981,0x79BD, + 0x7B4B,0x7DCA,0x82B9,0x83CC,0x887F,0x895F,0x8B39,0x8FD1, + 0x91D1,0x541F,0x9280,0x4E5D,0x5036,0x53E5,0x533A,0x72D7, + 0x7396,0x77E9,0x82E6,0x8EAF,0x99C6,0x99C8,0x99D2,0x5177, + 0x611A,0x865E,0x55B0,0x7A7A,0x5076,0x5BD3,0x9047,0x9685, + 0x4E32,0x6ADB,0x91E7,0x5C51,0x5C48,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_8c[]={ + 0x6398,0x7A9F,0x6C93,0x9774,0x8F61,0x7AAA,0x718A,0x9688, + 0x7C82,0x6817,0x7E70,0x6851,0x936C,0x52F2,0x541B,0x85AB, + 0x8A13,0x7FA4,0x8ECD,0x90E1,0x5366,0x8888,0x7941,0x4FC2, + 0x50BE,0x5211,0x5144,0x5553,0x572D,0x73EA,0x578B,0x5951, + 0x5F62,0x5F84,0x6075,0x6176,0x6167,0x61A9,0x63B2,0x643A, + 0x656C,0x666F,0x6842,0x6E13,0x7566,0x7A3D,0x7CFB,0x7D4C, + 0x7D99,0x7E4B,0x7F6B,0x830E,0x834A,0x86CD,0x8A08,0x8A63, + 0x8B66,0x8EFD,0x981A,0x9D8F,0x82B8,0x8FCE,0x9BE8,0x30FB, + 0x5287,0x621F,0x6483,0x6FC0,0x9699,0x6841,0x5091,0x6B20, + 0x6C7A,0x6F54,0x7A74,0x7D50,0x8840,0x8A23,0x6708,0x4EF6, + 0x5039,0x5026,0x5065,0x517C,0x5238,0x5263,0x55A7,0x570F, + 0x5805,0x5ACC,0x5EFA,0x61B2,0x61F8,0x62F3,0x6372,0x691C, + 0x6A29,0x727D,0x72AC,0x732E,0x7814,0x786F,0x7D79,0x770C, + 0x80A9,0x898B,0x8B19,0x8CE2,0x8ED2,0x9063,0x9375,0x967A, + 0x9855,0x9A13,0x9E78,0x5143,0x539F,0x53B3,0x5E7B,0x5F26, + 0x6E1B,0x6E90,0x7384,0x73FE,0x7D43,0x8237,0x8A00,0x8AFA, + 0x9650,0x4E4E,0x500B,0x53E4,0x547C,0x56FA,0x59D1,0x5B64, + 0x5DF1,0x5EAB,0x5F27,0x6238,0x6545,0x67AF,0x6E56,0x72D0, + 0x7CCA,0x88B4,0x80A1,0x80E1,0x83F0,0x864E,0x8A87,0x8DE8, + 0x9237,0x96C7,0x9867,0x9F13,0x4E94,0x4E92,0x4F0D,0x5348, + 0x5449,0x543E,0x5A2F,0x5F8C,0x5FA1,0x609F,0x68A7,0x6A8E, + 0x745A,0x7881,0x8A9E,0x8AA4,0x8B77,0x9190,0x4E5E,0x9BC9, + 0x4EA4,0x4F7C,0x4FAF,0x5019,0x5016,0x5149,0x516C,0x529F, + 0x52B9,0x52FE,0x539A,0x53E3,0x5411,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_8d[]={ + 0x540E,0x5589,0x5751,0x57A2,0x597D,0x5B54,0x5B5D,0x5B8F, + 0x5DE5,0x5DE7,0x5DF7,0x5E78,0x5E83,0x5E9A,0x5EB7,0x5F18, + 0x6052,0x614C,0x6297,0x62D8,0x63A7,0x653B,0x6602,0x6643, + 0x66F4,0x676D,0x6821,0x6897,0x69CB,0x6C5F,0x6D2A,0x6D69, + 0x6E2F,0x6E9D,0x7532,0x7687,0x786C,0x7A3F,0x7CE0,0x7D05, + 0x7D18,0x7D5E,0x7DB1,0x8015,0x8003,0x80AF,0x80B1,0x8154, + 0x818F,0x822A,0x8352,0x884C,0x8861,0x8B1B,0x8CA2,0x8CFC, + 0x90CA,0x9175,0x9271,0x783F,0x92FC,0x95A4,0x964D,0x30FB, + 0x9805,0x9999,0x9AD8,0x9D3B,0x525B,0x52AB,0x53F7,0x5408, + 0x58D5,0x62F7,0x6FE0,0x8C6A,0x8F5F,0x9EB9,0x514B,0x523B, + 0x544A,0x56FD,0x7A40,0x9177,0x9D60,0x9ED2,0x7344,0x6F09, + 0x8170,0x7511,0x5FFD,0x60DA,0x9AA8,0x72DB,0x8FBC,0x6B64, + 0x9803,0x4ECA,0x56F0,0x5764,0x58BE,0x5A5A,0x6068,0x61C7, + 0x660F,0x6606,0x6839,0x68B1,0x6DF7,0x75D5,0x7D3A,0x826E, + 0x9B42,0x4E9B,0x4F50,0x53C9,0x5506,0x5D6F,0x5DE6,0x5DEE, + 0x67FB,0x6C99,0x7473,0x7802,0x8A50,0x9396,0x88DF,0x5750, + 0x5EA7,0x632B,0x50B5,0x50AC,0x518D,0x6700,0x54C9,0x585E, + 0x59BB,0x5BB0,0x5F69,0x624D,0x63A1,0x683D,0x6B73,0x6E08, + 0x707D,0x91C7,0x7280,0x7815,0x7826,0x796D,0x658E,0x7D30, + 0x83DC,0x88C1,0x8F09,0x969B,0x5264,0x5728,0x6750,0x7F6A, + 0x8CA1,0x51B4,0x5742,0x962A,0x583A,0x698A,0x80B4,0x54B2, + 0x5D0E,0x57FC,0x7895,0x9DFA,0x4F5C,0x524A,0x548B,0x643E, + 0x6628,0x6714,0x67F5,0x7A84,0x7B56,0x7D22,0x932F,0x685C, + 0x9BAD,0x7B39,0x5319,0x518A,0x5237,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_8e[]={ + 0x5BDF,0x62F6,0x64AE,0x64E6,0x672D,0x6BBA,0x85A9,0x96D1, + 0x7690,0x9BD6,0x634C,0x9306,0x9BAB,0x76BF,0x6652,0x4E09, + 0x5098,0x53C2,0x5C71,0x60E8,0x6492,0x6563,0x685F,0x71E6, + 0x73CA,0x7523,0x7B97,0x7E82,0x8695,0x8B83,0x8CDB,0x9178, + 0x9910,0x65AC,0x66AB,0x6B8B,0x4ED5,0x4ED4,0x4F3A,0x4F7F, + 0x523A,0x53F8,0x53F2,0x55E3,0x56DB,0x58EB,0x59CB,0x59C9, + 0x59FF,0x5B50,0x5C4D,0x5E02,0x5E2B,0x5FD7,0x601D,0x6307, + 0x652F,0x5B5C,0x65AF,0x65BD,0x65E8,0x679D,0x6B62,0x30FB, + 0x6B7B,0x6C0F,0x7345,0x7949,0x79C1,0x7CF8,0x7D19,0x7D2B, + 0x80A2,0x8102,0x81F3,0x8996,0x8A5E,0x8A69,0x8A66,0x8A8C, + 0x8AEE,0x8CC7,0x8CDC,0x96CC,0x98FC,0x6B6F,0x4E8B,0x4F3C, + 0x4F8D,0x5150,0x5B57,0x5BFA,0x6148,0x6301,0x6642,0x6B21, + 0x6ECB,0x6CBB,0x723E,0x74BD,0x75D4,0x78C1,0x793A,0x800C, + 0x8033,0x81EA,0x8494,0x8F9E,0x6C50,0x9E7F,0x5F0F,0x8B58, + 0x9D2B,0x7AFA,0x8EF8,0x5B8D,0x96EB,0x4E03,0x53F1,0x57F7, + 0x5931,0x5AC9,0x5BA4,0x6089,0x6E7F,0x6F06,0x75BE,0x8CEA, + 0x5B9F,0x8500,0x7BE0,0x5072,0x67F4,0x829D,0x5C61,0x854A, + 0x7E1E,0x820E,0x5199,0x5C04,0x6368,0x8D66,0x659C,0x716E, + 0x793E,0x7D17,0x8005,0x8B1D,0x8ECA,0x906E,0x86C7,0x90AA, + 0x501F,0x52FA,0x5C3A,0x6753,0x707C,0x7235,0x914C,0x91C8, + 0x932B,0x82E5,0x5BC2,0x5F31,0x60F9,0x4E3B,0x53D6,0x5B88, + 0x624B,0x6731,0x6B8A,0x72E9,0x73E0,0x7A2E,0x816B,0x8DA3, + 0x9152,0x9996,0x5112,0x53D7,0x546A,0x5BFF,0x6388,0x6A39, + 0x7DAC,0x9700,0x56DA,0x53CE,0x5468,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_8f[]={ + 0x5B97,0x5C31,0x5DDE,0x4FEE,0x6101,0x62FE,0x6D32,0x79C0, + 0x79CB,0x7D42,0x7E4D,0x7FD2,0x81ED,0x821F,0x8490,0x8846, + 0x8972,0x8B90,0x8E74,0x8F2F,0x9031,0x914B,0x916C,0x96C6, + 0x919C,0x4EC0,0x4F4F,0x5145,0x5341,0x5F93,0x620E,0x67D4, + 0x6C41,0x6E0B,0x7363,0x7E26,0x91CD,0x9283,0x53D4,0x5919, + 0x5BBF,0x6DD1,0x795D,0x7E2E,0x7C9B,0x587E,0x719F,0x51FA, + 0x8853,0x8FF0,0x4FCA,0x5CFB,0x6625,0x77AC,0x7AE3,0x821C, + 0x99FF,0x51C6,0x5FAA,0x65EC,0x696F,0x6B89,0x6DF3,0x30FB, + 0x6E96,0x6F64,0x76FE,0x7D14,0x5DE1,0x9075,0x9187,0x9806, + 0x51E6,0x521D,0x6240,0x6691,0x66D9,0x6E1A,0x5EB6,0x7DD2, + 0x7F72,0x66F8,0x85AF,0x85F7,0x8AF8,0x52A9,0x53D9,0x5973, + 0x5E8F,0x5F90,0x6055,0x92E4,0x9664,0x50B7,0x511F,0x52DD, + 0x5320,0x5347,0x53EC,0x54E8,0x5546,0x5531,0x5617,0x5968, + 0x59BE,0x5A3C,0x5BB5,0x5C06,0x5C0F,0x5C11,0x5C1A,0x5E84, + 0x5E8A,0x5EE0,0x5F70,0x627F,0x6284,0x62DB,0x638C,0x6377, + 0x6607,0x660C,0x662D,0x6676,0x677E,0x68A2,0x6A1F,0x6A35, + 0x6CBC,0x6D88,0x6E09,0x6E58,0x713C,0x7126,0x7167,0x75C7, + 0x7701,0x785D,0x7901,0x7965,0x79F0,0x7AE0,0x7B11,0x7CA7, + 0x7D39,0x8096,0x83D6,0x848B,0x8549,0x885D,0x88F3,0x8A1F, + 0x8A3C,0x8A54,0x8A73,0x8C61,0x8CDE,0x91A4,0x9266,0x937E, + 0x9418,0x969C,0x9798,0x4E0A,0x4E08,0x4E1E,0x4E57,0x5197, + 0x5270,0x57CE,0x5834,0x58CC,0x5B22,0x5E38,0x60C5,0x64FE, + 0x6761,0x6756,0x6D44,0x72B6,0x7573,0x7A63,0x84B8,0x8B72, + 0x91B8,0x9320,0x5631,0x57F4,0x98FE,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_90[]={ + 0x62ED,0x690D,0x6B96,0x71ED,0x7E54,0x8077,0x8272,0x89E6, + 0x98DF,0x8755,0x8FB1,0x5C3B,0x4F38,0x4FE1,0x4FB5,0x5507, + 0x5A20,0x5BDD,0x5BE9,0x5FC3,0x614E,0x632F,0x65B0,0x664B, + 0x68EE,0x699B,0x6D78,0x6DF1,0x7533,0x75B9,0x771F,0x795E, + 0x79E6,0x7D33,0x81E3,0x82AF,0x85AA,0x89AA,0x8A3A,0x8EAB, + 0x8F9B,0x9032,0x91DD,0x9707,0x4EBA,0x4EC1,0x5203,0x5875, + 0x58EC,0x5C0B,0x751A,0x5C3D,0x814E,0x8A0A,0x8FC5,0x9663, + 0x976D,0x7B25,0x8ACF,0x9808,0x9162,0x56F3,0x53A8,0x30FB, + 0x9017,0x5439,0x5782,0x5E25,0x63A8,0x6C34,0x708A,0x7761, + 0x7C8B,0x7FE0,0x8870,0x9042,0x9154,0x9310,0x9318,0x968F, + 0x745E,0x9AC4,0x5D07,0x5D69,0x6570,0x67A2,0x8DA8,0x96DB, + 0x636E,0x6749,0x6919,0x83C5,0x9817,0x96C0,0x88FE,0x6F84, + 0x647A,0x5BF8,0x4E16,0x702C,0x755D,0x662F,0x51C4,0x5236, + 0x52E2,0x59D3,0x5F81,0x6027,0x6210,0x653F,0x6574,0x661F, + 0x6674,0x68F2,0x6816,0x6B63,0x6E05,0x7272,0x751F,0x76DB, + 0x7CBE,0x8056,0x58F0,0x88FD,0x897F,0x8AA0,0x8A93,0x8ACB, + 0x901D,0x9192,0x9752,0x9759,0x6589,0x7A0E,0x8106,0x96BB, + 0x5E2D,0x60DC,0x621A,0x65A5,0x6614,0x6790,0x77F3,0x7A4D, + 0x7C4D,0x7E3E,0x810A,0x8CAC,0x8D64,0x8DE1,0x8E5F,0x78A9, + 0x5207,0x62D9,0x63A5,0x6442,0x6298,0x8A2D,0x7A83,0x7BC0, + 0x8AAC,0x96EA,0x7D76,0x820C,0x8749,0x4ED9,0x5148,0x5343, + 0x5360,0x5BA3,0x5C02,0x5C16,0x5DDD,0x6226,0x6247,0x64B0, + 0x6813,0x6834,0x6CC9,0x6D45,0x6D17,0x67D3,0x6F5C,0x714E, + 0x717D,0x65CB,0x7A7F,0x7BAD,0x7DDA,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_91[]={ + 0x7E4A,0x7FA8,0x817A,0x821B,0x8239,0x85A6,0x8A6E,0x8CCE, + 0x8DF5,0x9078,0x9077,0x92AD,0x9291,0x9583,0x9BAE,0x524D, + 0x5584,0x6F38,0x7136,0x5168,0x7985,0x7E55,0x81B3,0x7CCE, + 0x564C,0x5851,0x5CA8,0x63AA,0x66FE,0x66FD,0x695A,0x72D9, + 0x758F,0x758E,0x790E,0x7956,0x79DF,0x7C97,0x7D20,0x7D44, + 0x8607,0x8A34,0x963B,0x9061,0x9F20,0x50E7,0x5275,0x53CC, + 0x53E2,0x5009,0x55AA,0x58EE,0x594F,0x723D,0x5B8B,0x5C64, + 0x531D,0x60E3,0x60F3,0x635C,0x6383,0x633F,0x63BB,0x30FB, + 0x64CD,0x65E9,0x66F9,0x5DE3,0x69CD,0x69FD,0x6F15,0x71E5, + 0x4E89,0x75E9,0x76F8,0x7A93,0x7CDF,0x7DCF,0x7D9C,0x8061, + 0x8349,0x8358,0x846C,0x84BC,0x85FB,0x88C5,0x8D70,0x9001, + 0x906D,0x9397,0x971C,0x9A12,0x50CF,0x5897,0x618E,0x81D3, + 0x8535,0x8D08,0x9020,0x4FC3,0x5074,0x5247,0x5373,0x606F, + 0x6349,0x675F,0x6E2C,0x8DB3,0x901F,0x4FD7,0x5C5E,0x8CCA, + 0x65CF,0x7D9A,0x5352,0x8896,0x5176,0x63C3,0x5B58,0x5B6B, + 0x5C0A,0x640D,0x6751,0x905C,0x4ED6,0x591A,0x592A,0x6C70, + 0x8A51,0x553E,0x5815,0x59A5,0x60F0,0x6253,0x67C1,0x8235, + 0x6955,0x9640,0x99C4,0x9A28,0x4F53,0x5806,0x5BFE,0x8010, + 0x5CB1,0x5E2F,0x5F85,0x6020,0x614B,0x6234,0x66FF,0x6CF0, + 0x6EDE,0x80CE,0x817F,0x82D4,0x888B,0x8CB8,0x9000,0x902E, + 0x968A,0x9EDB,0x9BDB,0x4EE3,0x53F0,0x5927,0x7B2C,0x918D, + 0x984C,0x9DF9,0x6EDD,0x7027,0x5353,0x5544,0x5B85,0x6258, + 0x629E,0x62D3,0x6CA2,0x6FEF,0x7422,0x8A17,0x9438,0x6FC1, + 0x8AFE,0x8338,0x51E7,0x86F8,0x53EA,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_92[]={ + 0x53E9,0x4F46,0x9054,0x8FB0,0x596A,0x8131,0x5DFD,0x7AEA, + 0x8FBF,0x68DA,0x8C37,0x72F8,0x9C48,0x6A3D,0x8AB0,0x4E39, + 0x5358,0x5606,0x5766,0x62C5,0x63A2,0x65E6,0x6B4E,0x6DE1, + 0x6E5B,0x70AD,0x77ED,0x7AEF,0x7BAA,0x7DBB,0x803D,0x80C6, + 0x86CB,0x8A95,0x935B,0x56E3,0x58C7,0x5F3E,0x65AD,0x6696, + 0x6A80,0x6BB5,0x7537,0x8AC7,0x5024,0x77E5,0x5730,0x5F1B, + 0x6065,0x667A,0x6C60,0x75F4,0x7A1A,0x7F6E,0x81F4,0x8718, + 0x9045,0x99B3,0x7BC9,0x755C,0x7AF9,0x7B51,0x84C4,0x30FB, + 0x9010,0x79E9,0x7A92,0x8336,0x5AE1,0x7740,0x4E2D,0x4EF2, + 0x5B99,0x5FE0,0x62BD,0x663C,0x67F1,0x6CE8,0x866B,0x8877, + 0x8A3B,0x914E,0x92F3,0x99D0,0x6A17,0x7026,0x732A,0x82E7, + 0x8457,0x8CAF,0x4E01,0x5146,0x51CB,0x558B,0x5BF5,0x5E16, + 0x5E33,0x5E81,0x5F14,0x5F35,0x5F6B,0x5FB4,0x61F2,0x6311, + 0x66A2,0x671D,0x6F6E,0x7252,0x753A,0x773A,0x8074,0x8139, + 0x8178,0x8776,0x8ABF,0x8ADC,0x8D85,0x8DF3,0x929A,0x9577, + 0x9802,0x9CE5,0x52C5,0x6357,0x76F4,0x6715,0x6C88,0x73CD, + 0x8CC3,0x93AE,0x9673,0x6D25,0x589C,0x690E,0x69CC,0x8FFD, + 0x939A,0x75DB,0x901A,0x585A,0x6802,0x63B4,0x69FB,0x4F43, + 0x6F2C,0x67D8,0x8FBB,0x8526,0x7DB4,0x9354,0x693F,0x6F70, + 0x576A,0x58F7,0x5B2C,0x7D2C,0x722A,0x540A,0x91E3,0x9DB4, + 0x4EAD,0x4F4E,0x505C,0x5075,0x5243,0x8C9E,0x5448,0x5824, + 0x5B9A,0x5E1D,0x5E95,0x5EAD,0x5EF7,0x5F1F,0x608C,0x62B5, + 0x633A,0x63D0,0x68AF,0x6C40,0x7887,0x798E,0x7A0B,0x7DE0, + 0x8247,0x8A02,0x8AE6,0x8E44,0x9013,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_93[]={ + 0x90B8,0x912D,0x91D8,0x9F0E,0x6CE5,0x6458,0x64E2,0x6575, + 0x6EF4,0x7684,0x7B1B,0x9069,0x93D1,0x6EBA,0x54F2,0x5FB9, + 0x64A4,0x8F4D,0x8FED,0x9244,0x5178,0x586B,0x5929,0x5C55, + 0x5E97,0x6DFB,0x7E8F,0x751C,0x8CBC,0x8EE2,0x985B,0x70B9, + 0x4F1D,0x6BBF,0x6FB1,0x7530,0x96FB,0x514E,0x5410,0x5835, + 0x5857,0x59AC,0x5C60,0x5F92,0x6597,0x675C,0x6E21,0x767B, + 0x83DF,0x8CED,0x9014,0x90FD,0x934D,0x7825,0x783A,0x52AA, + 0x5EA6,0x571F,0x5974,0x6012,0x5012,0x515A,0x51AC,0x30FB, + 0x51CD,0x5200,0x5510,0x5854,0x5858,0x5957,0x5B95,0x5CF6, + 0x5D8B,0x60BC,0x6295,0x642D,0x6771,0x6843,0x68BC,0x68DF, + 0x76D7,0x6DD8,0x6E6F,0x6D9B,0x706F,0x71C8,0x5F53,0x75D8, + 0x7977,0x7B49,0x7B54,0x7B52,0x7CD6,0x7D71,0x5230,0x8463, + 0x8569,0x85E4,0x8A0E,0x8B04,0x8C46,0x8E0F,0x9003,0x900F, + 0x9419,0x9676,0x982D,0x9A30,0x95D8,0x50CD,0x52D5,0x540C, + 0x5802,0x5C0E,0x61A7,0x649E,0x6D1E,0x77B3,0x7AE5,0x80F4, + 0x8404,0x9053,0x9285,0x5CE0,0x9D07,0x533F,0x5F97,0x5FB3, + 0x6D9C,0x7279,0x7763,0x79BF,0x7BE4,0x6BD2,0x72EC,0x8AAD, + 0x6803,0x6A61,0x51F8,0x7A81,0x6934,0x5C4A,0x9CF6,0x82EB, + 0x5BC5,0x9149,0x701E,0x5678,0x5C6F,0x60C7,0x6566,0x6C8C, + 0x8C5A,0x9041,0x9813,0x5451,0x66C7,0x920D,0x5948,0x90A3, + 0x5185,0x4E4D,0x51EA,0x8599,0x8B0E,0x7058,0x637A,0x934B, + 0x6962,0x99B4,0x7E04,0x7577,0x5357,0x6960,0x8EDF,0x96E3, + 0x6C5D,0x4E8C,0x5C3C,0x5F10,0x8FE9,0x5302,0x8CD1,0x8089, + 0x8679,0x5EFF,0x65E5,0x4E73,0x5165,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_94[]={ + 0x5982,0x5C3F,0x97EE,0x4EFB,0x598A,0x5FCD,0x8A8D,0x6FE1, + 0x79B0,0x7962,0x5BE7,0x8471,0x732B,0x71B1,0x5E74,0x5FF5, + 0x637B,0x649A,0x71C3,0x7C98,0x4E43,0x5EFC,0x4E4B,0x57DC, + 0x56A2,0x60A9,0x6FC3,0x7D0D,0x80FD,0x8133,0x81BF,0x8FB2, + 0x8997,0x86A4,0x5DF4,0x628A,0x64AD,0x8987,0x6777,0x6CE2, + 0x6D3E,0x7436,0x7834,0x5A46,0x7F75,0x82AD,0x99AC,0x4FF3, + 0x5EC3,0x62DD,0x6392,0x6557,0x676F,0x76C3,0x724C,0x80CC, + 0x80BA,0x8F29,0x914D,0x500D,0x57F9,0x5A92,0x6885,0x30FB, + 0x6973,0x7164,0x72FD,0x8CB7,0x58F2,0x8CE0,0x966A,0x9019, + 0x877F,0x79E4,0x77E7,0x8429,0x4F2F,0x5265,0x535A,0x62CD, + 0x67CF,0x6CCA,0x767D,0x7B94,0x7C95,0x8236,0x8584,0x8FEB, + 0x66DD,0x6F20,0x7206,0x7E1B,0x83AB,0x99C1,0x9EA6,0x51FD, + 0x7BB1,0x7872,0x7BB8,0x8087,0x7B48,0x6AE8,0x5E61,0x808C, + 0x7551,0x7560,0x516B,0x9262,0x6E8C,0x767A,0x9197,0x9AEA, + 0x4F10,0x7F70,0x629C,0x7B4F,0x95A5,0x9CE9,0x567A,0x5859, + 0x86E4,0x96BC,0x4F34,0x5224,0x534A,0x53CD,0x53DB,0x5E06, + 0x642C,0x6591,0x677F,0x6C3E,0x6C4E,0x7248,0x72AF,0x73ED, + 0x7554,0x7E41,0x822C,0x85E9,0x8CA9,0x7BC4,0x91C6,0x7169, + 0x9812,0x98EF,0x633D,0x6669,0x756A,0x76E4,0x78D0,0x8543, + 0x86EE,0x532A,0x5351,0x5426,0x5983,0x5E87,0x5F7C,0x60B2, + 0x6249,0x6279,0x62AB,0x6590,0x6BD4,0x6CCC,0x75B2,0x76AE, + 0x7891,0x79D8,0x7DCB,0x7F77,0x80A5,0x88AB,0x8AB9,0x8CBB, + 0x907F,0x975E,0x98DB,0x6A0B,0x7C38,0x5099,0x5C3E,0x5FAE, + 0x6787,0x6BD8,0x7435,0x7709,0x7F8E,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_95[]={ + 0x9F3B,0x67CA,0x7A17,0x5339,0x758B,0x9AED,0x5F66,0x819D, + 0x83F1,0x8098,0x5F3C,0x5FC5,0x7562,0x7B46,0x903C,0x6867, + 0x59EB,0x5A9B,0x7D10,0x767E,0x8B2C,0x4FF5,0x5F6A,0x6A19, + 0x6C37,0x6F02,0x74E2,0x7968,0x8868,0x8A55,0x8C79,0x5EDF, + 0x63CF,0x75C5,0x79D2,0x82D7,0x9328,0x92F2,0x849C,0x86ED, + 0x9C2D,0x54C1,0x5F6C,0x658C,0x6D5C,0x7015,0x8CA7,0x8CD3, + 0x983B,0x654F,0x74F6,0x4E0D,0x4ED8,0x57E0,0x592B,0x5A66, + 0x5BCC,0x51A8,0x5E03,0x5E9C,0x6016,0x6276,0x6577,0x30FB, + 0x65A7,0x666E,0x6D6E,0x7236,0x7B26,0x8150,0x819A,0x8299, + 0x8B5C,0x8CA0,0x8CE6,0x8D74,0x961C,0x9644,0x4FAE,0x64AB, + 0x6B66,0x821E,0x8461,0x856A,0x90E8,0x5C01,0x6953,0x98A8, + 0x847A,0x8557,0x4F0F,0x526F,0x5FA9,0x5E45,0x670D,0x798F, + 0x8179,0x8907,0x8986,0x6DF5,0x5F17,0x6255,0x6CB8,0x4ECF, + 0x7269,0x9B92,0x5206,0x543B,0x5674,0x58B3,0x61A4,0x626E, + 0x711A,0x596E,0x7C89,0x7CDE,0x7D1B,0x96F0,0x6587,0x805E, + 0x4E19,0x4F75,0x5175,0x5840,0x5E63,0x5E73,0x5F0A,0x67C4, + 0x4E26,0x853D,0x9589,0x965B,0x7C73,0x9801,0x50FB,0x58C1, + 0x7656,0x78A7,0x5225,0x77A5,0x8511,0x7B86,0x504F,0x5909, + 0x7247,0x7BC7,0x7DE8,0x8FBA,0x8FD4,0x904D,0x4FBF,0x52C9, + 0x5A29,0x5F01,0x97AD,0x4FDD,0x8217,0x92EA,0x5703,0x6355, + 0x6B69,0x752B,0x88DC,0x8F14,0x7A42,0x52DF,0x5893,0x6155, + 0x620A,0x66AE,0x6BCD,0x7C3F,0x83E9,0x5023,0x4FF8,0x5305, + 0x5446,0x5831,0x5949,0x5B9D,0x5CF0,0x5CEF,0x5D29,0x5E96, + 0x62B1,0x6367,0x653E,0x65B9,0x670B,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_96[]={ + 0x6CD5,0x6CE1,0x70F9,0x7832,0x7E2B,0x80DE,0x82B3,0x840C, + 0x84EC,0x8702,0x8912,0x8A2A,0x8C4A,0x90A6,0x92D2,0x98FD, + 0x9CF3,0x9D6C,0x4E4F,0x4EA1,0x508D,0x5256,0x574A,0x59A8, + 0x5E3D,0x5FD8,0x5FD9,0x623F,0x66B4,0x671B,0x67D0,0x68D2, + 0x5192,0x7D21,0x80AA,0x81A8,0x8B00,0x8C8C,0x8CBF,0x927E, + 0x9632,0x5420,0x982C,0x5317,0x50D5,0x535C,0x58A8,0x64B2, + 0x6734,0x7267,0x7766,0x7A46,0x91E6,0x52C3,0x6CA1,0x6B86, + 0x5800,0x5E4C,0x5954,0x672C,0x7FFB,0x51E1,0x76C6,0x30FB, + 0x6469,0x78E8,0x9B54,0x9EBB,0x57CB,0x59B9,0x6627,0x679A, + 0x6BCE,0x54E9,0x69D9,0x5E55,0x819C,0x6795,0x9BAA,0x67FE, + 0x9C52,0x685D,0x4EA6,0x4FE3,0x53C8,0x62B9,0x672B,0x6CAB, + 0x8FC4,0x4FAD,0x7E6D,0x9EBF,0x4E07,0x6162,0x6E80,0x6F2B, + 0x8513,0x5473,0x672A,0x9B45,0x5DF3,0x7B95,0x5CAC,0x5BC6, + 0x871C,0x6E4A,0x84D1,0x7A14,0x8108,0x5999,0x7C8D,0x6C11, + 0x7720,0x52D9,0x5922,0x7121,0x725F,0x77DB,0x9727,0x9D61, + 0x690B,0x5A7F,0x5A18,0x51A5,0x540D,0x547D,0x660E,0x76DF, + 0x8FF7,0x9298,0x9CF4,0x59EA,0x725D,0x6EC5,0x514D,0x68C9, + 0x7DBF,0x7DEC,0x9762,0x9EBA,0x6478,0x6A21,0x8302,0x5984, + 0x5B5F,0x6BDB,0x731B,0x76F2,0x7DB2,0x8017,0x8499,0x5132, + 0x6728,0x9ED9,0x76EE,0x6762,0x52FF,0x9905,0x5C24,0x623B, + 0x7C7E,0x8CB0,0x554F,0x60B6,0x7D0B,0x9580,0x5301,0x4E5F, + 0x51B6,0x591C,0x723A,0x8036,0x91CE,0x5F25,0x77E2,0x5384, + 0x5F79,0x7D04,0x85AC,0x8A33,0x8E8D,0x9756,0x67F3,0x85AE, + 0x9453,0x6109,0x6108,0x6CB9,0x7652,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_97[]={ + 0x8AED,0x8F38,0x552F,0x4F51,0x512A,0x52C7,0x53CB,0x5BA5, + 0x5E7D,0x60A0,0x6182,0x63D6,0x6709,0x67DA,0x6E67,0x6D8C, + 0x7336,0x7337,0x7531,0x7950,0x88D5,0x8A98,0x904A,0x9091, + 0x90F5,0x96C4,0x878D,0x5915,0x4E88,0x4F59,0x4E0E,0x8A89, + 0x8F3F,0x9810,0x50AD,0x5E7C,0x5996,0x5BB9,0x5EB8,0x63DA, + 0x63FA,0x64C1,0x66DC,0x694A,0x69D8,0x6D0B,0x6EB6,0x7194, + 0x7528,0x7AAF,0x7F8A,0x8000,0x8449,0x84C9,0x8981,0x8B21, + 0x8E0A,0x9065,0x967D,0x990A,0x617E,0x6291,0x6B32,0x30FB, + 0x6C83,0x6D74,0x7FCC,0x7FFC,0x6DC0,0x7F85,0x87BA,0x88F8, + 0x6765,0x83B1,0x983C,0x96F7,0x6D1B,0x7D61,0x843D,0x916A, + 0x4E71,0x5375,0x5D50,0x6B04,0x6FEB,0x85CD,0x862D,0x89A7, + 0x5229,0x540F,0x5C65,0x674E,0x68A8,0x7406,0x7483,0x75E2, + 0x88CF,0x88E1,0x91CC,0x96E2,0x9678,0x5F8B,0x7387,0x7ACB, + 0x844E,0x63A0,0x7565,0x5289,0x6D41,0x6E9C,0x7409,0x7559, + 0x786B,0x7C92,0x9686,0x7ADC,0x9F8D,0x4FB6,0x616E,0x65C5, + 0x865C,0x4E86,0x4EAE,0x50DA,0x4E21,0x51CC,0x5BEE,0x6599, + 0x6881,0x6DBC,0x731F,0x7642,0x77AD,0x7A1C,0x7CE7,0x826F, + 0x8AD2,0x907C,0x91CF,0x9675,0x9818,0x529B,0x7DD1,0x502B, + 0x5398,0x6797,0x6DCB,0x71D0,0x7433,0x81E8,0x8F2A,0x96A3, + 0x9C57,0x9E9F,0x7460,0x5841,0x6D99,0x7D2F,0x985E,0x4EE4, + 0x4F36,0x4F8B,0x51B7,0x52B1,0x5DBA,0x601C,0x73B2,0x793C, + 0x82D3,0x9234,0x96B7,0x96F6,0x970A,0x9E97,0x9F62,0x66A6, + 0x6B74,0x5217,0x52A3,0x70C8,0x88C2,0x5EC9,0x604B,0x6190, + 0x6F23,0x7149,0x7C3E,0x7DF4,0x806F,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_98[]={ + 0x84EE,0x9023,0x932C,0x5442,0x9B6F,0x6AD3,0x7089,0x8CC2, + 0x8DEF,0x9732,0x52B4,0x5A41,0x5ECA,0x5F04,0x6717,0x697C, + 0x6994,0x6D6A,0x6F0F,0x7262,0x72FC,0x7BED,0x8001,0x807E, + 0x874B,0x90CE,0x516D,0x9E93,0x7984,0x808B,0x9332,0x8AD6, + 0x502D,0x548C,0x8A71,0x6B6A,0x8CC4,0x8107,0x60D1,0x67A0, + 0x9DF2,0x4E99,0x4E98,0x9C10,0x8A6B,0x85C1,0x8568,0x6900, + 0x6E7E,0x7897,0x8155,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x5F0C, + 0x4E10,0x4E15,0x4E2A,0x4E31,0x4E36,0x4E3C,0x4E3F,0x4E42, + 0x4E56,0x4E58,0x4E82,0x4E85,0x8C6B,0x4E8A,0x8212,0x5F0D, + 0x4E8E,0x4E9E,0x4E9F,0x4EA0,0x4EA2,0x4EB0,0x4EB3,0x4EB6, + 0x4ECE,0x4ECD,0x4EC4,0x4EC6,0x4EC2,0x4ED7,0x4EDE,0x4EED, + 0x4EDF,0x4EF7,0x4F09,0x4F5A,0x4F30,0x4F5B,0x4F5D,0x4F57, + 0x4F47,0x4F76,0x4F88,0x4F8F,0x4F98,0x4F7B,0x4F69,0x4F70, + 0x4F91,0x4F6F,0x4F86,0x4F96,0x5118,0x4FD4,0x4FDF,0x4FCE, + 0x4FD8,0x4FDB,0x4FD1,0x4FDA,0x4FD0,0x4FE4,0x4FE5,0x501A, + 0x5028,0x5014,0x502A,0x5025,0x5005,0x4F1C,0x4FF6,0x5021, + 0x5029,0x502C,0x4FFE,0x4FEF,0x5011,0x5006,0x5043,0x5047, + 0x6703,0x5055,0x5050,0x5048,0x505A,0x5056,0x506C,0x5078, + 0x5080,0x509A,0x5085,0x50B4,0x50B2,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_99[]={ + 0x50C9,0x50CA,0x50B3,0x50C2,0x50D6,0x50DE,0x50E5,0x50ED, + 0x50E3,0x50EE,0x50F9,0x50F5,0x5109,0x5101,0x5102,0x5116, + 0x5115,0x5114,0x511A,0x5121,0x513A,0x5137,0x513C,0x513B, + 0x513F,0x5140,0x5152,0x514C,0x5154,0x5162,0x7AF8,0x5169, + 0x516A,0x516E,0x5180,0x5182,0x56D8,0x518C,0x5189,0x518F, + 0x5191,0x5193,0x5195,0x5196,0x51A4,0x51A6,0x51A2,0x51A9, + 0x51AA,0x51AB,0x51B3,0x51B1,0x51B2,0x51B0,0x51B5,0x51BD, + 0x51C5,0x51C9,0x51DB,0x51E0,0x8655,0x51E9,0x51ED,0x30FB, + 0x51F0,0x51F5,0x51FE,0x5204,0x520B,0x5214,0x520E,0x5227, + 0x522A,0x522E,0x5233,0x5239,0x524F,0x5244,0x524B,0x524C, + 0x525E,0x5254,0x526A,0x5274,0x5269,0x5273,0x527F,0x527D, + 0x528D,0x5294,0x5292,0x5271,0x5288,0x5291,0x8FA8,0x8FA7, + 0x52AC,0x52AD,0x52BC,0x52B5,0x52C1,0x52CD,0x52D7,0x52DE, + 0x52E3,0x52E6,0x98ED,0x52E0,0x52F3,0x52F5,0x52F8,0x52F9, + 0x5306,0x5308,0x7538,0x530D,0x5310,0x530F,0x5315,0x531A, + 0x5323,0x532F,0x5331,0x5333,0x5338,0x5340,0x5346,0x5345, + 0x4E17,0x5349,0x534D,0x51D6,0x535E,0x5369,0x536E,0x5918, + 0x537B,0x5377,0x5382,0x5396,0x53A0,0x53A6,0x53A5,0x53AE, + 0x53B0,0x53B6,0x53C3,0x7C12,0x96D9,0x53DF,0x66FC,0x71EE, + 0x53EE,0x53E8,0x53ED,0x53FA,0x5401,0x543D,0x5440,0x542C, + 0x542D,0x543C,0x542E,0x5436,0x5429,0x541D,0x544E,0x548F, + 0x5475,0x548E,0x545F,0x5471,0x5477,0x5470,0x5492,0x547B, + 0x5480,0x5476,0x5484,0x5490,0x5486,0x54C7,0x54A2,0x54B8, + 0x54A5,0x54AC,0x54C4,0x54C8,0x54A8,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_9a[]={ + 0x54AB,0x54C2,0x54A4,0x54BE,0x54BC,0x54D8,0x54E5,0x54E6, + 0x550F,0x5514,0x54FD,0x54EE,0x54ED,0x54FA,0x54E2,0x5539, + 0x5540,0x5563,0x554C,0x552E,0x555C,0x5545,0x5556,0x5557, + 0x5538,0x5533,0x555D,0x5599,0x5580,0x54AF,0x558A,0x559F, + 0x557B,0x557E,0x5598,0x559E,0x55AE,0x557C,0x5583,0x55A9, + 0x5587,0x55A8,0x55DA,0x55C5,0x55DF,0x55C4,0x55DC,0x55E4, + 0x55D4,0x5614,0x55F7,0x5616,0x55FE,0x55FD,0x561B,0x55F9, + 0x564E,0x5650,0x71DF,0x5634,0x5636,0x5632,0x5638,0x30FB, + 0x566B,0x5664,0x562F,0x566C,0x566A,0x5686,0x5680,0x568A, + 0x56A0,0x5694,0x568F,0x56A5,0x56AE,0x56B6,0x56B4,0x56C2, + 0x56BC,0x56C1,0x56C3,0x56C0,0x56C8,0x56CE,0x56D1,0x56D3, + 0x56D7,0x56EE,0x56F9,0x5700,0x56FF,0x5704,0x5709,0x5708, + 0x570B,0x570D,0x5713,0x5718,0x5716,0x55C7,0x571C,0x5726, + 0x5737,0x5738,0x574E,0x573B,0x5740,0x574F,0x5769,0x57C0, + 0x5788,0x5761,0x577F,0x5789,0x5793,0x57A0,0x57B3,0x57A4, + 0x57AA,0x57B0,0x57C3,0x57C6,0x57D4,0x57D2,0x57D3,0x580A, + 0x57D6,0x57E3,0x580B,0x5819,0x581D,0x5872,0x5821,0x5862, + 0x584B,0x5870,0x6BC0,0x5852,0x583D,0x5879,0x5885,0x58B9, + 0x589F,0x58AB,0x58BA,0x58DE,0x58BB,0x58B8,0x58AE,0x58C5, + 0x58D3,0x58D1,0x58D7,0x58D9,0x58D8,0x58E5,0x58DC,0x58E4, + 0x58DF,0x58EF,0x58FA,0x58F9,0x58FB,0x58FC,0x58FD,0x5902, + 0x590A,0x5910,0x591B,0x68A6,0x5925,0x592C,0x592D,0x5932, + 0x5938,0x593E,0x7AD2,0x5955,0x5950,0x594E,0x595A,0x5958, + 0x5962,0x5960,0x5967,0x596C,0x5969,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_9b[]={ + 0x5978,0x5981,0x599D,0x4F5E,0x4FAB,0x59A3,0x59B2,0x59C6, + 0x59E8,0x59DC,0x598D,0x59D9,0x59DA,0x5A25,0x5A1F,0x5A11, + 0x5A1C,0x5A09,0x5A1A,0x5A40,0x5A6C,0x5A49,0x5A35,0x5A36, + 0x5A62,0x5A6A,0x5A9A,0x5ABC,0x5ABE,0x5ACB,0x5AC2,0x5ABD, + 0x5AE3,0x5AD7,0x5AE6,0x5AE9,0x5AD6,0x5AFA,0x5AFB,0x5B0C, + 0x5B0B,0x5B16,0x5B32,0x5AD0,0x5B2A,0x5B36,0x5B3E,0x5B43, + 0x5B45,0x5B40,0x5B51,0x5B55,0x5B5A,0x5B5B,0x5B65,0x5B69, + 0x5B70,0x5B73,0x5B75,0x5B78,0x6588,0x5B7A,0x5B80,0x30FB, + 0x5B83,0x5BA6,0x5BB8,0x5BC3,0x5BC7,0x5BC9,0x5BD4,0x5BD0, + 0x5BE4,0x5BE6,0x5BE2,0x5BDE,0x5BE5,0x5BEB,0x5BF0,0x5BF6, + 0x5BF3,0x5C05,0x5C07,0x5C08,0x5C0D,0x5C13,0x5C20,0x5C22, + 0x5C28,0x5C38,0x5C39,0x5C41,0x5C46,0x5C4E,0x5C53,0x5C50, + 0x5C4F,0x5B71,0x5C6C,0x5C6E,0x4E62,0x5C76,0x5C79,0x5C8C, + 0x5C91,0x5C94,0x599B,0x5CAB,0x5CBB,0x5CB6,0x5CBC,0x5CB7, + 0x5CC5,0x5CBE,0x5CC7,0x5CD9,0x5CE9,0x5CFD,0x5CFA,0x5CED, + 0x5D8C,0x5CEA,0x5D0B,0x5D15,0x5D17,0x5D5C,0x5D1F,0x5D1B, + 0x5D11,0x5D14,0x5D22,0x5D1A,0x5D19,0x5D18,0x5D4C,0x5D52, + 0x5D4E,0x5D4B,0x5D6C,0x5D73,0x5D76,0x5D87,0x5D84,0x5D82, + 0x5DA2,0x5D9D,0x5DAC,0x5DAE,0x5DBD,0x5D90,0x5DB7,0x5DBC, + 0x5DC9,0x5DCD,0x5DD3,0x5DD2,0x5DD6,0x5DDB,0x5DEB,0x5DF2, + 0x5DF5,0x5E0B,0x5E1A,0x5E19,0x5E11,0x5E1B,0x5E36,0x5E37, + 0x5E44,0x5E43,0x5E40,0x5E4E,0x5E57,0x5E54,0x5E5F,0x5E62, + 0x5E64,0x5E47,0x5E75,0x5E76,0x5E7A,0x9EBC,0x5E7F,0x5EA0, + 0x5EC1,0x5EC2,0x5EC8,0x5ED0,0x5ECF,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_9c[]={ + 0x5ED6,0x5EE3,0x5EDD,0x5EDA,0x5EDB,0x5EE2,0x5EE1,0x5EE8, + 0x5EE9,0x5EEC,0x5EF1,0x5EF3,0x5EF0,0x5EF4,0x5EF8,0x5EFE, + 0x5F03,0x5F09,0x5F5D,0x5F5C,0x5F0B,0x5F11,0x5F16,0x5F29, + 0x5F2D,0x5F38,0x5F41,0x5F48,0x5F4C,0x5F4E,0x5F2F,0x5F51, + 0x5F56,0x5F57,0x5F59,0x5F61,0x5F6D,0x5F73,0x5F77,0x5F83, + 0x5F82,0x5F7F,0x5F8A,0x5F88,0x5F91,0x5F87,0x5F9E,0x5F99, + 0x5F98,0x5FA0,0x5FA8,0x5FAD,0x5FBC,0x5FD6,0x5FFB,0x5FE4, + 0x5FF8,0x5FF1,0x5FDD,0x60B3,0x5FFF,0x6021,0x6060,0x30FB, + 0x6019,0x6010,0x6029,0x600E,0x6031,0x601B,0x6015,0x602B, + 0x6026,0x600F,0x603A,0x605A,0x6041,0x606A,0x6077,0x605F, + 0x604A,0x6046,0x604D,0x6063,0x6043,0x6064,0x6042,0x606C, + 0x606B,0x6059,0x6081,0x608D,0x60E7,0x6083,0x609A,0x6084, + 0x609B,0x6096,0x6097,0x6092,0x60A7,0x608B,0x60E1,0x60B8, + 0x60E0,0x60D3,0x60B4,0x5FF0,0x60BD,0x60C6,0x60B5,0x60D8, + 0x614D,0x6115,0x6106,0x60F6,0x60F7,0x6100,0x60F4,0x60FA, + 0x6103,0x6121,0x60FB,0x60F1,0x610D,0x610E,0x6147,0x613E, + 0x6128,0x6127,0x614A,0x613F,0x613C,0x612C,0x6134,0x613D, + 0x6142,0x6144,0x6173,0x6177,0x6158,0x6159,0x615A,0x616B, + 0x6174,0x616F,0x6165,0x6171,0x615F,0x615D,0x6153,0x6175, + 0x6199,0x6196,0x6187,0x61AC,0x6194,0x619A,0x618A,0x6191, + 0x61AB,0x61AE,0x61CC,0x61CA,0x61C9,0x61F7,0x61C8,0x61C3, + 0x61C6,0x61BA,0x61CB,0x7F79,0x61CD,0x61E6,0x61E3,0x61F6, + 0x61FA,0x61F4,0x61FF,0x61FD,0x61FC,0x61FE,0x6200,0x6208, + 0x6209,0x620D,0x620C,0x6214,0x621B,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_9d[]={ + 0x621E,0x6221,0x622A,0x622E,0x6230,0x6232,0x6233,0x6241, + 0x624E,0x625E,0x6263,0x625B,0x6260,0x6268,0x627C,0x6282, + 0x6289,0x627E,0x6292,0x6293,0x6296,0x62D4,0x6283,0x6294, + 0x62D7,0x62D1,0x62BB,0x62CF,0x62FF,0x62C6,0x64D4,0x62C8, + 0x62DC,0x62CC,0x62CA,0x62C2,0x62C7,0x629B,0x62C9,0x630C, + 0x62EE,0x62F1,0x6327,0x6302,0x6308,0x62EF,0x62F5,0x6350, + 0x633E,0x634D,0x641C,0x634F,0x6396,0x638E,0x6380,0x63AB, + 0x6376,0x63A3,0x638F,0x6389,0x639F,0x63B5,0x636B,0x30FB, + 0x6369,0x63BE,0x63E9,0x63C0,0x63C6,0x63E3,0x63C9,0x63D2, + 0x63F6,0x63C4,0x6416,0x6434,0x6406,0x6413,0x6426,0x6436, + 0x651D,0x6417,0x6428,0x640F,0x6467,0x646F,0x6476,0x644E, + 0x652A,0x6495,0x6493,0x64A5,0x64A9,0x6488,0x64BC,0x64DA, + 0x64D2,0x64C5,0x64C7,0x64BB,0x64D8,0x64C2,0x64F1,0x64E7, + 0x8209,0x64E0,0x64E1,0x62AC,0x64E3,0x64EF,0x652C,0x64F6, + 0x64F4,0x64F2,0x64FA,0x6500,0x64FD,0x6518,0x651C,0x6505, + 0x6524,0x6523,0x652B,0x6534,0x6535,0x6537,0x6536,0x6538, + 0x754B,0x6548,0x6556,0x6555,0x654D,0x6558,0x655E,0x655D, + 0x6572,0x6578,0x6582,0x6583,0x8B8A,0x659B,0x659F,0x65AB, + 0x65B7,0x65C3,0x65C6,0x65C1,0x65C4,0x65CC,0x65D2,0x65DB, + 0x65D9,0x65E0,0x65E1,0x65F1,0x6772,0x660A,0x6603,0x65FB, + 0x6773,0x6635,0x6636,0x6634,0x661C,0x664F,0x6644,0x6649, + 0x6641,0x665E,0x665D,0x6664,0x6667,0x6668,0x665F,0x6662, + 0x6670,0x6683,0x6688,0x668E,0x6689,0x6684,0x6698,0x669D, + 0x66C1,0x66B9,0x66C9,0x66BE,0x66BC,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_9e[]={ + 0x66C4,0x66B8,0x66D6,0x66DA,0x66E0,0x663F,0x66E6,0x66E9, + 0x66F0,0x66F5,0x66F7,0x670F,0x6716,0x671E,0x6726,0x6727, + 0x9738,0x672E,0x673F,0x6736,0x6741,0x6738,0x6737,0x6746, + 0x675E,0x6760,0x6759,0x6763,0x6764,0x6789,0x6770,0x67A9, + 0x677C,0x676A,0x678C,0x678B,0x67A6,0x67A1,0x6785,0x67B7, + 0x67EF,0x67B4,0x67EC,0x67B3,0x67E9,0x67B8,0x67E4,0x67DE, + 0x67DD,0x67E2,0x67EE,0x67B9,0x67CE,0x67C6,0x67E7,0x6A9C, + 0x681E,0x6846,0x6829,0x6840,0x684D,0x6832,0x684E,0x30FB, + 0x68B3,0x682B,0x6859,0x6863,0x6877,0x687F,0x689F,0x688F, + 0x68AD,0x6894,0x689D,0x689B,0x6883,0x6AAE,0x68B9,0x6874, + 0x68B5,0x68A0,0x68BA,0x690F,0x688D,0x687E,0x6901,0x68CA, + 0x6908,0x68D8,0x6922,0x6926,0x68E1,0x690C,0x68CD,0x68D4, + 0x68E7,0x68D5,0x6936,0x6912,0x6904,0x68D7,0x68E3,0x6925, + 0x68F9,0x68E0,0x68EF,0x6928,0x692A,0x691A,0x6923,0x6921, + 0x68C6,0x6979,0x6977,0x695C,0x6978,0x696B,0x6954,0x697E, + 0x696E,0x6939,0x6974,0x693D,0x6959,0x6930,0x6961,0x695E, + 0x695D,0x6981,0x696A,0x69B2,0x69AE,0x69D0,0x69BF,0x69C1, + 0x69D3,0x69BE,0x69CE,0x5BE8,0x69CA,0x69DD,0x69BB,0x69C3, + 0x69A7,0x6A2E,0x6991,0x69A0,0x699C,0x6995,0x69B4,0x69DE, + 0x69E8,0x6A02,0x6A1B,0x69FF,0x6B0A,0x69F9,0x69F2,0x69E7, + 0x6A05,0x69B1,0x6A1E,0x69ED,0x6A14,0x69EB,0x6A0A,0x6A12, + 0x6AC1,0x6A23,0x6A13,0x6A44,0x6A0C,0x6A72,0x6A36,0x6A78, + 0x6A47,0x6A62,0x6A59,0x6A66,0x6A48,0x6A38,0x6A22,0x6A90, + 0x6A8D,0x6AA0,0x6A84,0x6AA2,0x6AA3,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_9f[]={ + 0x6A97,0x8617,0x6ABB,0x6AC3,0x6AC2,0x6AB8,0x6AB3,0x6AAC, + 0x6ADE,0x6AD1,0x6ADF,0x6AAA,0x6ADA,0x6AEA,0x6AFB,0x6B05, + 0x8616,0x6AFA,0x6B12,0x6B16,0x9B31,0x6B1F,0x6B38,0x6B37, + 0x76DC,0x6B39,0x98EE,0x6B47,0x6B43,0x6B49,0x6B50,0x6B59, + 0x6B54,0x6B5B,0x6B5F,0x6B61,0x6B78,0x6B79,0x6B7F,0x6B80, + 0x6B84,0x6B83,0x6B8D,0x6B98,0x6B95,0x6B9E,0x6BA4,0x6BAA, + 0x6BAB,0x6BAF,0x6BB2,0x6BB1,0x6BB3,0x6BB7,0x6BBC,0x6BC6, + 0x6BCB,0x6BD3,0x6BDF,0x6BEC,0x6BEB,0x6BF3,0x6BEF,0x30FB, + 0x9EBE,0x6C08,0x6C13,0x6C14,0x6C1B,0x6C24,0x6C23,0x6C5E, + 0x6C55,0x6C62,0x6C6A,0x6C82,0x6C8D,0x6C9A,0x6C81,0x6C9B, + 0x6C7E,0x6C68,0x6C73,0x6C92,0x6C90,0x6CC4,0x6CF1,0x6CD3, + 0x6CBD,0x6CD7,0x6CC5,0x6CDD,0x6CAE,0x6CB1,0x6CBE,0x6CBA, + 0x6CDB,0x6CEF,0x6CD9,0x6CEA,0x6D1F,0x884D,0x6D36,0x6D2B, + 0x6D3D,0x6D38,0x6D19,0x6D35,0x6D33,0x6D12,0x6D0C,0x6D63, + 0x6D93,0x6D64,0x6D5A,0x6D79,0x6D59,0x6D8E,0x6D95,0x6FE4, + 0x6D85,0x6DF9,0x6E15,0x6E0A,0x6DB5,0x6DC7,0x6DE6,0x6DB8, + 0x6DC6,0x6DEC,0x6DDE,0x6DCC,0x6DE8,0x6DD2,0x6DC5,0x6DFA, + 0x6DD9,0x6DE4,0x6DD5,0x6DEA,0x6DEE,0x6E2D,0x6E6E,0x6E2E, + 0x6E19,0x6E72,0x6E5F,0x6E3E,0x6E23,0x6E6B,0x6E2B,0x6E76, + 0x6E4D,0x6E1F,0x6E43,0x6E3A,0x6E4E,0x6E24,0x6EFF,0x6E1D, + 0x6E38,0x6E82,0x6EAA,0x6E98,0x6EC9,0x6EB7,0x6ED3,0x6EBD, + 0x6EAF,0x6EC4,0x6EB2,0x6ED4,0x6ED5,0x6E8F,0x6EA5,0x6EC2, + 0x6E9F,0x6F41,0x6F11,0x704C,0x6EEC,0x6EF8,0x6EFE,0x6F3F, + 0x6EF2,0x6F31,0x6EEF,0x6F32,0x6ECC,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e0[]={ + 0x6F3E,0x6F13,0x6EF7,0x6F86,0x6F7A,0x6F78,0x6F81,0x6F80, + 0x6F6F,0x6F5B,0x6FF3,0x6F6D,0x6F82,0x6F7C,0x6F58,0x6F8E, + 0x6F91,0x6FC2,0x6F66,0x6FB3,0x6FA3,0x6FA1,0x6FA4,0x6FB9, + 0x6FC6,0x6FAA,0x6FDF,0x6FD5,0x6FEC,0x6FD4,0x6FD8,0x6FF1, + 0x6FEE,0x6FDB,0x7009,0x700B,0x6FFA,0x7011,0x7001,0x700F, + 0x6FFE,0x701B,0x701A,0x6F74,0x701D,0x7018,0x701F,0x7030, + 0x703E,0x7032,0x7051,0x7063,0x7099,0x7092,0x70AF,0x70F1, + 0x70AC,0x70B8,0x70B3,0x70AE,0x70DF,0x70CB,0x70DD,0x30FB, + 0x70D9,0x7109,0x70FD,0x711C,0x7119,0x7165,0x7155,0x7188, + 0x7166,0x7162,0x714C,0x7156,0x716C,0x718F,0x71FB,0x7184, + 0x7195,0x71A8,0x71AC,0x71D7,0x71B9,0x71BE,0x71D2,0x71C9, + 0x71D4,0x71CE,0x71E0,0x71EC,0x71E7,0x71F5,0x71FC,0x71F9, + 0x71FF,0x720D,0x7210,0x721B,0x7228,0x722D,0x722C,0x7230, + 0x7232,0x723B,0x723C,0x723F,0x7240,0x7246,0x724B,0x7258, + 0x7274,0x727E,0x7282,0x7281,0x7287,0x7292,0x7296,0x72A2, + 0x72A7,0x72B9,0x72B2,0x72C3,0x72C6,0x72C4,0x72CE,0x72D2, + 0x72E2,0x72E0,0x72E1,0x72F9,0x72F7,0x500F,0x7317,0x730A, + 0x731C,0x7316,0x731D,0x7334,0x732F,0x7329,0x7325,0x733E, + 0x734E,0x734F,0x9ED8,0x7357,0x736A,0x7368,0x7370,0x7378, + 0x7375,0x737B,0x737A,0x73C8,0x73B3,0x73CE,0x73BB,0x73C0, + 0x73E5,0x73EE,0x73DE,0x74A2,0x7405,0x746F,0x7425,0x73F8, + 0x7432,0x743A,0x7455,0x743F,0x745F,0x7459,0x7441,0x745C, + 0x7469,0x7470,0x7463,0x746A,0x7476,0x747E,0x748B,0x749E, + 0x74A7,0x74CA,0x74CF,0x74D4,0x73F1,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e1[]={ + 0x74E0,0x74E3,0x74E7,0x74E9,0x74EE,0x74F2,0x74F0,0x74F1, + 0x74F8,0x74F7,0x7504,0x7503,0x7505,0x750C,0x750E,0x750D, + 0x7515,0x7513,0x751E,0x7526,0x752C,0x753C,0x7544,0x754D, + 0x754A,0x7549,0x755B,0x7546,0x755A,0x7569,0x7564,0x7567, + 0x756B,0x756D,0x7578,0x7576,0x7586,0x7587,0x7574,0x758A, + 0x7589,0x7582,0x7594,0x759A,0x759D,0x75A5,0x75A3,0x75C2, + 0x75B3,0x75C3,0x75B5,0x75BD,0x75B8,0x75BC,0x75B1,0x75CD, + 0x75CA,0x75D2,0x75D9,0x75E3,0x75DE,0x75FE,0x75FF,0x30FB, + 0x75FC,0x7601,0x75F0,0x75FA,0x75F2,0x75F3,0x760B,0x760D, + 0x7609,0x761F,0x7627,0x7620,0x7621,0x7622,0x7624,0x7634, + 0x7630,0x763B,0x7647,0x7648,0x7646,0x765C,0x7658,0x7661, + 0x7662,0x7668,0x7669,0x766A,0x7667,0x766C,0x7670,0x7672, + 0x7676,0x7678,0x767C,0x7680,0x7683,0x7688,0x768B,0x768E, + 0x7696,0x7693,0x7699,0x769A,0x76B0,0x76B4,0x76B8,0x76B9, + 0x76BA,0x76C2,0x76CD,0x76D6,0x76D2,0x76DE,0x76E1,0x76E5, + 0x76E7,0x76EA,0x862F,0x76FB,0x7708,0x7707,0x7704,0x7729, + 0x7724,0x771E,0x7725,0x7726,0x771B,0x7737,0x7738,0x7747, + 0x775A,0x7768,0x776B,0x775B,0x7765,0x777F,0x777E,0x7779, + 0x778E,0x778B,0x7791,0x77A0,0x779E,0x77B0,0x77B6,0x77B9, + 0x77BF,0x77BC,0x77BD,0x77BB,0x77C7,0x77CD,0x77D7,0x77DA, + 0x77DC,0x77E3,0x77EE,0x77FC,0x780C,0x7812,0x7926,0x7820, + 0x792A,0x7845,0x788E,0x7874,0x7886,0x787C,0x789A,0x788C, + 0x78A3,0x78B5,0x78AA,0x78AF,0x78D1,0x78C6,0x78CB,0x78D4, + 0x78BE,0x78BC,0x78C5,0x78CA,0x78EC,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e2[]={ + 0x78E7,0x78DA,0x78FD,0x78F4,0x7907,0x7912,0x7911,0x7919, + 0x792C,0x792B,0x7940,0x7960,0x7957,0x795F,0x795A,0x7955, + 0x7953,0x797A,0x797F,0x798A,0x799D,0x79A7,0x9F4B,0x79AA, + 0x79AE,0x79B3,0x79B9,0x79BA,0x79C9,0x79D5,0x79E7,0x79EC, + 0x79E1,0x79E3,0x7A08,0x7A0D,0x7A18,0x7A19,0x7A20,0x7A1F, + 0x7980,0x7A31,0x7A3B,0x7A3E,0x7A37,0x7A43,0x7A57,0x7A49, + 0x7A61,0x7A62,0x7A69,0x9F9D,0x7A70,0x7A79,0x7A7D,0x7A88, + 0x7A97,0x7A95,0x7A98,0x7A96,0x7AA9,0x7AC8,0x7AB0,0x30FB, + 0x7AB6,0x7AC5,0x7AC4,0x7ABF,0x9083,0x7AC7,0x7ACA,0x7ACD, + 0x7ACF,0x7AD5,0x7AD3,0x7AD9,0x7ADA,0x7ADD,0x7AE1,0x7AE2, + 0x7AE6,0x7AED,0x7AF0,0x7B02,0x7B0F,0x7B0A,0x7B06,0x7B33, + 0x7B18,0x7B19,0x7B1E,0x7B35,0x7B28,0x7B36,0x7B50,0x7B7A, + 0x7B04,0x7B4D,0x7B0B,0x7B4C,0x7B45,0x7B75,0x7B65,0x7B74, + 0x7B67,0x7B70,0x7B71,0x7B6C,0x7B6E,0x7B9D,0x7B98,0x7B9F, + 0x7B8D,0x7B9C,0x7B9A,0x7B8B,0x7B92,0x7B8F,0x7B5D,0x7B99, + 0x7BCB,0x7BC1,0x7BCC,0x7BCF,0x7BB4,0x7BC6,0x7BDD,0x7BE9, + 0x7C11,0x7C14,0x7BE6,0x7BE5,0x7C60,0x7C00,0x7C07,0x7C13, + 0x7BF3,0x7BF7,0x7C17,0x7C0D,0x7BF6,0x7C23,0x7C27,0x7C2A, + 0x7C1F,0x7C37,0x7C2B,0x7C3D,0x7C4C,0x7C43,0x7C54,0x7C4F, + 0x7C40,0x7C50,0x7C58,0x7C5F,0x7C64,0x7C56,0x7C65,0x7C6C, + 0x7C75,0x7C83,0x7C90,0x7CA4,0x7CAD,0x7CA2,0x7CAB,0x7CA1, + 0x7CA8,0x7CB3,0x7CB2,0x7CB1,0x7CAE,0x7CB9,0x7CBD,0x7CC0, + 0x7CC5,0x7CC2,0x7CD8,0x7CD2,0x7CDC,0x7CE2,0x9B3B,0x7CEF, + 0x7CF2,0x7CF4,0x7CF6,0x7CFA,0x7D06,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e3[]={ + 0x7D02,0x7D1C,0x7D15,0x7D0A,0x7D45,0x7D4B,0x7D2E,0x7D32, + 0x7D3F,0x7D35,0x7D46,0x7D73,0x7D56,0x7D4E,0x7D72,0x7D68, + 0x7D6E,0x7D4F,0x7D63,0x7D93,0x7D89,0x7D5B,0x7D8F,0x7D7D, + 0x7D9B,0x7DBA,0x7DAE,0x7DA3,0x7DB5,0x7DC7,0x7DBD,0x7DAB, + 0x7E3D,0x7DA2,0x7DAF,0x7DDC,0x7DB8,0x7D9F,0x7DB0,0x7DD8, + 0x7DDD,0x7DE4,0x7DDE,0x7DFB,0x7DF2,0x7DE1,0x7E05,0x7E0A, + 0x7E23,0x7E21,0x7E12,0x7E31,0x7E1F,0x7E09,0x7E0B,0x7E22, + 0x7E46,0x7E66,0x7E3B,0x7E35,0x7E39,0x7E43,0x7E37,0x30FB, + 0x7E32,0x7E3A,0x7E67,0x7E5D,0x7E56,0x7E5E,0x7E59,0x7E5A, + 0x7E79,0x7E6A,0x7E69,0x7E7C,0x7E7B,0x7E83,0x7DD5,0x7E7D, + 0x8FAE,0x7E7F,0x7E88,0x7E89,0x7E8C,0x7E92,0x7E90,0x7E93, + 0x7E94,0x7E96,0x7E8E,0x7E9B,0x7E9C,0x7F38,0x7F3A,0x7F45, + 0x7F4C,0x7F4D,0x7F4E,0x7F50,0x7F51,0x7F55,0x7F54,0x7F58, + 0x7F5F,0x7F60,0x7F68,0x7F69,0x7F67,0x7F78,0x7F82,0x7F86, + 0x7F83,0x7F88,0x7F87,0x7F8C,0x7F94,0x7F9E,0x7F9D,0x7F9A, + 0x7FA3,0x7FAF,0x7FB2,0x7FB9,0x7FAE,0x7FB6,0x7FB8,0x8B71, + 0x7FC5,0x7FC6,0x7FCA,0x7FD5,0x7FD4,0x7FE1,0x7FE6,0x7FE9, + 0x7FF3,0x7FF9,0x98DC,0x8006,0x8004,0x800B,0x8012,0x8018, + 0x8019,0x801C,0x8021,0x8028,0x803F,0x803B,0x804A,0x8046, + 0x8052,0x8058,0x805A,0x805F,0x8062,0x8068,0x8073,0x8072, + 0x8070,0x8076,0x8079,0x807D,0x807F,0x8084,0x8086,0x8085, + 0x809B,0x8093,0x809A,0x80AD,0x5190,0x80AC,0x80DB,0x80E5, + 0x80D9,0x80DD,0x80C4,0x80DA,0x80D6,0x8109,0x80EF,0x80F1, + 0x811B,0x8129,0x8123,0x812F,0x814B,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e4[]={ + 0x968B,0x8146,0x813E,0x8153,0x8151,0x80FC,0x8171,0x816E, + 0x8165,0x8166,0x8174,0x8183,0x8188,0x818A,0x8180,0x8182, + 0x81A0,0x8195,0x81A4,0x81A3,0x815F,0x8193,0x81A9,0x81B0, + 0x81B5,0x81BE,0x81B8,0x81BD,0x81C0,0x81C2,0x81BA,0x81C9, + 0x81CD,0x81D1,0x81D9,0x81D8,0x81C8,0x81DA,0x81DF,0x81E0, + 0x81E7,0x81FA,0x81FB,0x81FE,0x8201,0x8202,0x8205,0x8207, + 0x820A,0x820D,0x8210,0x8216,0x8229,0x822B,0x8238,0x8233, + 0x8240,0x8259,0x8258,0x825D,0x825A,0x825F,0x8264,0x30FB, + 0x8262,0x8268,0x826A,0x826B,0x822E,0x8271,0x8277,0x8278, + 0x827E,0x828D,0x8292,0x82AB,0x829F,0x82BB,0x82AC,0x82E1, + 0x82E3,0x82DF,0x82D2,0x82F4,0x82F3,0x82FA,0x8393,0x8303, + 0x82FB,0x82F9,0x82DE,0x8306,0x82DC,0x8309,0x82D9,0x8335, + 0x8334,0x8316,0x8332,0x8331,0x8340,0x8339,0x8350,0x8345, + 0x832F,0x832B,0x8317,0x8318,0x8385,0x839A,0x83AA,0x839F, + 0x83A2,0x8396,0x8323,0x838E,0x8387,0x838A,0x837C,0x83B5, + 0x8373,0x8375,0x83A0,0x8389,0x83A8,0x83F4,0x8413,0x83EB, + 0x83CE,0x83FD,0x8403,0x83D8,0x840B,0x83C1,0x83F7,0x8407, + 0x83E0,0x83F2,0x840D,0x8422,0x8420,0x83BD,0x8438,0x8506, + 0x83FB,0x846D,0x842A,0x843C,0x855A,0x8484,0x8477,0x846B, + 0x84AD,0x846E,0x8482,0x8469,0x8446,0x842C,0x846F,0x8479, + 0x8435,0x84CA,0x8462,0x84B9,0x84BF,0x849F,0x84D9,0x84CD, + 0x84BB,0x84DA,0x84D0,0x84C1,0x84C6,0x84D6,0x84A1,0x8521, + 0x84FF,0x84F4,0x8517,0x8518,0x852C,0x851F,0x8515,0x8514, + 0x84FC,0x8540,0x8563,0x8558,0x8548,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e5[]={ + 0x8541,0x8602,0x854B,0x8555,0x8580,0x85A4,0x8588,0x8591, + 0x858A,0x85A8,0x856D,0x8594,0x859B,0x85EA,0x8587,0x859C, + 0x8577,0x857E,0x8590,0x85C9,0x85BA,0x85CF,0x85B9,0x85D0, + 0x85D5,0x85DD,0x85E5,0x85DC,0x85F9,0x860A,0x8613,0x860B, + 0x85FE,0x85FA,0x8606,0x8622,0x861A,0x8630,0x863F,0x864D, + 0x4E55,0x8654,0x865F,0x8667,0x8671,0x8693,0x86A3,0x86A9, + 0x86AA,0x868B,0x868C,0x86B6,0x86AF,0x86C4,0x86C6,0x86B0, + 0x86C9,0x8823,0x86AB,0x86D4,0x86DE,0x86E9,0x86EC,0x30FB, + 0x86DF,0x86DB,0x86EF,0x8712,0x8706,0x8708,0x8700,0x8703, + 0x86FB,0x8711,0x8709,0x870D,0x86F9,0x870A,0x8734,0x873F, + 0x8737,0x873B,0x8725,0x8729,0x871A,0x8760,0x875F,0x8778, + 0x874C,0x874E,0x8774,0x8757,0x8768,0x876E,0x8759,0x8753, + 0x8763,0x876A,0x8805,0x87A2,0x879F,0x8782,0x87AF,0x87CB, + 0x87BD,0x87C0,0x87D0,0x96D6,0x87AB,0x87C4,0x87B3,0x87C7, + 0x87C6,0x87BB,0x87EF,0x87F2,0x87E0,0x880F,0x880D,0x87FE, + 0x87F6,0x87F7,0x880E,0x87D2,0x8811,0x8816,0x8815,0x8822, + 0x8821,0x8831,0x8836,0x8839,0x8827,0x883B,0x8844,0x8842, + 0x8852,0x8859,0x885E,0x8862,0x886B,0x8881,0x887E,0x889E, + 0x8875,0x887D,0x88B5,0x8872,0x8882,0x8897,0x8892,0x88AE, + 0x8899,0x88A2,0x888D,0x88A4,0x88B0,0x88BF,0x88B1,0x88C3, + 0x88C4,0x88D4,0x88D8,0x88D9,0x88DD,0x88F9,0x8902,0x88FC, + 0x88F4,0x88E8,0x88F2,0x8904,0x890C,0x890A,0x8913,0x8943, + 0x891E,0x8925,0x892A,0x892B,0x8941,0x8944,0x893B,0x8936, + 0x8938,0x894C,0x891D,0x8960,0x895E,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e6[]={ + 0x8966,0x8964,0x896D,0x896A,0x896F,0x8974,0x8977,0x897E, + 0x8983,0x8988,0x898A,0x8993,0x8998,0x89A1,0x89A9,0x89A6, + 0x89AC,0x89AF,0x89B2,0x89BA,0x89BD,0x89BF,0x89C0,0x89DA, + 0x89DC,0x89DD,0x89E7,0x89F4,0x89F8,0x8A03,0x8A16,0x8A10, + 0x8A0C,0x8A1B,0x8A1D,0x8A25,0x8A36,0x8A41,0x8A5B,0x8A52, + 0x8A46,0x8A48,0x8A7C,0x8A6D,0x8A6C,0x8A62,0x8A85,0x8A82, + 0x8A84,0x8AA8,0x8AA1,0x8A91,0x8AA5,0x8AA6,0x8A9A,0x8AA3, + 0x8AC4,0x8ACD,0x8AC2,0x8ADA,0x8AEB,0x8AF3,0x8AE7,0x30FB, + 0x8AE4,0x8AF1,0x8B14,0x8AE0,0x8AE2,0x8AF7,0x8ADE,0x8ADB, + 0x8B0C,0x8B07,0x8B1A,0x8AE1,0x8B16,0x8B10,0x8B17,0x8B20, + 0x8B33,0x97AB,0x8B26,0x8B2B,0x8B3E,0x8B28,0x8B41,0x8B4C, + 0x8B4F,0x8B4E,0x8B49,0x8B56,0x8B5B,0x8B5A,0x8B6B,0x8B5F, + 0x8B6C,0x8B6F,0x8B74,0x8B7D,0x8B80,0x8B8C,0x8B8E,0x8B92, + 0x8B93,0x8B96,0x8B99,0x8B9A,0x8C3A,0x8C41,0x8C3F,0x8C48, + 0x8C4C,0x8C4E,0x8C50,0x8C55,0x8C62,0x8C6C,0x8C78,0x8C7A, + 0x8C82,0x8C89,0x8C85,0x8C8A,0x8C8D,0x8C8E,0x8C94,0x8C7C, + 0x8C98,0x621D,0x8CAD,0x8CAA,0x8CBD,0x8CB2,0x8CB3,0x8CAE, + 0x8CB6,0x8CC8,0x8CC1,0x8CE4,0x8CE3,0x8CDA,0x8CFD,0x8CFA, + 0x8CFB,0x8D04,0x8D05,0x8D0A,0x8D07,0x8D0F,0x8D0D,0x8D10, + 0x9F4E,0x8D13,0x8CCD,0x8D14,0x8D16,0x8D67,0x8D6D,0x8D71, + 0x8D73,0x8D81,0x8D99,0x8DC2,0x8DBE,0x8DBA,0x8DCF,0x8DDA, + 0x8DD6,0x8DCC,0x8DDB,0x8DCB,0x8DEA,0x8DEB,0x8DDF,0x8DE3, + 0x8DFC,0x8E08,0x8E09,0x8DFF,0x8E1D,0x8E1E,0x8E10,0x8E1F, + 0x8E42,0x8E35,0x8E30,0x8E34,0x8E4A,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e7[]={ + 0x8E47,0x8E49,0x8E4C,0x8E50,0x8E48,0x8E59,0x8E64,0x8E60, + 0x8E2A,0x8E63,0x8E55,0x8E76,0x8E72,0x8E7C,0x8E81,0x8E87, + 0x8E85,0x8E84,0x8E8B,0x8E8A,0x8E93,0x8E91,0x8E94,0x8E99, + 0x8EAA,0x8EA1,0x8EAC,0x8EB0,0x8EC6,0x8EB1,0x8EBE,0x8EC5, + 0x8EC8,0x8ECB,0x8EDB,0x8EE3,0x8EFC,0x8EFB,0x8EEB,0x8EFE, + 0x8F0A,0x8F05,0x8F15,0x8F12,0x8F19,0x8F13,0x8F1C,0x8F1F, + 0x8F1B,0x8F0C,0x8F26,0x8F33,0x8F3B,0x8F39,0x8F45,0x8F42, + 0x8F3E,0x8F4C,0x8F49,0x8F46,0x8F4E,0x8F57,0x8F5C,0x30FB, + 0x8F62,0x8F63,0x8F64,0x8F9C,0x8F9F,0x8FA3,0x8FAD,0x8FAF, + 0x8FB7,0x8FDA,0x8FE5,0x8FE2,0x8FEA,0x8FEF,0x9087,0x8FF4, + 0x9005,0x8FF9,0x8FFA,0x9011,0x9015,0x9021,0x900D,0x901E, + 0x9016,0x900B,0x9027,0x9036,0x9035,0x9039,0x8FF8,0x904F, + 0x9050,0x9051,0x9052,0x900E,0x9049,0x903E,0x9056,0x9058, + 0x905E,0x9068,0x906F,0x9076,0x96A8,0x9072,0x9082,0x907D, + 0x9081,0x9080,0x908A,0x9089,0x908F,0x90A8,0x90AF,0x90B1, + 0x90B5,0x90E2,0x90E4,0x6248,0x90DB,0x9102,0x9112,0x9119, + 0x9132,0x9130,0x914A,0x9156,0x9158,0x9163,0x9165,0x9169, + 0x9173,0x9172,0x918B,0x9189,0x9182,0x91A2,0x91AB,0x91AF, + 0x91AA,0x91B5,0x91B4,0x91BA,0x91C0,0x91C1,0x91C9,0x91CB, + 0x91D0,0x91D6,0x91DF,0x91E1,0x91DB,0x91FC,0x91F5,0x91F6, + 0x921E,0x91FF,0x9214,0x922C,0x9215,0x9211,0x925E,0x9257, + 0x9245,0x9249,0x9264,0x9248,0x9295,0x923F,0x924B,0x9250, + 0x929C,0x9296,0x9293,0x929B,0x925A,0x92CF,0x92B9,0x92B7, + 0x92E9,0x930F,0x92FA,0x9344,0x932E,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e8[]={ + 0x9319,0x9322,0x931A,0x9323,0x933A,0x9335,0x933B,0x935C, + 0x9360,0x937C,0x936E,0x9356,0x93B0,0x93AC,0x93AD,0x9394, + 0x93B9,0x93D6,0x93D7,0x93E8,0x93E5,0x93D8,0x93C3,0x93DD, + 0x93D0,0x93C8,0x93E4,0x941A,0x9414,0x9413,0x9403,0x9407, + 0x9410,0x9436,0x942B,0x9435,0x9421,0x943A,0x9441,0x9452, + 0x9444,0x945B,0x9460,0x9462,0x945E,0x946A,0x9229,0x9470, + 0x9475,0x9477,0x947D,0x945A,0x947C,0x947E,0x9481,0x947F, + 0x9582,0x9587,0x958A,0x9594,0x9596,0x9598,0x9599,0x30FB, + 0x95A0,0x95A8,0x95A7,0x95AD,0x95BC,0x95BB,0x95B9,0x95BE, + 0x95CA,0x6FF6,0x95C3,0x95CD,0x95CC,0x95D5,0x95D4,0x95D6, + 0x95DC,0x95E1,0x95E5,0x95E2,0x9621,0x9628,0x962E,0x962F, + 0x9642,0x964C,0x964F,0x964B,0x9677,0x965C,0x965E,0x965D, + 0x965F,0x9666,0x9672,0x966C,0x968D,0x9698,0x9695,0x9697, + 0x96AA,0x96A7,0x96B1,0x96B2,0x96B0,0x96B4,0x96B6,0x96B8, + 0x96B9,0x96CE,0x96CB,0x96C9,0x96CD,0x894D,0x96DC,0x970D, + 0x96D5,0x96F9,0x9704,0x9706,0x9708,0x9713,0x970E,0x9711, + 0x970F,0x9716,0x9719,0x9724,0x972A,0x9730,0x9739,0x973D, + 0x973E,0x9744,0x9746,0x9748,0x9742,0x9749,0x975C,0x9760, + 0x9764,0x9766,0x9768,0x52D2,0x976B,0x9771,0x9779,0x9785, + 0x977C,0x9781,0x977A,0x9786,0x978B,0x978F,0x9790,0x979C, + 0x97A8,0x97A6,0x97A3,0x97B3,0x97B4,0x97C3,0x97C6,0x97C8, + 0x97CB,0x97DC,0x97ED,0x9F4F,0x97F2,0x7ADF,0x97F6,0x97F5, + 0x980F,0x980C,0x9838,0x9824,0x9821,0x9837,0x983D,0x9846, + 0x984F,0x984B,0x986B,0x986F,0x9870,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_e9[]={ + 0x9871,0x9874,0x9873,0x98AA,0x98AF,0x98B1,0x98B6,0x98C4, + 0x98C3,0x98C6,0x98E9,0x98EB,0x9903,0x9909,0x9912,0x9914, + 0x9918,0x9921,0x991D,0x991E,0x9924,0x9920,0x992C,0x992E, + 0x993D,0x993E,0x9942,0x9949,0x9945,0x9950,0x994B,0x9951, + 0x9952,0x994C,0x9955,0x9997,0x9998,0x99A5,0x99AD,0x99AE, + 0x99BC,0x99DF,0x99DB,0x99DD,0x99D8,0x99D1,0x99ED,0x99EE, + 0x99F1,0x99F2,0x99FB,0x99F8,0x9A01,0x9A0F,0x9A05,0x99E2, + 0x9A19,0x9A2B,0x9A37,0x9A45,0x9A42,0x9A40,0x9A43,0x30FB, + 0x9A3E,0x9A55,0x9A4D,0x9A5B,0x9A57,0x9A5F,0x9A62,0x9A65, + 0x9A64,0x9A69,0x9A6B,0x9A6A,0x9AAD,0x9AB0,0x9ABC,0x9AC0, + 0x9ACF,0x9AD1,0x9AD3,0x9AD4,0x9ADE,0x9ADF,0x9AE2,0x9AE3, + 0x9AE6,0x9AEF,0x9AEB,0x9AEE,0x9AF4,0x9AF1,0x9AF7,0x9AFB, + 0x9B06,0x9B18,0x9B1A,0x9B1F,0x9B22,0x9B23,0x9B25,0x9B27, + 0x9B28,0x9B29,0x9B2A,0x9B2E,0x9B2F,0x9B32,0x9B44,0x9B43, + 0x9B4F,0x9B4D,0x9B4E,0x9B51,0x9B58,0x9B74,0x9B93,0x9B83, + 0x9B91,0x9B96,0x9B97,0x9B9F,0x9BA0,0x9BA8,0x9BB4,0x9BC0, + 0x9BCA,0x9BB9,0x9BC6,0x9BCF,0x9BD1,0x9BD2,0x9BE3,0x9BE2, + 0x9BE4,0x9BD4,0x9BE1,0x9C3A,0x9BF2,0x9BF1,0x9BF0,0x9C15, + 0x9C14,0x9C09,0x9C13,0x9C0C,0x9C06,0x9C08,0x9C12,0x9C0A, + 0x9C04,0x9C2E,0x9C1B,0x9C25,0x9C24,0x9C21,0x9C30,0x9C47, + 0x9C32,0x9C46,0x9C3E,0x9C5A,0x9C60,0x9C67,0x9C76,0x9C78, + 0x9CE7,0x9CEC,0x9CF0,0x9D09,0x9D08,0x9CEB,0x9D03,0x9D06, + 0x9D2A,0x9D26,0x9DAF,0x9D23,0x9D1F,0x9D44,0x9D15,0x9D12, + 0x9D41,0x9D3F,0x9D3E,0x9D46,0x9D48,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_ea[]={ + 0x9D5D,0x9D5E,0x9D64,0x9D51,0x9D50,0x9D59,0x9D72,0x9D89, + 0x9D87,0x9DAB,0x9D6F,0x9D7A,0x9D9A,0x9DA4,0x9DA9,0x9DB2, + 0x9DC4,0x9DC1,0x9DBB,0x9DB8,0x9DBA,0x9DC6,0x9DCF,0x9DC2, + 0x9DD9,0x9DD3,0x9DF8,0x9DE6,0x9DED,0x9DEF,0x9DFD,0x9E1A, + 0x9E1B,0x9E1E,0x9E75,0x9E79,0x9E7D,0x9E81,0x9E88,0x9E8B, + 0x9E8C,0x9E92,0x9E95,0x9E91,0x9E9D,0x9EA5,0x9EA9,0x9EB8, + 0x9EAA,0x9EAD,0x9761,0x9ECC,0x9ECE,0x9ECF,0x9ED0,0x9ED4, + 0x9EDC,0x9EDE,0x9EDD,0x9EE0,0x9EE5,0x9EE8,0x9EEF,0x30FB, + 0x9EF4,0x9EF6,0x9EF7,0x9EF9,0x9EFB,0x9EFC,0x9EFD,0x9F07, + 0x9F08,0x76B7,0x9F15,0x9F21,0x9F2C,0x9F3E,0x9F4A,0x9F52, + 0x9F54,0x9F63,0x9F5F,0x9F60,0x9F61,0x9F66,0x9F67,0x9F6C, + 0x9F6A,0x9F77,0x9F72,0x9F76,0x9F95,0x9F9C,0x9FA0,0x582F, + 0x69C7,0x9059,0x7464,0x51DC,0x7199,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_eb[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_ec[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_ed[]={ + 0x7E8A,0x891C,0x9348,0x9288,0x84DC,0x4FC9,0x70BB,0x6631, + 0x68C8,0x92F9,0x66FB,0x5F45,0x4E28,0x4EE1,0x4EFC,0x4F00, + 0x4F03,0x4F39,0x4F56,0x4F92,0x4F8A,0x4F9A,0x4F94,0x4FCD, + 0x5040,0x5022,0x4FFF,0x501E,0x5046,0x5070,0x5042,0x5094, + 0x50F4,0x50D8,0x514A,0x5164,0x519D,0x51BE,0x51EC,0x5215, + 0x529C,0x52A6,0x52C0,0x52DB,0x5300,0x5307,0x5324,0x5372, + 0x5393,0x53B2,0x53DD,0xFA0E,0x549C,0x548A,0x54A9,0x54FF, + 0x5586,0x5759,0x5765,0x57AC,0x57C8,0x57C7,0xFA0F,0x30FB, + 0xFA10,0x589E,0x58B2,0x590B,0x5953,0x595B,0x595D,0x5963, + 0x59A4,0x59BA,0x5B56,0x5BC0,0x752F,0x5BD8,0x5BEC,0x5C1E, + 0x5CA6,0x5CBA,0x5CF5,0x5D27,0x5D53,0xFA11,0x5D42,0x5D6D, + 0x5DB8,0x5DB9,0x5DD0,0x5F21,0x5F34,0x5F67,0x5FB7,0x5FDE, + 0x605D,0x6085,0x608A,0x60DE,0x60D5,0x6120,0x60F2,0x6111, + 0x6137,0x6130,0x6198,0x6213,0x62A6,0x63F5,0x6460,0x649D, + 0x64CE,0x654E,0x6600,0x6615,0x663B,0x6609,0x662E,0x661E, + 0x6624,0x6665,0x6657,0x6659,0xFA12,0x6673,0x6699,0x66A0, + 0x66B2,0x66BF,0x66FA,0x670E,0xF929,0x6766,0x67BB,0x6852, + 0x67C0,0x6801,0x6844,0x68CF,0xFA13,0x6968,0xFA14,0x6998, + 0x69E2,0x6A30,0x6A6B,0x6A46,0x6A73,0x6A7E,0x6AE2,0x6AE4, + 0x6BD6,0x6C3F,0x6C5C,0x6C86,0x6C6F,0x6CDA,0x6D04,0x6D87, + 0x6D6F,0x6D96,0x6DAC,0x6DCF,0x6DF8,0x6DF2,0x6DFC,0x6E39, + 0x6E5C,0x6E27,0x6E3C,0x6EBF,0x6F88,0x6FB5,0x6FF5,0x7005, + 0x7007,0x7028,0x7085,0x70AB,0x710F,0x7104,0x715C,0x7146, + 0x7147,0xFA15,0x71C1,0x71FE,0x72B1,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_ee[]={ + 0x72BE,0x7324,0xFA16,0x7377,0x73BD,0x73C9,0x73D6,0x73E3, + 0x73D2,0x7407,0x73F5,0x7426,0x742A,0x7429,0x742E,0x7462, + 0x7489,0x749F,0x7501,0x756F,0x7682,0x769C,0x769E,0x769B, + 0x76A6,0xFA17,0x7746,0x52AF,0x7821,0x784E,0x7864,0x787A, + 0x7930,0xFA18,0xFA19,0xFA1A,0x7994,0xFA1B,0x799B,0x7AD1, + 0x7AE7,0xFA1C,0x7AEB,0x7B9E,0xFA1D,0x7D48,0x7D5C,0x7DB7, + 0x7DA0,0x7DD6,0x7E52,0x7F47,0x7FA1,0xFA1E,0x8301,0x8362, + 0x837F,0x83C7,0x83F6,0x8448,0x84B4,0x8553,0x8559,0x30FB, + 0x856B,0xFA1F,0x85B0,0xFA20,0xFA21,0x8807,0x88F5,0x8A12, + 0x8A37,0x8A79,0x8AA7,0x8ABE,0x8ADF,0xFA22,0x8AF6,0x8B53, + 0x8B7F,0x8CF0,0x8CF4,0x8D12,0x8D76,0xFA23,0x8ECF,0xFA24, + 0xFA25,0x9067,0x90DE,0xFA26,0x9115,0x9127,0x91DA,0x91D7, + 0x91DE,0x91ED,0x91EE,0x91E4,0x91E5,0x9206,0x9210,0x920A, + 0x923A,0x9240,0x923C,0x924E,0x9259,0x9251,0x9239,0x9267, + 0x92A7,0x9277,0x9278,0x92E7,0x92D7,0x92D9,0x92D0,0xFA27, + 0x92D5,0x92E0,0x92D3,0x9325,0x9321,0x92FB,0xFA28,0x931E, + 0x92FF,0x931D,0x9302,0x9370,0x9357,0x93A4,0x93C6,0x93DE, + 0x93F8,0x9431,0x9445,0x9448,0x9592,0xF9DC,0xFA29,0x969D, + 0x96AF,0x9733,0x973B,0x9743,0x974D,0x974F,0x9751,0x9755, + 0x9857,0x9865,0xFA2A,0xFA2B,0x9927,0xFA2C,0x999E,0x9A4E, + 0x9AD9,0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00, + 0x9D70,0x9D6B,0xFA2D,0x9E19,0x9ED1,0x30FB,0x30FB,0x2170, + 0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177,0x2178, + 0x2179,0xFFE2,0xFFE4,0xFF07,0xFF02,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_ef[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f0[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f1[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f2[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f3[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f4[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f5[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f6[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f7[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f8[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_f9[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_fa[]={ + 0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, + 0x2178,0x2179,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165, + 0x2166,0x2167,0x2168,0x2169,0xffe2,0xffe4,0xff07,0xff02, + 0x3231,0x2116,0x2121,0x2235,0x7e8a,0x891c,0x9348,0x9288, + 0x84dc,0x4fc9,0x70bb,0x6631,0x68c8,0x92f9,0x66fb,0x5f45, + 0x4e28,0x4ee1,0x4efc,0x4f00,0x4f03,0x4f39,0x4f56,0x4f92, + 0x4f8a,0x4f9a,0x4f94,0x4fcd,0x5040,0x5022,0x4fff,0x501e, + 0x5046,0x5070,0x5042,0x5094,0x50f4,0x50d8,0x514a,0x30FB, + 0x5164,0x519d,0x51be,0x51ec,0x5215,0x529c,0x52a6,0x52c0, + 0x52db,0x5300,0x5307,0x5324,0x5372,0x5393,0x53b2,0x53dd, + 0xfa0e,0x549c,0x548a,0x54a9,0x54ff,0x5586,0x5759,0x5765, + 0x57ac,0x57c8,0x57c7,0xfa0f,0xfa10,0x589e,0x58b2,0x590b, + 0x5953,0x595b,0x595d,0x5963,0x59a4,0x59ba,0x5b56,0x5bc0, + 0x752f,0x5bd8,0x5bec,0x5c1e,0x5ca6,0x5cba,0x5cf5,0x5d27, + 0x5d53,0xfa11,0x5d42,0x5d6d,0x5db8,0x5db9,0x5dd0,0x5f21, + 0x5f34,0x5f67,0x5fb7,0x5fde,0x605d,0x6085,0x608a,0x60de, + 0x60d5,0x6120,0x60f2,0x6111,0x6137,0x6130,0x6198,0x6213, + 0x62a6,0x63f5,0x6460,0x649d,0x64ce,0x654e,0x6600,0x6615, + 0x663b,0x6609,0x662e,0x661e,0x6624,0x6665,0x6657,0x6659, + 0xfa12,0x6673,0x6699,0x66a0,0x66b2,0x66bf,0x66fa,0x670e, + 0xf929,0x6766,0x67bb,0x6852,0x67c0,0x6801,0x6844,0x68cf, + 0xfa13,0x6968,0xfa14,0x6998,0x69e2,0x6a30,0x6a6b,0x6a46, + 0x6a73,0x6a7e,0x6ae2,0x6ae4,0x6bd6,0x6c3f,0x6c5c,0x6c86, + 0x6c6f,0x6cda,0x6d04,0x6d87,0x6d6f,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_fb[]={ + 0x6D96,0x6DAC,0x6DCF,0x6DF8,0x6DF2,0x6DFC,0x6E39,0x6E5C, + 0x6E27,0x6E3C,0x6EBF,0x6F88,0x6FB5,0x6FF5,0x7005,0x7007, + 0x7028,0x7085,0x70AB,0x710F,0x7104,0x715C,0x7146,0x7147, + 0xFA15,0x71C1,0x71FE,0x72B1,0x72BE,0x7324,0xFA16,0x7377, + 0x73BD,0x73C9,0x73D6,0x73E3,0x73D2,0x7407,0x73F5,0x7426, + 0x742A,0x7429,0x742E,0x7462,0x7489,0x749F,0x7501,0x756F, + 0x7682,0x769C,0x769E,0x769B,0x76A6,0xFA17,0x7746,0x52AF, + 0x7821,0x784E,0x7864,0x787A,0x7930,0xFA18,0xFA19,0x30FB, + 0xFA1A,0x7994,0xFA1B,0x799B,0x7AD1,0x7AE7,0xFA1C,0x7AEB, + 0x7B9E,0xFA1D,0x7D48,0x7D5C,0x7DB7,0x7DA0,0x7DD6,0x7E52, + 0x7F47,0x7FA1,0xFA1E,0x8301,0x8362,0x837F,0x83C7,0x83F6, + 0x8448,0x84B4,0x8553,0x8559,0x856B,0xFA1F,0x85B0,0xFA20, + 0xFA21,0x8807,0x88F5,0x8A12,0x8A37,0x8A79,0x8AA7,0x8ABE, + 0x8ADF,0xFA22,0x8AF6,0x8B53,0x8B7F,0x8CF0,0x8CF4,0x8D12, + 0x8D76,0xFA23,0x8ECF,0xFA24,0xFA25,0x9067,0x90DE,0xFA26, + 0x9115,0x9127,0x91DA,0x91D7,0x91DE,0x91ED,0x91EE,0x91E4, + 0x91E5,0x9206,0x9210,0x920A,0x923A,0x9240,0x923C,0x924E, + 0x9259,0x9251,0x9239,0x9267,0x92A7,0x9277,0x9278,0x92E7, + 0x92D7,0x92D9,0x92D0,0xFA27,0x92D5,0x92E0,0x92D3,0x9325, + 0x9321,0x92FB,0xFA28,0x931E,0x92FF,0x931D,0x9302,0x9370, + 0x9357,0x93A4,0x93C6,0x93DE,0x93F8,0x9431,0x9445,0x9448, + 0x9592,0xF9DC,0xFA29,0x969D,0x96AF,0x9733,0x973B,0x9743, + 0x974D,0x974F,0x9751,0x9755,0x9857,0x9865,0xFA2A,0xFA2B, + 0x9927,0xFA2C,0x999E,0x9A4E,0x9AD9,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_fc[]={ + 0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00,0x9D70, + 0x9D6B,0xFA2D,0x9E19,0x9ED1,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_fd[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_fe[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short s2u_ff[]={ + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, + 0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB,0x30FB, +}; +unsigned short *s2u[] ={ + s2u_80,s2u_81,s2u_82,s2u_83,s2u_84,s2u_85,s2u_86,s2u_87, + s2u_88,s2u_89,s2u_8a,s2u_8b,s2u_8c,s2u_8d,s2u_8e,s2u_8f, + s2u_90,s2u_91,s2u_92,s2u_93,s2u_94,s2u_95,s2u_96,s2u_97, + s2u_98,s2u_99,s2u_9a,s2u_9b,s2u_9c,s2u_9d,s2u_9e,s2u_9f, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80,s2u_80, + s2u_e0,s2u_e1,s2u_e2,s2u_e3,s2u_e4,s2u_e5,s2u_e6,s2u_e7, + s2u_e8,s2u_e9,s2u_ea,s2u_eb,s2u_ec,s2u_ed,s2u_ee,s2u_ef, + s2u_f0,s2u_f1,s2u_f2,s2u_f3,s2u_f4,s2u_f5,s2u_f6,s2u_f7, + s2u_f8,s2u_f9,s2u_fa,s2u_fb,s2u_fc,s2u_fd,s2u_fe,s2u_ff, +}; diff --git a/src/s39ain.c b/src/s39ain.c new file mode 100644 index 0000000..c4510d8 --- /dev/null +++ b/src/s39ain.c @@ -0,0 +1,215 @@ +/* + * s39ain.c System39.ain read + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: s39ain.c,v 1.9 2003/07/21 23:06:47 chikama Exp $ */ + +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "LittleEndian.h" +#include "nact.h" +#include "s39ain.h" +#include "xsystem35.h" + +/* short cut */ +#define dll nact->ain.dll +#define msg nact->ain.msg +#define fnc nact->ain.fnc +#define path_to_dll nact->ain.path_to_dll +#define path_to_ain nact->ain.path_to_ain +#define dllnum nact->ain.dllnum +#define fncnum nact->ain.fncnum +#define varnum nact->ain.varnum +#define msgnum nact->ain.msgnum + +/* + system39.ain の読み込み +*/ +int s39ain_init(void) { + FILE *fp; + long len; + char *buf; + unsigned char *p; + int i, errors = 0; + + if (path_to_ain == NULL) { + return NG; + } + + if (path_to_dll == NULL) { + char path[512]; + getcwd(path, 400); + strcat(path, "/modules"); + path_to_dll = strdup(path); + } + + if (NULL == (fp = fopen(path_to_ain, "rb"))) { + WARNING("fail to open %s\n", path_to_ain); + return NG; + } + + fseek(fp, 0, SEEK_END); + len = ftell(fp); + fseek(fp, 0, SEEK_SET); + buf = malloc(len + 4); /* +4 : VARI/MSGI... 拡張のため */ + fread(buf, 1, len, fp); + fclose(fp); + + p = buf; + /* first check */ + if (0 != strncmp(p, "AINI", 4)) { + WARNING("%s is not ain file\n", path_to_ain); + free(buf); + return NG; + } + + /* decode .ain file (thanx to Tajiri) */ + i = len -4; + p = buf +4; + for (; i > 0; i--) { + unsigned char b = (*p) >> 6; + unsigned char c = (*p) << 2; + *p = b | c; + p++; + } + + p = buf +8; + if (0 != strncmp(p, "HEL0", 4)) { + WARNING("%s is illigal ain file\n", path_to_ain); + free(buf); + return NG; + } + p += 8; + dllnum = LittleEndian_getDW(p, 0); + dll = g_new(S39AIN_DLLINF, dllnum); + + p += 4; + for (i = 0; i < dllnum; i++) { + int fn, j; + + dll[i].name = strdup(p); /* DLL name */ + p += strlen(p) + 1; + + fn = LittleEndian_getDW(p, 0); /* number of function in DLL */ + p += 4; + + dll[i].function_num = fn; + dll[i].function = g_new(S39AIN_DLLFN, fn); + for (j = 0; j < fn; j++) { + int argc, k; + + dll[i].function[j].name = strdup(p); /* function name */ + p += strlen(p) + 1; + + argc = LittleEndian_getDW(p, 0); /* number of argument */ + p += 4; + + dll[i].function[j].argc = argc; + dll[i].function[j].argv = g_new(int, argc); + for (k = 0; k < argc; k++) { + dll[i].function[j].argv[k] = LittleEndian_getDW(p, 0); + p += 4; + } + } + } + + /* check FUNC */ + if (0 == strncmp(p, "FUNC", 4)) { + fncnum = LittleEndian_getDW(p, 8); + + fnc = g_new(S39AIN_FUNCNAME, fncnum); + p += 12; + + for (i = 0; i < fncnum; i++) { + fnc[i].name = strdup(p); + p += strlen(p) + 1; + fnc[i].page = LittleEndian_getW(p, 0); + fnc[i].index = LittleEndian_getDW(p, 2); + p += 6; + } + } + + /* check VARI */ + if (0 == strncmp(p, "VARI", 4)) { + varnum = LittleEndian_getDW(p, 8); + p += 12; + for (i = 0; i < varnum; i++) { + p += strlen(p) + 1; + } + } + + /* check MSGI */ + if (0 == strncmp(p, "MSGI", 4)) { + msgnum = LittleEndian_getDW(p, 8); + + msg = g_new(char *, msgnum); + p += 12; + + for (i = 0; i < msgnum; i++) { + msg[i] = strdup(p); + p += strlen(p) + 1; + } + } + + errors = lt_dlinit(); + if (errors) { + printf("lt_dlinit fail\n"); + free(buf); + return FALSE; + } + + /* open dll */ + for (i = 0; i < dllnum; i++) { + char searchpath[512]; + void *handle; + + if (dll[i].function_num == 0) continue; + + // 最初にカレントディレクトリのソースツリーの下の + // モジュールを検索 + g_snprintf(searchpath, sizeof(searchpath) -1, "%s/%s", + path_to_dll, dll[i].name); + + lt_dlsetsearchpath(searchpath); + + // 次にデフォルトのモジュールを検索 + /* package default path, ex. /usr/local/lib/xsystem35/ */ + lt_dladdsearchdir(MODULE_PATH); + + // fprintf(stderr, "try to open %s/%s\n", searchpath, dll[i].name); + handle = lt_dlopenext(dll[i].name); + + if (handle == NULL) { + SYSERROR("dlopen: %s(%s)\n", lt_dlerror(), dll[i].name); + } + + dll[i].handle = handle; + } + + free(buf); + return OK; +} diff --git a/src/s39ain.h b/src/s39ain.h new file mode 100644 index 0000000..8348351 --- /dev/null +++ b/src/s39ain.h @@ -0,0 +1,70 @@ +/* + * s39ain.h System39.ain read + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: s39ain.h,v 1.1 2001/09/16 15:59:11 chikama Exp $ */ + +#ifndef __S39AIN_H__ +#define __S39AIN_H__ + +#include +#include "portab.h" + +/* DLL 内関数情報 */ +typedef struct { + char *name; /* 関数名 */ + int argc; /* 関数の引数の数 */ + int *argv; /* 関数の引数のそれぞれの種類 */ +} S39AIN_DLLFN; + +/* DLL 情報 */ +typedef struct { + lt_dlhandle *handle; /* DLL handler */ + char *name; /* DLL 名 */ + int function_num; /* 関数の数 */ + S39AIN_DLLFN *function; /* 関数本体 */ +} S39AIN_DLLINF; + +/* シナリオ関数情報 */ +typedef struct { + char *name; /* シナリオ関数名 */ + int page; /* シナリオ上の位置 (ページ番号) */ + int index; /* シナリオ上の位置 (アドレス) */ +} S39AIN_FUNCNAME; + +/* System39.ain 全体の情報 */ +typedef struct { + char *path_to_ain; /* system39.ain へのパス */ + char *path_to_dll; /* DLL モジュールへのパス */ + + int dllnum; /* DLL の数 */ + int fncnum; /* FUNC の数 */ + int varnum; /* VARI の数 */ + int msgnum; /* MSGI の数 */ + + S39AIN_DLLINF *dll; /* DLL に関数る情報 */ + S39AIN_FUNCNAME *fnc; /* FUNC に関する情報 */ + char **var; /* VARI に関する情報 */ + char **msg; /* MSGI に関する情報 */ +} S39AIN; + +extern int s39ain_init(void); + +#endif /* __S39AIN_H__ */ diff --git a/src/s39init.c b/src/s39init.c new file mode 100644 index 0000000..4aa40b9 --- /dev/null +++ b/src/s39init.c @@ -0,0 +1,157 @@ +/* + * s39init.c System39.ini read + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: s39init.c,v 1.2 2003/04/27 11:00:36 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include "portab.h" +#include "system.h" +#include "nact.h" +#include "s39init.h" +#include "eucsjis.h" +#include "music_client.h" + +// Volume Valancer で扱う最大チャンネル数 +#define MAXVOLCH 16 + +static int vval_max; // 最大チャンネル番号 +struct _volval { + char *label; + int vol; + boolean mute; +}; +static struct _volval vval[MAXVOLCH]; +static GtkWidget *vval_win; + +#include "menu_gui_volval.c" + +// 初期化 +int s39ini_init(void) { + FILE *fp; + char s[256], s1[256]; + int i, vol[MAXVOLCH] = {0}; + char fn[256]; + + if (nact->files.init == NULL) return NG; + + if (NULL == (fp = fopen(nact->files.init, "r"))) return NG; + + while (fgets(s, 255, fp) != NULL) { + s1[0] = '\0'; + sscanf(s, "VolumeValancer[%d] = \"%s", &i, s1); + if (s1[0] == '\0') continue; + if (i >= MAXVOLCH || i < 0) continue; + s1[strlen(s1)-1] = '\0'; // remove last '"' + vval[i].label = sjis2lang(s1); + vval_max = MAX(vval_max, i); + //WARNING("VolumeValancer[%d] = %s\n", i, vval[i].label); + } + + if (vval_max <= 0) return NG; + + // Volume.sav があればそれを読み込む + g_snprintf(fn, sizeof(fn) -1, "%s/Volume.sav", nact->files.savedir); + if (NULL == (fp = fopen(fn, "r"))) { + // とりあえず、初期ボリュームは 100 + for (i = 0; i < MAXVOLCH; i++) { + vol[i] = vval[i].vol = 100; + } + } else { + fread(vol, sizeof(int), MAXVOLCH, fp); + fclose(fp); + for (i = 0; i < MAXVOLCH; i++) { + vval[i].vol = vol[i]; + } + } + // どちらにしても music server に送る + mus_vol_set_valance(vol, MAXVOLCH); + + // System39.ini に VolumeValancer が無かったらなし + if (vval_max > 0) { + vval_win = vval_win_open(vval, vval_max); + } + + return OK; +} + +// PopupMenuから呼ばれる +int s39ini_winopen() { + if (vval_win) { + gtk_widget_show(vval_win); + nact->popupmenu_opened = TRUE; + } + return OK; +} + +// ボリューム設定Windowが閉じられたときに呼ばれる +int s39ini_winclose() { + if (vval_win) { + gtk_widget_hide(vval_win); + nact->popupmenu_opened = FALSE; + } + return OK; +} + +// ボリューム設定でスケールを動かすたびに呼ばれる +int s39ini_setvol() { + int vol[MAXVOLCH] = {0}; + int i; + + if (vval_win == NULL) return OK; + + for (i = 0; i < MAXVOLCH; i++) { + vol[i] = vval[i].mute ? 0 : vval[i].vol; + } + + mus_vol_set_valance(vol, MAXVOLCH); + return OK; +} + +// Volume Valance をセーブ +int s39ini_remove() { + int vol[MAXVOLCH] = {0}; + FILE *fp; + char fn[256]; + int i; + + if (vval_win == NULL) return OK; + + for (i = 0; i < MAXVOLCH; i++) { + vol[i] = vval[i].vol; + } + + g_snprintf(fn, sizeof(fn) -1, "%s/Volume.sav", nact->files.savedir); + if (NULL == (fp = fopen(fn, "w"))) { + WARNING("Fail to save Volume.save\n"); + return NG; + } + + fwrite(vol, sizeof(int), MAXVOLCH, fp); + fclose(fp); + + return OK; + +} diff --git a/src/s39init.h b/src/s39init.h new file mode 100644 index 0000000..926ec55 --- /dev/null +++ b/src/s39init.h @@ -0,0 +1,33 @@ +/* + * s39init.h System39.ini read + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: s39init.h,v 1.1 2003/04/25 17:23:55 chikama Exp $ */ + +#ifndef __S39INIT_H__ +#define __S39INIT_H__ + +extern int s39ini_init(); +extern int s39ini_winopen(); +extern int s39ini_winclose(); +extern int s39ini_setvol(); +extern int s39ini_remove(); + +#endif diff --git a/src/savedata.c b/src/savedata.c new file mode 100644 index 0000000..f6825d8 --- /dev/null +++ b/src/savedata.c @@ -0,0 +1,826 @@ +/* + * savedate.c セーブデータの管理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: savedata.c,v 1.36 2003/07/21 23:06:47 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "savedata.h" +#include "scenario.h" +#include "xsystem35.h" +#include "LittleEndian.h" +#include "eucsjis.h" +#include "filecheck.h" +#include "windowframe.h" +#include "selection.h" +#include "message.h" + +/* セーブデータ */ +static char *saveDataFile[SAVE_MAXNUMBER]; +static char *saveDataPath; +static int savefile_sysvar_cnt = SYSVAR_MAX; + +static void* saveStackInfo(Ald_stackHdr *head); +static void loadStackInfo(char *buf); +static void* saveStrVar(Ald_strVarHdr *head); +static void loadStrVar(char *buf); +static void* saveSysVar(Ald_sysVarHdr *head, int page); +static int loadSysVar(char *buf); +static void* loadGameData(int no, int *status, int *size); +static int saveGameData(int no, char *buf, int size); + + + +/* savefile がある directory を登録 */ +void save_set_path(char *path) { + nact->files.savedir = strdup(path); + saveDataPath = strdup(path); + fc_init(path); +} + +/* savefile を登録 */ +void save_register_file(char *name, int index) { + saveDataFile[index] = strdup(name); +} + +/* savefile を参照 */ +char *save_get_file(int index) { + return saveDataFile[index]; +} + +/* savefile を削除 */ +int save_delete_file(int index) { + int ret = unlink(saveDataFile[index]); + + if (ret == 0) { + return 1; + } + return 1; /* とりあえず */ +} + +static char *get_fullpath(char *filename) { + char *fn = malloc(strlen(filename) + strlen(saveDataPath) + 3); + if (fn == NULL) { + return NULL; + } + strcpy(fn, saveDataPath); + strcat(fn, "/"); + strcat(fn, filename); + return fn; +} + +static void backup_oldfile(char *filename) { + char *newname; + + if (!filename) return; + newname = malloc(strlen(filename) + 3); + + strcpy(newname, filename); + strcat(newname, "."); + rename(filename, newname); + + free(newname); +} + +static FILE *fileopen(char *filename, char type) { + char *fc = fc_search(filename); + char *fullpath; + FILE *fp; + + if (fc == NULL) { /* if file does not exist */ + if (type == 'r') return NULL; + fc = fc_add(filename); + } + fullpath = get_fullpath(fc); + + if (type == 'w') { + backup_oldfile(fullpath); + fp = fopen(fullpath, "w"); + } else { + fp = fopen(fullpath, "r"); + } + free(fullpath); + return fp; +} + +/* 指定ファイルへの変数の書き込み */ +int save_save_var_with_file(char *filename, int *start, int cnt) { + int status = 0, size, i; + FILE *fp; + WORD *tmp, *_tmp; + + tmp = _tmp = (WORD *)malloc(cnt * sizeof(WORD)); + + if (tmp == NULL) { + WARNING("Out of memory\n"); + return SAVE_SAVEERR; + } + + for (i = 0; i < cnt; i++) { +#ifdef WORDS_BIGENDIAN + *tmp = swap16((WORD)*start); start++; tmp++; +#else + *tmp = (WORD)*start; start++; tmp++; +#endif + } + + if (NULL == (fp = fileopen(filename, 'w'))) { + status = SAVE_SAVEERR; goto errexit; + } + + size = fwrite(_tmp, sizeof(WORD), cnt, fp); + + if (size != cnt) { + status = SAVE_OTHERERR; + } else { + status = SAVE_SAVEOK0; + } + + fclose(fp); + errexit: + free(_tmp); + + return status; +} + +/* 指定ファイルからの変数の読み込み */ +int save_load_var_with_file(char *filename, int *start, int cnt) { + int status = 0, size, i; + FILE *fp; + WORD *tmp, *_tmp; + + tmp = _tmp = (WORD *)malloc(cnt * sizeof(WORD)); + + if (tmp == NULL) { + WARNING("Out of memory\n"); + return SAVE_LOADERR; + } + + if (NULL == (fp = fileopen(filename, 'r'))) { + status = SAVE_LOADERR; goto errexit; + } + + size = fread(tmp, sizeof(WORD), cnt, fp); + + if (size != cnt) { + status = SAVE_LOADSHORTAGE; + } else { + status = SAVE_LOADOK; + } + + for (i = 0; i < cnt; i++) { +#ifdef WORDS_BIGENDIAN + *start = swap16(*tmp); start++; tmp++; +#else + *start = *tmp; start++; tmp++; +#endif + } + + fclose(fp); + errexit: + free(_tmp); + return status; +} + + +/* 指定ファイルへの文字列の書き込み, start = 1~ */ +int save_save_str_with_file(char *filename, int start, int cnt) { + int status = 0, size, _size,i; + FILE *fp; + char *tmp, *_tmp; + + _tmp = tmp = malloc(strvar_cnt * strvar_len); + if (tmp == NULL) { + WARNING("Out of memory\n"); + return SAVE_LOADSHORTAGE; + } + + *tmp = 0; + for (i = 0; i < cnt; i++) { + strncpy(tmp, v_str(start + i - 1), strvar_len - 1); + tmp += v_strlen(start + i - 1) + 1; + } + + + if (NULL == (fp = fileopen(filename, 'w'))) { + status = SAVE_SAVEERR; goto errexit; + } + size = tmp - _tmp; + _size = fwrite(_tmp, sizeof(char), size , fp); + + if (size != _size) { + status = SAVE_OTHERERR; + } else { + status = SAVE_SAVEOK0; + } + + fclose(fp); + errexit: + free(_tmp); + + return status; +} + +/* 指定ファイルからの文字列の読み込み */ +int save_load_str_with_file(char *filename, int start, int cnt) { + int status = 0, size, i; + FILE *fp; + char *tmp, *_tmp=NULL; + long filesize; + + if (NULL == (fp = fileopen(filename, 'r'))) { + return SAVE_LOADERR; + } + + fseek(fp, 0L, SEEK_END); + filesize = ftell(fp); + if (filesize == 0) { + return SAVE_LOADERR; + } + + tmp = _tmp = (char *)malloc(filesize); + if (tmp == NULL) { + WARNING("Out of memory\n"); + return SAVE_LOADERR; + } + + fseek(fp, 0L, SEEK_SET); + size = fread(tmp, 1, filesize,fp); + + if (size != filesize) { + status = SAVE_LOADSHORTAGE; + } else { + status = SAVE_LOADOK; + } + for (i = 0; i < cnt; i++) { + strncpy(v_str(start + i - 1), tmp, strvar_len); + tmp += v_strlen(start + i - 1) + 1; + } + fclose(fp); + free(_tmp); + + return status; +} + +/* セーブファイルのコピー */ +int save_copyAll(int dstno, int srcno) { + char *saveTop; + int status, filesize; + + if (dstno >= SAVE_MAXNUMBER || srcno >= SAVE_MAXNUMBER) { + // fprintf(stderr, "dstno or srcno is outof range\n"); + return SAVE_SAVEERR; + } + saveTop = loadGameData(srcno, &status, &filesize); + if (saveTop == NULL) + return SAVE_SAVEERR; + if (((Ald_baseHdr *)saveTop)->version != SAVE_DATAVERSION) { + fprintf(stderr, "save_copyAll(): endian mismatch\n"); + free(saveTop); + return SAVE_SAVEERR; + } + status = saveGameData(dstno, saveTop, filesize); + + free(saveTop); + + return status; +} + +/* データの一部ロード */ +int save_loadPartial(int no, int page, int offset, int cnt) { + Ald_baseHdr *save_base; + char *vtop; + WORD *tmp; + int *var; + char *saveTop = NULL; + int i, status, filesize; + + if (no >= SAVE_MAXNUMBER) { + return SAVE_SAVEERR; + } + if (page == 0) { + cnt = min(cnt, SYSVAR_MAX - offset); + var = sysVar + offset; + } else { + cnt = min(cnt, arrayVarBuffer[page - 1].max - offset); + var = arrayVarBuffer[page - 1].value + offset; + } + + saveTop = loadGameData(no, &status, &filesize); + if (saveTop == NULL) { + // fprintf(stderr, "loadGameData() faild\n"); + return status; + } + + if (filesize <= sizeof(Ald_baseHdr)) { + // fprintf(stderr, "filesize too short\n"); + goto errexit; + } + + save_base = (Ald_baseHdr *)saveTop; + if (save_base->version != SAVE_DATAVERSION) { + fprintf(stderr, "save_loadPartial(): endian mismatch\n"); + goto errexit; + } + + if (save_base->varSys[page] == 0) { + // fprintf(stderr, "No available Variable\n"); + goto errexit; + } + vtop = saveTop + save_base->varSys[page] + sizeof(Ald_sysVarHdr); + tmp = (WORD *)vtop + offset; + for (i = 0; i < cnt; i++) { + *var = *tmp; tmp++; var++; + } + free(saveTop); + return SAVE_LOADOK; + + errexit: + if (saveTop != NULL) + free(saveTop); + + return SAVE_LOADERR; +} + +/* データの一部セーブ */ +int save_savePartial(int no, int page, int offset, int cnt) { + Ald_baseHdr *save_base; + WORD *tmp; + char *vtop; + int *var; + char *saveTop = NULL; + int i, status, filesize; + + if (no >= SAVE_MAXNUMBER) { + return SAVE_SAVEERR; + } + if (page == 0) { + cnt = min(cnt, SYSVAR_MAX - offset); + var = sysVar + offset; + } else { + if (arrayVarBuffer[page - 1].saveflag == FALSE) + goto errexit; + cnt = min(cnt, arrayVarBuffer[page - 1].max - offset); + var = arrayVarBuffer[page - 1].value + offset; + } + + saveTop = loadGameData(no, &status, &filesize); + if (saveTop == NULL) + return status; + if (filesize <= sizeof(Ald_baseHdr)) + goto errexit; + save_base = (Ald_baseHdr *)saveTop; + if (save_base->version != SAVE_DATAVERSION) { + fprintf(stderr, "save_savePartial(): endian mismatch\n"); + goto errexit; + } + vtop = saveTop + save_base->varSys[page] + sizeof(Ald_sysVarHdr); + tmp = (WORD *)vtop + offset; + for (i = 0; i < cnt; i++) { + *tmp = (WORD)*var; tmp++; var++; + } + status = saveGameData(no, saveTop, filesize); + free(saveTop); + + return status; + + errexit: + if (saveTop != NULL) + free(saveTop); + + return SAVE_SAVEERR; +} + + +/* データのロード */ +int save_loadAll(int no) { + Ald_baseHdr *save_base; + char *saveTop = NULL; + int i, status, filesize; + + if (no >= SAVE_MAXNUMBER) { + return SAVE_SAVEERR; + } + saveTop = loadGameData(no, &status, &filesize); + if (saveTop == NULL) + return status; + if (filesize <= sizeof(Ald_baseHdr)) + goto errexit; + /* 各種データの反映 */ + save_base = (Ald_baseHdr *)saveTop; + if (save_base->version != SAVE_DATAVERSION) { + fprintf(stderr, "save_loadAll(): endian mismatch\n"); + goto errexit; + } + if (strcmp(SAVE_DATAID, save_base->ID) != 0) + goto errexit; + nact->sel.MsgFontSize = save_base->selMsgSize; + nact->sel.MsgFontColor = save_base->selMsgColor; + nact->sel.WinBackgroundColor = save_base->selBackColor; + nact->sel.WinFrameColor = save_base->selFrameColor; + nact->msg.MsgFontSize = save_base->msgMsgSize; + nact->msg.MsgFontColor = save_base->msgMsgColor; + nact->msg.WinBackgroundColor = save_base->msgBackColor; + nact->msg.WinFrameColor = save_base->msgFrameColor; + sl_jmpFar2(save_base->scoPage, save_base->scoIndex); + + for (i = 0; i < SELWINMAX; i++) { + selWinInfo[i].x = save_base->selWinInfo[i].x; + selWinInfo[i].y = save_base->selWinInfo[i].y; + selWinInfo[i].width = save_base->selWinInfo[i].width; + selWinInfo[i].height = save_base->selWinInfo[i].height; + // selWinInfo[i].save = TRUE; + } + for (i = 0; i < MSGWINMAX; i++) { + msgWinInfo[i].x = save_base->msgWinInfo[i].x; + msgWinInfo[i].y = save_base->msgWinInfo[i].y; + msgWinInfo[i].width = save_base->msgWinInfo[i].width; + msgWinInfo[i].height = save_base->msgWinInfo[i].height; + // msgWinInfo[i].savedImage = NULL; + // msgWinInfo[i].save = FALSE; + } + /* スタックのロード */ + loadStackInfo(saveTop + save_base->stackinfo); + /* 文字列変数のロード */ + loadStrVar(saveTop + save_base->varStr); + /* 数値・配列変数のロード */ + for (i = 0; i < 256; i++) { + if (save_base->varSys[i] != 0) { + if (SAVE_LOADOK != loadSysVar(saveTop + save_base->varSys[i])) + goto errexit; + + } + } + free(saveTop); + return SAVE_LOADOK; + errexit: + free(saveTop); + return SAVE_LOADERR; +} + +/* データのセーブ */ +int save_saveAll(int no) { + Ald_baseHdr *save_base = calloc(1, sizeof(Ald_baseHdr)); + Ald_strVarHdr save_strHdr; + Ald_stackHdr save_stackHdr; + Ald_sysVarHdr save_sysHdr; + char *sd_varStr = NULL; + char *sd_stack = NULL; + char *sd_varSys = NULL; + int i, totalsize = sizeof(Ald_baseHdr); + FILE *fp; + + if (no >= SAVE_MAXNUMBER) + return SAVE_SAVEERR; + + if (save_base == NULL) + return SAVE_SAVEERR; + + backup_oldfile(saveDataFile[no]); + fp = fopen(saveDataFile[no],"wb"); + + if (fp == NULL) + return SAVE_SAVEERR; + + memset(&save_stackHdr, 0, sizeof(Ald_stackHdr)); + memset(&save_strHdr, 0, sizeof(Ald_strVarHdr)); + memset(&save_sysHdr, 0, sizeof(Ald_sysVarHdr)); + + /* 各種データのセーブ */ + strncpy(save_base->ID, SAVE_DATAID, 32); + save_base->version = SAVE_DATAVERSION; + save_base->selMsgSize = (BYTE)nact->sel.MsgFontSize; + save_base->selMsgColor = (BYTE)nact->sel.MsgFontColor; + save_base->selBackColor = (BYTE)nact->sel.WinBackgroundColor; + save_base->selFrameColor = (BYTE)nact->sel.WinFrameColor; + save_base->msgMsgSize = (BYTE)nact->msg.MsgFontSize; + save_base->msgMsgColor = (BYTE)nact->msg.MsgFontColor; + save_base->msgBackColor = (BYTE)nact->msg.WinBackgroundColor; + save_base->msgFrameColor = (BYTE)nact->msg.WinFrameColor; + save_base->scoPage = sl_getPage(); + save_base->scoIndex = sl_getIndex(); + + for (i = 0; i < SELWINMAX; i++) { + save_base->selWinInfo[i].x = (WORD)selWinInfo[i].x; + save_base->selWinInfo[i].y = (WORD)selWinInfo[i].y; + save_base->selWinInfo[i].width = (WORD)selWinInfo[i].width; + save_base->selWinInfo[i].height = (WORD)selWinInfo[i].height; + } + + for (i = 0; i < MSGWINMAX; i++) { + save_base->msgWinInfo[i].x = (WORD)msgWinInfo[i].x; + save_base->msgWinInfo[i].y = (WORD)msgWinInfo[i].y; + save_base->msgWinInfo[i].width = (WORD)msgWinInfo[i].width; + save_base->msgWinInfo[i].height = (WORD)msgWinInfo[i].height; + } + + fseek(fp, sizeof(Ald_baseHdr), SEEK_SET); + + /* スタック情報 */ + if (NULL == (sd_stack = saveStackInfo(&save_stackHdr))) + goto errexit; + + if (1 != fwrite(&save_stackHdr, sizeof(save_stackHdr), 1, fp)) + goto errexit; + + if (save_stackHdr.size != 0 && 1 != fwrite(sd_stack, save_stackHdr.size, 1, fp)) + goto errexit; + + save_base->stackinfo = totalsize; + totalsize += save_stackHdr.size + sizeof(Ald_stackHdr); + + /* 文字列変数 */ + if (NULL == (sd_varStr = saveStrVar(&save_strHdr))) + goto errexit; + + if (1 != fwrite(&save_strHdr, sizeof(Ald_strVarHdr), 1, fp)) + goto errexit; + + if (save_strHdr.size != 0 && 1 != fwrite(sd_varStr, save_strHdr.size, 1, fp)) + goto errexit; + + save_base->varStr = totalsize; + totalsize += save_strHdr.size + sizeof(Ald_strVarHdr); + free(sd_varStr); + + /* 数値変数・配列変数 */ + for (i = 0; i < 256; i++) { + sd_varSys = saveSysVar(&save_sysHdr, i); + if (sd_varSys == NULL) { + save_base->varSys[i] = 0; + } else { + if (1 != fwrite(&save_sysHdr, sizeof(Ald_sysVarHdr), 1, fp)) + goto errexit; + if (1 != fwrite(sd_varSys, save_sysHdr.size, 1, fp)) + goto errexit; + save_base->varSys[i] = totalsize; + totalsize += save_sysHdr.size + sizeof(Ald_sysVarHdr); + free(sd_varSys); + } + } + + fseek(fp, 0, SEEK_SET); + + if (1 != fwrite(save_base, sizeof(Ald_baseHdr), 1, fp)) + goto errexit; + + fclose(fp); + free(save_base); + + return SAVE_SAVEOK1; + + errexit: + if (fp != NULL) + fclose(fp); + if (save_base != NULL) + free(save_base); + if (sd_varStr != NULL) + free(sd_varStr); + if (sd_varSys != NULL) + free(sd_varSys); + + return SAVE_SAVEERR; +} + +/* スタック情報のセーブ */ +static void *saveStackInfo(Ald_stackHdr *head) { + int count; + int *info = sl_getStackInfo(&count); + + head->size = count * sizeof(int); + return (void *)info; +} + +/* スタック情報のロード */ +static void loadStackInfo(char *buf) { + Ald_stackHdr *head = (Ald_stackHdr *)buf; + char *data = buf + sizeof(Ald_stackHdr); + sl_putStackInfo((int *)data, head->size / sizeof(int)); +} + +/* 文字列変数のセーブ */ +static void *saveStrVar(Ald_strVarHdr *head) { + int i; + char *tmp, *_tmp; + _tmp = tmp = malloc(strvar_cnt * strvar_len); + if (tmp == NULL) { + WARNING("Out of memory\n"); + return NULL; + } + *tmp = 0; + for (i = 0; i < strvar_cnt; i++) { + strncpy(tmp, v_str(i), strvar_len - 1); + tmp += v_strlen(i) + 1; + } + head->size = tmp - _tmp; + head->count = strvar_cnt; + head->maxlen = strvar_len; + return _tmp; +} + +/* 文字列変数のロード */ +static void loadStrVar(char *buf) { + Ald_strVarHdr *head = (Ald_strVarHdr *)buf; + int cnt, max, i; + + cnt = head->count; + max = head->maxlen; + if (strvar_cnt != cnt || strvar_len != max) + v_initStringVars(cnt, max); + buf += sizeof(Ald_strVarHdr); + for (i = 0; i < cnt; i++) { + strncpy(v_str(i), buf, max - 1); + buf += v_strlen(i) + 1; + } +} + +/* 数値・配列変数のセーブ */ +static void *saveSysVar(Ald_sysVarHdr *head, int page) { + int *var; + int cnt, i; + WORD *tmp, *_tmp; + if (page == 0) { /* sysVar */ + cnt = min(savefile_sysvar_cnt, SYSVAR_MAX); + var = sysVar; + } else if (!arrayVarBuffer[page - 1].saveflag) { + return NULL; + } else { + cnt = arrayVarBuffer[page - 1].max; + var = arrayVarBuffer[page - 1].value; + if (var == NULL) + return NULL; + } + head->size = cnt * sizeof(WORD); + head->pageNo = page; + tmp = _tmp = (WORD *)malloc(cnt * sizeof(WORD)); + if (tmp == NULL) { + WARNING("Out of memory\n"); + return NULL; + } + for (i = 0; i < cnt; i++) { + *tmp = (WORD)*var; var++; tmp++; + } + return _tmp; +} + +/* 数値・配列変数のロード */ +static int loadSysVar(char *buf) { + int i, cnt; + int *var; + int bool; + WORD *data; + Ald_sysVarHdr *head = (Ald_sysVarHdr *)buf; + int page = head->pageNo; + + if (page == 0) { +#if 0 + if (head->size != SYSVAR_MAX * sizeof(WORD)) + return SAVE_LOADERR; + var = sysVar; + cnt = SYSVAR_MAX; +#endif + var = sysVar; + cnt = savefile_sysvar_cnt = head->size / sizeof(WORD); + } else { + cnt = head->size / sizeof(WORD); + if (arrayVarBuffer[page - 1].max != cnt || + arrayVarBuffer[page - 1].value == NULL) { + /* + fprintf(stderr, "loadSysVar(): undef array\n"); + return SAVE_LOADERR; + */ + + bool = v_allocateArrayBuffer(page, cnt, TRUE); + if (!bool) { + fprintf(stderr, "v_allocateArrayBuffer fail\n"); + return SAVE_LOADERR; + } + + } + var = arrayVarBuffer[page - 1].value; + } + buf += sizeof(Ald_sysVarHdr); + data = (WORD *)buf; + for (i = 0; i < cnt; i++) { + *var++ = *data++; + } + return SAVE_LOADOK; +} + + +/* ゲームデータのロード + + no: セーブファイル番号 0~ + *status: ステータス + *size: データの大きさを返すポインタ + +あとで free(*buf)するのを忘れないように +*/ +static void* loadGameData(int no, int *status, int *size) { + FILE *fp; + long filesize; + char *buf; + + fp = fopen(saveDataFile[no], "rb"); + if (fp == NULL) + goto errexit; + fseek(fp, 0L, SEEK_END); + filesize = ftell(fp); + if (filesize == 0) + goto errexit; + + buf = (char *)malloc(filesize); + if (buf == NULL) + goto errexit; + + fseek(fp, 0L, SEEK_SET); + fread(buf, filesize, 1, fp); + fclose(fp); + + *size = (int)filesize; + *status = SAVE_LOADOK; + return buf; + + errexit: + if (fp != NULL) + fclose(fp); + *status = SAVE_LOADERR; + return NULL; +} + +static int saveGameData(int no, char *buf, int size) { + FILE *fp; + int status = SAVE_SAVEOK1; + + backup_oldfile(saveDataFile[no]); + fp = fopen(saveDataFile[no],"wb"); + if (fp == NULL) { + return SAVE_SAVEERR; + } + if (size != fwrite(buf, size, 1, fp)) { + status = SAVE_SAVEERR; + } + fclose(fp); + return status; +} + +/* 指定ファイルからの画像の読み込み thanx tajiru@wizard */ +BYTE* load_cg_with_file(char *filename, int *status){ + int size; + FILE *fp; + static BYTE *tmp; + long filesize; + + *status = 0; + + if (NULL == (fp = fileopen(filename, 'r'))) { + *status = SAVE_LOADERR; return NULL; + } + + fseek(fp, 0L, SEEK_END); + filesize = ftell(fp); + if (filesize == 0) { + *status = SAVE_LOADERR; return NULL; + } + + tmp = (char *)malloc(filesize); + if (tmp == NULL) { + WARNING("Out of memory\n"); + *status = SAVE_LOADERR; return NULL; + } + fseek(fp, 0L, SEEK_SET); + size = fread(tmp, 1, filesize,fp); + + if (size != filesize) { + *status = SAVE_LOADSHORTAGE; + } else { + *status = SAVE_LOADOK; + } + + fclose(fp); + return tmp; +} diff --git a/src/savedata.h b/src/savedata.h new file mode 100644 index 0000000..5cd076f --- /dev/null +++ b/src/savedata.h @@ -0,0 +1,128 @@ +/* + * savedata.h セーブデータの管理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: savedata.h,v 1.13 2001/05/08 05:36:08 chikama Exp $ */ + +#ifndef __SAVEDATA__ +#define __SAVEDATA__ + +#include "portab.h" +#include "cg.h" +#include "windowframe.h" + +#define SAVE_MAXNUMBER (26) + +#define SAVE_SAVEERR (255) +#define SAVE_LOADERR (255) +#define SAVE_LOADSHORTAGE (254) +#define SAVE_OTHERERR (201) +#define SAVE_LOADOK (0) +#define SAVE_SAVEOK1 (1) +#define SAVE_SAVEOK0 (0) + +#define SAVE_DATAID "System3.5 SavaData(c)ALICE-SOFT" +#define SAVE_DATAVERSION 0x350200 + +typedef struct { + WORD x; + WORD y; + WORD width; + WORD height; +} RectangleW; + +typedef struct { + char ID[32]; + int version; + char gameName[28]; + BYTE selMsgSize; + BYTE selMsgColor; + BYTE selBackColor; + BYTE selFrameColor; + BYTE msgMsgSize; + BYTE msgMsgColor; + BYTE msgBackColor; + BYTE msgFrameColor; + BYTE rsvB1; + BYTE rsvB2; + BYTE rsvB3; + BYTE rsvB4; + BYTE rsvB5; + BYTE rsvB6; + BYTE rsvB7; + BYTE rsvB8; + int scoPage; + int scoIndex; + int rsvI1; + int rsvI2; + RectangleW selWinInfo[SELWINMAX]; + RectangleW msgWinInfo[MSGWINMAX]; + int stackinfo; + int varStr; + int rsvI3; + int rsvI4; + int varSys[256]; + int rsvI[228]; +} Ald_baseHdr; + +typedef struct { + int size; + int count; + int maxlen; + int rsv1; +} Ald_strVarHdr; + +typedef struct { + int size; + int rsv1; + int rsv2; + int rsv3; +} Ald_stackHdr; + +typedef struct { + int size; + int pageNo; + int rsv1; + int rsv2; +} Ald_sysVarHdr; + +/* defined by cmdb.c */ +extern Bcom_WindowInfo msgWinInfo[]; +extern Bcom_WindowInfo selWinInfo[]; +/* defined by variable.c */ +extern int strvar_cnt; +extern int strvar_len; + +extern int save_loadAll(int no); +extern int save_saveAll(int no); +extern int save_loadPartial(int no, int page, int offset, int cnt); +extern int save_savePartial(int no, int page, int offset, int cnt); +extern int save_copyAll(int dstno, int srcno); +extern int save_save_var_with_file(char *filename, int *start, int cnt); +extern int save_load_var_with_file(char *filename, int *start, int cnt); +extern int save_save_str_with_file(char *filename, int start, int cnt); +extern int save_load_str_with_file(char *filename, int start, int cnt); +extern BYTE* load_cg_with_file(char *file,int *status); +extern void save_set_path(char *path); +extern void save_register_file(char *name, int index); +extern char* save_get_file(int index); +extern int save_delete_file(int index); + +#endif /* __SAVEDATA__ */ diff --git a/src/scenario.c b/src/scenario.c new file mode 100644 index 0000000..099fc47 --- /dev/null +++ b/src/scenario.c @@ -0,0 +1,598 @@ +/* + * scenario.c シナリオ管理実行 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: scenario.c,v 1.30 2003/04/25 17:23:55 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "ald_manager.h" +#include "variable.h" +#include "scenario.h" +#include "LittleEndian.h" +#include "xsystem35.h" + +/* stack data type */ +#define STACK_NEARJMP 1 +#define STACK_FARJMP 2 +#define STACK_VARIABLE 3 +#define STACK_DATA 4 + +/* static mathods */ +static void popVars(int *tmp); +static void popDatas(int *tmp); +static void showStackInfo(); +static void sl_push(int type, int *val, int cnt); +static int* sl_pop(); + +/* static variables */ +static BYTE *sl_sco; /* scenario data */ +static int *sco_stackbuf; /* stack data */ +static int *sco_stackindex; /* stack index */ +static int sco_stacksize = 1024; /* default stack size */ + +static int sl_page; /* current scenario page no */ +static int sl_index; /* cureent scenario address in page */ + +static int labelCallCnt = 0; +static int pageCallCnt = 0; +static int labelCallCnt_afterPageCall = 0; +static int dataPushCnt = 0; + +/* driobject */ +static dridata *dfile; + +/* debug: show stack information */ +static void showStackInfo() { + DEBUG_MESSAGE("stack top = %p, cur = %p, size=%d\n", sco_stackbuf, sco_stackindex, sco_stacksize); +} + +/* debbug: show current scenario pointer information */ +static void showIndexInfo() { + DEBUG_MESSAGE("page = %d, index = %x\n", sl_page, sl_index); +} + +#ifdef DEBUG +static void showStackData() { + int i, j; + int *var; + FILE *fp = fopen("STACKS.TXT","a"); + if (fp == NULL) return; + + fprintf(fp, "Page = %d, index = %x\n", sl_getPage(), sl_getIndex()); + fprintf(fp, "stack top = %p, cur = %p, size=%d, index=%d\n", sco_stackbuf, sco_stackindex, sco_stacksize, (sco_stackindex - sco_stackbuf)); + + var = sco_stackbuf; + for (i = 0; i < sco_stacksize; i+=10) { + for (j = 0; j < 10; j++) { + fprintf(fp, "%d,", *var); var++; + } + fprintf(fp, "\n"); + } + fprintf(fp, "\n"); + + fclose(fp); +} +#endif + +/* initilize stack and load first scenario data */ +boolean sl_init() { + sco_stackbuf = calloc(sco_stacksize, sizeof(int)); + if (sco_stackbuf == NULL) + NOMEMERR(); + + sco_stackindex = sco_stackbuf; + sl_jmpFar(0); + + labelCallCnt = 0; + pageCallCnt = 0; + labelCallCnt_afterPageCall = 0; + return TRUE; +} + +/* UD 0 command, reinitilized scenario loader */ +boolean sl_reinit() { + free(sco_stackbuf); + return sl_init(); +} + +static void sl_push(int type, int *val, int cnt) { + int i; + + if (sco_stackindex + cnt >= sco_stackbuf + sco_stacksize) { + i = sco_stackindex - sco_stackbuf; + sco_stacksize <<= 1; + sco_stackbuf = realloc(sco_stackbuf, sco_stacksize * sizeof(int)); + if (sco_stackbuf == NULL) + NOMEMERR(); + sco_stackindex = sco_stackbuf + i; + } + val += (cnt - 1); + for (i = 0 ; i < cnt; i++) { + *sco_stackindex++ = *val--; + } + *sco_stackindex++ = cnt; + *sco_stackindex++ = type; + // showStackInfo(); + // showStackData(); +} + +static int* sl_pop() { + int i, type, cnt; + int *tmp, *_tmp; + + type = *--sco_stackindex; + cnt = *--sco_stackindex; + + tmp = _tmp = malloc(sizeof(int) * (cnt + 2)); + if (_tmp == NULL) + NOMEMERR(); + + *tmp++ = type; + *tmp++ = cnt; + for (i = 0; i < cnt; i++) { + *tmp++ = *--sco_stackindex; + } + if (sco_stackindex < sco_stackbuf) { + SYSERROR("Stack buffer is illegal\n"); + } + + // showStackInfo(); + // showStackData(); + return _tmp; +} + +int sl_getc() { + return sl_sco[sl_index++]; +} + +int sl_getw() { + int c0,c1; + + c0 = sl_getc(); + c1 = sl_getc(); + return c0 + (c1 << 8); +} + +int sl_getcAt(int adr) { + return sl_sco[adr]; +} + +int sl_getwAt(int adr) { + int c0,c1; + + c0 = sl_sco[adr]; + c1 = sl_sco[adr + 1]; + return c0 + (c1 << 8); +} + +int sl_getdAt(int adr) { + int c0, c1; + + c0 = sl_getwAt(adr); + c1 = sl_getwAt(adr + 2); + return c0 + (c1 << 16); +} + +int sl_getadr() { + int c0,c1; + c0 = sl_getw(); + c1 = sl_getw(); + return c0 + (c1 << 16); +} + +/* @address */ +void sl_jmpNear(int address) { + sl_index = address; +// showIndexInfo(); +} + +/* + #page + page = 0~ +*/ +boolean sl_jmpFar(int page) { + if (dfile) { + ald_freedata(dfile); + } + + dfile = ald_getdata(DRIFILE_SCO, page); + if (dfile == NULL) { + return FALSE; + } + + sl_sco = dfile->data; + sl_page = page; + sl_index = LittleEndian_getDW(sl_sco, 4); +// showIndexInfo(); + return TRUE; +} + +/* + ~page,address + page = 1~ +*/ +boolean sl_jmpFar2(int page, int address) { + if (dfile) { + ald_freedata(dfile); + } + + dfile = ald_getdata(DRIFILE_SCO, page); + if (dfile == NULL) { + DEBUG_MESSAGE("ald_getdata fail\n"); + return FALSE; + } + sl_sco = dfile->data; + sl_page = page; + sl_index = address; + return TRUE; +} + +void sl_callNear(int address) { + int val[1]; + val[0] = sl_index; + sl_push(STACK_NEARJMP, val, 1); + sl_jmpNear(address); + + labelCallCnt++; + labelCallCnt_afterPageCall++; +} + +void sl_retNear() { + int *tmp = sl_pop(); + int index; + + while (*tmp != STACK_NEARJMP) { + if (*tmp == STACK_FARJMP) { + SYSERROR("Stack buffer is illegal\n"); + } else if (*tmp == STACK_VARIABLE) { + popVars(tmp); + } else { + SYSERROR("Stack buffer is illegal\n"); + } + free(tmp); + tmp = sl_pop(); + } + index = *(tmp + 2); + free(tmp); + sl_jmpNear(index); + + labelCallCnt--; + labelCallCnt_afterPageCall--; +} + +void sl_callFar(int page) { + int val[2]; + boolean bool; + + val[0] = sl_page; + val[1] = sl_index; + sl_push(STACK_FARJMP, val, 2); + bool = sl_jmpFar(page); + pageCallCnt++; + labelCallCnt_afterPageCall = 0; + if (!bool) { + sl_retFar(); + } +} + +void sl_callFar2(int page, int address) { + int val[2]; + boolean bool; + + val[0] = sl_page; + val[1] = sl_index; + sl_push(STACK_FARJMP, val, 2); + bool = sl_jmpFar2(page, address); + labelCallCnt_afterPageCall = 0; + pageCallCnt++; + if (!bool) { + sl_retFar(); + } +} + +void sl_retFar() { + int *tmp = sl_pop(); + int page, index; + + while (*tmp != STACK_FARJMP) { + if (*tmp == STACK_NEARJMP) { + WARNING("Stack buffer is illegal\n"); + } else if (*tmp == STACK_DATA) { + popDatas(tmp); + } else if (*tmp == STACK_VARIABLE) { + popVars(tmp); + } else { + SYSERROR("Stack buffer is illegal\n"); + } + free(tmp); + tmp = sl_pop(); + } + page = *(tmp + 2); + index = *(tmp + 3); + free(tmp); + sl_jmpFar2(page, index); + + labelCallCnt_afterPageCall = 0; + pageCallCnt--; +} + +/* UD 1 */ +void sl_retFar2() { + int *tmp = sl_pop(); + int page, index; + + while (*tmp != STACK_FARJMP) { + if (*tmp == STACK_NEARJMP) { + labelCallCnt--; + } else if (*tmp == STACK_DATA) { + popDatas(tmp); + } else if (*tmp == STACK_VARIABLE) { + popVars(tmp); + } else { + SYSERROR("Stack buffer is illegal\n"); + } + free(tmp); + tmp = sl_pop(); + } + page = *(tmp + 2); + index = *(tmp + 3); + free(tmp); + sl_jmpFar2(page, index); + + pageCallCnt--; + labelCallCnt_afterPageCall = 0; +} + +/* UC0 */ +void sl_stackClear_allCall() { + free(sco_stackbuf); + sco_stackbuf = calloc(sco_stacksize, sizeof(int)); + if (sco_stackbuf == NULL) + NOMEMERR(); + + sco_stackindex = sco_stackbuf; +} + +/* UC 2 */ +void sl_stackClear_pageCall(int cnt) { + int *tmp; + + while(cnt--) { + tmp = sl_pop(); + if (*tmp == STACK_NEARJMP) { + labelCallCnt--; + } else if (*tmp == STACK_FARJMP) { + pageCallCnt--; + } else if (*tmp == STACK_VARIABLE) { + popVars(tmp); + } else { + SYSERROR("Stack buffer is illegal\n"); + } + free(tmp); + } + labelCallCnt_afterPageCall = 0; +} + +/* UC 1 */ +void sl_stackClear_labelCall(int cnt) { + int *tmp; + + if (labelCallCnt_afterPageCall == 0) return; + + tmp = sl_pop(); + while(cnt--) { + if (*tmp == STACK_NEARJMP) { + labelCallCnt--; + labelCallCnt_afterPageCall--; + } else if (*tmp == STACK_VARIABLE) { + popVars(tmp); + } else { + SYSERROR("Stack buffer is illegal\n"); + } + free(tmp); + if (labelCallCnt_afterPageCall == 0) break; + + tmp = sl_pop(); + } +} + +/* US */ +void sl_pushVar(int *topVar, int cnt) { + int *tmp = malloc(sizeof(int) * (cnt + 2)); + + if (tmp == NULL) { + NOMEMERR(); + } + + *tmp = preVarPage; + *(tmp+1) = preVarIndex; + memcpy(tmp + 2, topVar, sizeof(int) * cnt); + sl_push(STACK_VARIABLE, tmp, cnt + 2); + free(tmp); +} + +/* UG */ +void sl_popVar(int *topvar, int cnt) { + int *tmp = sl_pop(); + + if (*tmp != STACK_VARIABLE) { + SYSERROR("Stack buffer is illegal\n"); + } + if (*(tmp + 2) != preVarPage){ + WARNING("Variable is not match with stacked variable\n"); + } + if (*(tmp + 3) != preVarIndex) { + WARNING("Variable is not match with stacked variable\n"); + } + if (*(tmp + 1) != cnt + 2) { + WARNING("Variable count is not match with stacked variable\n"); + } + memcpy(topvar, tmp + 4, sizeof(int) * cnt); + free(tmp); +} + +static void popVars(int *tmp) { + int cnt, page, index; + int *topVar; + + cnt = *(tmp + 1) - 2; + page = *(tmp + 2); + index = *(tmp + 3); + + if (page == 0) { + topVar = sysVar + index; + } else { + if ((arrayVarBuffer + page - 1) -> value == NULL) { + WARNING("Illegal Variable pop\n"); + return; + } + topVar = ((arrayVarBuffer + page - 1) -> value) + index; + } + + memcpy(topVar, tmp + 4, sizeof(int) * cnt); +} + +int sl_getIndex() { + return sl_index; +} + +int sl_getPage() { + return sl_page; +} + +int *sl_getStackInfo(int *size) { + *size = sco_stackindex - sco_stackbuf; +// printf("get stack size = %d\n", *size); + return sco_stackbuf; +} + +void sl_putStackInfo(int *data, int size) { + if (size > sco_stacksize) { + sco_stacksize = size << 1; + sco_stackbuf = calloc(sco_stacksize, sizeof(int)); + } + if (sco_stackbuf == NULL) + NOMEMERR(); + memcpy(sco_stackbuf, data, size * sizeof(int)); + sco_stackindex = sco_stackbuf + size; +} + + +/* TPx */ +void sl_pushData(int *data, int cnt) { + dataPushCnt++; + sl_push(STACK_DATA, data, cnt); +} + +/* TOx */ +void sl_popData(int *data, int cnt) { + int *tmp; + if (dataPushCnt == 0) return; + + tmp = sl_pop(); + dataPushCnt--; + + if (*tmp != STACK_DATA) + SYSERROR("Stack buffer is illegal\n"); + if (*(tmp + 1) != cnt) + WARNING("Variable count is not match with stacked variable\n"); + + memcpy(data, tmp + 2, sizeof(int) * cnt); + free(tmp); +} + +static void popDatas(int *tmp) { + int d1 = *(tmp + 2); + int d2 = *(tmp + 3); + int d3 = *(tmp + 4); + + if (*(tmp + 1) != 3) + WARNING("Variable count is not match with stacked variable\n"); + + switch(d1) { + case TxxTEXTCOLOR: + if (d2 == 0) { + nact->msg.MsgFontColor = d3; + } else { + nact->sel.MsgFontColor = d3; + } + break; + case TxxTEXTSIZE: + if (d2 == 0) { + nact->msg.MsgFontSize = d3; + } else { + nact->sel.MsgFontSize = d3; + } + break; + case TxxTEXTLOC: + msg_setMessageLocation(d2, d3); + break; + } + dataPushCnt--; +} + +static dridata *datatbl; + +void *sl_setDataTable(int page, int index) { + if (datatbl) { + ald_freedata(datatbl); + } + datatbl = ald_getdata(DRIFILE_SCO, page); + return (void *)(datatbl->data + index); +} + +void sl_returnGoto(int address) { + int *tmp = sl_pop(); + int page; + + while (TRUE) { + if (*tmp != STACK_FARJMP || *tmp != STACK_NEARJMP) break; + if (*tmp == STACK_DATA) { + popDatas(tmp); + } else if (*tmp == STACK_VARIABLE) { + popVars(tmp); + } else { + fprintf(stderr, "%d \n", *tmp); + SYSERROR("Stack buffer is illegal\n"); + } + free(tmp); + tmp = sl_pop(); + } + + if (*tmp == STACK_FARJMP) { + page = *(tmp + 2); + // index = *(tmp + 3); + free(tmp); + sl_jmpFar2(page, address); + labelCallCnt_afterPageCall = 0; + pageCallCnt--; + } else { + // index = *(tmp + 2); + free(tmp); + sl_jmpNear(address); + + labelCallCnt--; + labelCallCnt_afterPageCall--; + } +} diff --git a/src/scenario.h b/src/scenario.h new file mode 100644 index 0000000..bc5ba93 --- /dev/null +++ b/src/scenario.h @@ -0,0 +1,65 @@ +/* + * scenario.h シナリオ管理実行 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: scenario.h,v 1.14 2003/04/22 16:34:28 chikama Exp $ */ + +#ifndef __SCENARIO__ +#define __SCENARIO__ + +#include "portab.h" + +extern boolean sl_init(); +extern boolean sl_reinit(); +extern int sl_getc(); +extern int sl_getw(); +#define sl_getdw sl_getadr +extern int sl_getdAt(int address); +extern int sl_getwAt(int address); +extern int sl_getcAt(int address); +extern int sl_getadr(); +extern void sl_jmpNear(int address); +extern boolean sl_jmpFar(int page); +extern boolean sl_jmpFar2(int page, int address); +extern void sl_callNear(int address); +extern void sl_retNear(); +extern void sl_callFar(int page); +extern void sl_callFar2(int page, int address); +extern void sl_retFar(); +extern void sl_retFar2(); +extern void sl_stackClear_allCall(); +extern void sl_stackClear_labelCall(int cnt); +extern void sl_stackClear_pageCall(int cnt); +extern void sl_pushVar(int *topvar, int cnt); +extern void sl_popVar(int *topvar, int cnt); +extern int sl_getIndex(); +extern int sl_getPage(); +extern int *sl_getStackInfo(int *size); +extern void sl_putStackInfo(int *data, int size); +extern void sl_pushData(int *data, int cnt); +extern void sl_popData(int *data, int cnt); +extern void *sl_setDataTable(int page, int index); +extern void sl_returnGoto(int address); + +#define TxxTEXTCOLOR 1 +#define TxxTEXTSIZE 2 +#define TxxTEXTLOC 3 + +#endif /* !__SCENARIO_ */ diff --git a/src/sdl_core.h b/src/sdl_core.h new file mode 100644 index 0000000..717eec2 --- /dev/null +++ b/src/sdl_core.h @@ -0,0 +1,170 @@ +/* + * sdl_core.h SDL acess wrapper + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_core.h,v 1.18 2003/01/04 17:01:02 chikama Exp $ */ + +#ifndef __SDL_CORE__ +#define __SDL_CORE__ + +#include "config.h" +#include +#include +#include "portab.h" +#include "ags.h" +#include "cursor.h" + +/* 初期化関係 */ +extern int sdl_Initilize(void); +extern void sdl_Remove(void); + +/* ウィンド関係 */ +extern void sdl_setWorldSize(int width, int height, int depth); +extern void sdl_setWindowSize(int x, int y, int w, int h); +extern void sdl_setWindowTitle(char *name); +extern void sdl_getWindowInfo(DispInfo *info); +extern void sdl_FullScreen(boolean on); +extern agsurface_t *sdl_getDIB(void); + +/* 画面更新 */ +extern void sdl_updateArea(MyRectangle *src, MyPoint *dst); +extern void sdl_fullScreen(boolean on); + +/* パレット関係 */ +extern void sdl_setPallet(Pallet256 *pal, int src, int cnt); + +/* 描画関係 */ +extern void sdl_drawRectangle(int x, int y, int w, int h, int cl); +extern void sdl_fillRectangle(int x, int y, int w, int h, u_long c); +extern void sdl_drawLine(int x1, int y1, int x2, int y2, u_long col); +extern int sdl_drawString(int x, int y, char *msg, u_long col); +extern void sdl_copyArea(int sx,int sy, int w, int h, int dx, int dy); +extern void sdl_drawTT(int x,int y,int w,int h,const char *bitmap,int ww, boolean antialiased); +extern void sdl_copyAreaSP(int sx, int sy, int w, int h, int dx, int dy, int sp); +extern void sdl_drawImage8_fromData(cgdata *cg, int x, int y, int w, int h); +extern void sdl_Mosaic(int sx, int sy, int w, int h, int dx, int dy, int slice); +extern void sdl_wrapColor(int sx, int sy, int w, int h, int cl, int rate); +extern void sdl_scaledCopyArea(SDL_Surface *src, SDL_Surface *dst, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int mirror); +extern void sdl_zoom(int x, int y, int w, int h); +extern void sdl_drawImage16_fromData(cgdata *cg, int x, int y, int w, int h); +extern void sdl_copyAreaSP16_shadow(int sx, int sy, int w, int h, int dx, int dy, int lv); +extern void sdl_copyAreaSP16_alphaBlend(int sx, int sy, int w, int h, int dx, int dy, int lv); +extern void sdl_copyAreaSP16_alphaLevel(int sx, int sy, int w, int h, int dx, int dy, int lv); +extern void sdl_copyAreaSP16_whiteLevel(int sx, int sy, int w, int h, int dx, int dy, int lv); +extern void sdl_copy_from_alpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag); +extern void sdl_copy_to_alpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag); +extern void sdl_getPixel(int x, int y, Pallet *cell); +extern void sdl_putRegion(SDL_Surface *src, int x, int y); +extern void sdl_CopyRegion(SDL_Surface *src, int sx, int sy, int w, int h, int dx, int dy); +extern void sdl_restoreRegion(SDL_Surface *src, int x, int y); +extern SDL_Surface* sdl_saveRegion(int x, int y, int w, int h); +extern void sdl_maskupdate(int sx, int sy, int w, int h, int dx, int dy, int func, int step); + +/* フォント関連 */ +extern void sdl_setFontDevice(FONT *f); + +/* fader */ +extern void sdl_fadeIn(int step); +extern void sdl_fadeOut(int step); +extern void sdl_whiteIn(int step); +extern void sdl_whiteOut(int step); + +/* key/pointer 関係 */ +extern int sdl_keywait(int msec, boolean cancel); +extern void sdl_keywait_post(void); +extern void sdl_setCursorLocation(int x, int y); +extern void sdl_setCursorType(int type); +extern boolean sdl_cursorNew(BYTE* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry); +extern int sdl_getKeyInfo(); +extern int sdl_getMouseInfo(MyPoint *p); +extern int sdl_getjoyinfo(void); + +/* misc */ +extern void sdl_mainIteration(); +extern boolean RawKeyInfo[]; + +/* 初期化関係 */ +#define GraphicsInitilize() sdl_Initilize() +#define GraphicsRemove() sdl_Remove() + +/* ウィンド関係 */ +#define GetWindowInfo(info) sdl_getWindowInfo(info) +#define SetWindowSize(x,y,w,h) sdl_setWindowSize((x),(y),(w),(h)) +#define SetWindowTitle(size) sdl_setWindowTitle((size)) +#define SetWorldSize(w,h,d) sdl_setWorldSize((w),(h),(d)) +#define GetDIB() sdl_getDIB() + +/* 画面更新 */ +#define DspDeviceSync() sdl_sync() +#define UpdateArea(src,dst) sdl_updateArea((src),(dst)) +#define FullScreen(on) sdl_FullScreen(on) + +/* パレット関係 */ +#define SetPallet(pal,src,cnt) sdl_setPallet((pal),(src),(cnt)) + +/* 描画関係 */ +#define DrawString(x,y,str,col) sdl_drawString((x),(y),(str),(col)) +#define FillRectangle(x,y,w,h,col) sdl_fillRectangle((x),(y),(w),(h),(col)) +#define CopyArea(sx,sy,w,h,dx,dy) sdl_copyArea((sx),(sy),(w),(h),(dx),(dy)) +#define CopyAreaSP(sx,sy,w,h,dx,dy,col) sdl_copyAreaSP((sx),(sy),(w),(h),(dx),(dy),(col)) +#define DrawLine(x0,y0,x1,y1,col) sdl_drawLine((x0),(y0),(x1),(y1),(col)) +#define ScaledCopyArea(sx, sy, sw, sh, dx, dy, dw, dh, mirror_sw) sdl_scaledCopyArea(NULL, NULL, sx, sy, sw, sh, dx, dy, dw, dh, mirror_sw) +#define Zoom(x,y,w,h) sdl_zoom(x,y,w,h) +#define WrapColor(x,y,w,h,col,rate) sdl_wrapColor((x),(y),(w),(h),(col),(rate)) +#define GetPixel(x, y, cell) sdl_getPixel(x, y, cell) +#define DrawImage8_fromData(info,x,y,w,h) sdl_drawImage8_fromData(info,x,y,w,h) +#define DrawImage16_fromData(info,x,y,w,h) sdl_drawImage16_fromData(info,x,y,w,h) +#define CopyAreaSP16_shadow(sx,sy,w,h,dx,dy) sdl_copyAreaSP16_shadow(sx,sy,w,h,dx,dy,255) +#define CopyAreaSP16_shadow_withRate(sx,sy,w,h,dx,dy,lv) sdl_copyAreaSP16_shadow(sx,sy,w,h,dx,dy,lv) +#define CopyAreaSP16_alphaLevel(sx, sy, w, h, dx, dy, lv) sdl_copyAreaSP16_alphaLevel(sx, sy, w, h, dx, dy, lv) +#define CopyAreaSP16_alphaBlend(sx, sy, w, h, dx, dy, lv) sdl_copyAreaSP16_alphaBlend(sx, sy, w, h, dx, dy, lv) +#define CopyAreaSP16_whiteLevel(sx, sy, w, h, dx, dy, lv) sdl_copyAreaSP16_whiteLevel(sx, sy, w, h, dx, dy, lv) +#define Copy_from_alpha(sx, sy, w, h, dx, dy, flg) sdl_copy_from_alpha(sx, sy, w, h, dx, dy, flg) +#define Copy_to_alpha(sx, sy, w, h, dx, dy, flg) sdl_copy_to_alpha(sx, sy, w, h, dx, dy, flg) +#define DrawRectangle(x,y,w,h,col) sdl_drawRectangle((x),(y),(w),(h),(col)) +#define Mosaic(sx,sy,w,h,dx,dy,sl) sdl_Mosaic((sx),(sy),(w),(h),(dx),(dy),(sl)) +#define RestoreRegion(img,x,y) sdl_restoreRegion((img),(x),(y)); +#define SaveRegion(x,y,w,h) sdl_saveRegion(x,y,w,h) +#define DelRegion(i) SDL_FreeSurface(i) +#define PutRegion(i,x,y) sdl_putRegion(i,x,y) +#define CopyRegion(i,sx,sy,w,h,dx,dy) sdl_CopyRegion(i,sx,sy,w,h,dx,dy) +#define Maskupdate(sx,sy,w,h,dx,dy,f,st) sdl_maskupdate(sx,sy,w,h,dx,dy,f,st) + +/* フォント関連 */ +#define SetFontDevice(f) sdl_setFontDevice(f) + +/* fader 関連 */ +#define FadeOut sdl_fadeOut +#define FadeIn sdl_fadeIn +#define WhiteIn sdl_whiteIn +#define WhiteOut sdl_whiteOut + +/* key/pointer 関係 */ +#define GetKeyInfo() sdl_getKeyInfo() +#define SetCursorType(t) sdl_setCursorType((t)) +#define GetMouseInfo(info) sdl_getMouseInfo(info) +#define Keywait(r,flg) sdl_keywait(r,flg) +#define SetCursorLocation(x,y) sdl_setCursorLocation((x),(y)) +#define CursorNew(d,no,i,dir) sdl_cursorNew((d),(no),(i),(dir)) + +/* misc */ +#define ResourceInit(c,v) sdl_ResourceInit((c),(v)) +#define SetNoShmMode() /* NO */ + +#endif /* !__SDL_CORE__ */ diff --git a/src/sdl_cursor.c b/src/sdl_cursor.c new file mode 100644 index 0000000..6963eaf --- /dev/null +++ b/src/sdl_cursor.c @@ -0,0 +1,160 @@ +/* + * sdl_cursor.c SDL cursor + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_cursor.c,v 1.4 2001/03/30 19:16:38 chikama Exp $ */ + +#include "config.h" + +#include +#include + +#include "portab.h" +#include "system.h" +#include "cursor.h" +#include "sdl_private.h" + +/* マウスカーソルフォントイメージ*/ +#include "bitmaps/cursor_arrow.xpm" +#include "bitmaps/cursor_busy.xpm" +#include "bitmaps/cursor_no.xpm" +#include "bitmaps/cursor_move.xpm" +#include "bitmaps/cursor_cross.xpm" +#include "bitmaps/cursor_size_h.xpm" +#include "bitmaps/cursor_size_l.xpm" +#include "bitmaps/cursor_size_r.xpm" +#include "bitmaps/cursor_size_v.xpm" +#include "bitmaps/cursor_uparrow.xpm" +#include "bitmaps/cursor_ibeam.xpm" + +static SDL_Cursor *cursor[256]; + +/* Stolen from the SDL mailing list */ +/* Creates a new mouse cursor from an XPM */ + +static SDL_Cursor *init_system_cursor(const char *image[]) { + int i, row, col; + Uint8 data[4*32]; + Uint8 mask[4*32]; + int hot_x, hot_y; + + i = -1; + for (row = 0; row < 32; row++) { + for (col = 0; col < 32; col++) { + if (col % 8) { + data[i] <<= 1; + mask[i] <<= 1; + } else { + i++; + data[i] = mask[i] = 0; + } + switch (image[4 + row][col]) { + case 'X': + data[i] |= 0x01; + mask[i] |= 0x01; + break; + case '.': + mask[i] |= 0x01; + break; + case ' ': + break; + } + } + } + sscanf(image[4 + row], "%d,%d", &hot_x, &hot_y); + return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); +} + +/* mouse cursur の初期化 */ +void sdl_cursor_init(void) { + cursor[IDC_ARROW] = init_system_cursor(cursor_arrow); + cursor[IDC_CROSS] = init_system_cursor(cursor_cross); + cursor[IDC_IBEAM] = init_system_cursor(cursor_ibeam); + cursor[IDC_NO] = init_system_cursor(cursor_no); + cursor[IDC_SIZE] = init_system_cursor(cursor_move); + cursor[IDC_SIZEALL] = init_system_cursor(cursor_move); + cursor[IDC_SIZENESW] = init_system_cursor(cursor_size_r); + cursor[IDC_SIZENS] = init_system_cursor(cursor_size_v); + cursor[IDC_SIZENWSE] = init_system_cursor(cursor_size_l); + cursor[IDC_SIZEWE] = init_system_cursor(cursor_size_h); + cursor[IDC_UPARROW] = init_system_cursor(cursor_uparrow); + cursor[IDC_WAIT] = init_system_cursor(cursor_busy); +} + +boolean sdl_cursorNew(BYTE* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry) { + int xormasklen, andmasklen, xornum; + int i, j; + int h = 0; + + BYTE *buf1, *buf2, *buf3, *buf4; + + xornum = (cursordirentry->bWidth * cursordirentry->bHeight); + xormasklen = (xornum * cursorImage->icHeader.biBitCount) / 8; + NOTICE("Cursor: xormasklen==%d, xornum==%d\n", xormasklen, xornum); + + andmasklen = xornum / 8; + cursorImage->xormasklen = xormasklen; + cursorImage->andmasklen = andmasklen; + + buf1 = g_new(BYTE, xornum); + buf2 = g_new(BYTE, xornum); + buf3 = g_new(BYTE, xornum); + buf4 = g_new(BYTE, xornum); + + memcpy(buf1, data, MIN(xormasklen, xornum)); + data += xormasklen; + + memcpy(buf2, data, MIN(andmasklen, xornum)); + data += andmasklen; + +#define height cursordirentry->bHeight +#define width cursordirentry->bWidth + + for (j = 0; j < height; j++) { + for (i = 0; i < width * cursorImage->icHeader.biBitCount /8; i++) { + buf3[h] = buf1[(height-j-1)*height*cursorImage->icHeader.biBitCount/8+i]; + buf4[h] = 0xff ^ buf2[(height-j-1)*height*cursorImage->icHeader.biBitCount/8+i]; + h++; + } + } + + cursor[no] = SDL_CreateCursor(buf3, buf4, 32, 32, cursordirentry->wxHotspot, cursordirentry->wyHotspot); + + g_free(buf1); + g_free(buf2); + g_free(buf3); + g_free(buf4); + +#undef height +#undef width + + return TRUE; +} + +/* マウスの位置の移動 */ +void sdl_setCursorLocation(int x, int y) { + if (ms_active) SDL_WarpMouse(x, y); +} + +/* マウスカーソルの形状の設定 */ +void sdl_setCursorType(int type) { + if (cursor[type] != NULL) { + SDL_SetCursor(cursor[type]); + } +} diff --git a/src/sdl_draw.c b/src/sdl_draw.c new file mode 100644 index 0000000..059a27c --- /dev/null +++ b/src/sdl_draw.c @@ -0,0 +1,547 @@ +/* + * sdl_darw.c SDL draw to surface + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_draw.c,v 1.13 2003/01/25 01:34:50 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "sdl_core.h" +#include "sdl_private.h" +#include "font.h" +#include "ags.h" +#include "image.h" +#include "nact.h" + +static int fadestep[256] = +{0,1,3,4,6,7,9,10,12,14,15,17,18,20,21,23,25,26,28,29,31,32,34,36,37,39,40, + 42,43,45,46,48,49,51,53,54,56,57,59,60,62,63,65,66,68,69,71,72,74,75,77,78, + 80,81,83,84,86,87,89,90,92,93,95,96,97,99,100,102,103,105,106,108,109,110, + 112,113,115,116,117,119,120,122,123,124,126,127,128,130,131,132,134,135,136, + 138,139,140,142,143,144,146,147,148,149,151,152,153,155,156,157,158,159,161, + 162,163,164,166,167,168,169,170,171,173,174,175,176,177,178,179,181,182,183, + 184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202, + 203,204,205,206,207,208,209,210,211,211,212,213,214,215,216,217,217,218,219, + 220,221,221,222,223,224,225,225,226,227,227,228,229,230,230,231,232,232,233, + 234,234,235,235,236,237,237,238,238,239,239,240,241,241,242,242,243,243,244, + 244,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,251,251, + 251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255}; + +static SDL_Surface *s_fader; /* fade in /out 用 work surface */ + +static void sdl_pal_check(void) { + if (nact->sys_pal_changed) { + nact->sys_pal_changed = FALSE; + sdl_setPallet(nact->sys_pal, 0, 256); + } +} + +/* off-screen の指定領域を Main Window へ転送 */ +void sdl_updateArea(MyRectangle *src, MyPoint *dst) { + SDL_Rect rect_s, rect_d; + + setRect(rect_s, src->x, src->y, src->width, src->height); + setRect(rect_d, winoffset_x + dst->x, winoffset_y + dst->y, src->width, src->height); + + SDL_BlitSurface(sdl_dib, &rect_s, sdl_display, &rect_d); + + SDL_UpdateRect(sdl_display, winoffset_x + dst->x, winoffset_y + dst->y, + src->width, src->height); +} + +/* 全画面更新 */ +static void sdl_updateAll() { + SDL_Rect rect; + + setRect(rect, winoffset_x, winoffset_y, view_w, view_h); + + SDL_BlitSurface(sdl_dib, &sdl_view, sdl_display, &rect); + + SDL_UpdateRect(sdl_display, 0, 0, 0, 0); + +} + +/* Color の複数個指定 */ +void sdl_setPallet(Pallet256 *pal, int src, int cnt) { + int i; + + for (i = 0; i < cnt; i++) { + sdl_col[src + i].r = pal->red [src + i]; + sdl_col[src + i].g = pal->green[src + i]; + sdl_col[src + i].b = pal->blue [src + i]; + } + + if (sdl_dib->format->BitsPerPixel == 8) { + SDL_SetColors(sdl_dib, sdl_col, src, cnt); + } +} + +/* 矩形の描画 */ +void sdl_drawRectangle(int x, int y, int w, int h, int c) { + SDL_Rect rect; + + sdl_pal_check(); + + if (c < 256 && sdl_dib->format->BitsPerPixel > 8) + c = SDL_MapRGB(sdl_dib->format, sdl_col[c].r, sdl_col[c].g, sdl_col[c].b); + + setRect(rect,x,y,w,1); + SDL_FillRect(sdl_dib, &rect, c); + + setRect(rect,x,y,1,h); + SDL_FillRect(sdl_dib, &rect, c); + + setRect(rect,x,y+h-1,w,1); + SDL_FillRect(sdl_dib, &rect, c); + + setRect(rect,x+w-1,y,1,h); + SDL_FillRect(sdl_dib, &rect, c); +} + +/* 矩形塗りつぶし */ +void sdl_fillRectangle(int x, int y, int w, int h, u_long c) { + SDL_Rect rect; + + sdl_pal_check(); + + setRect(rect,x,y,w,h); + + if (c < 256 && sdl_dib->format->BitsPerPixel > 8) + c = SDL_MapRGB(sdl_dib->format, sdl_col[c].r, sdl_col[c].g, sdl_col[c].b); + + SDL_FillRect(sdl_dib, &rect, c); +} + +/* 領域コピー */ +void sdl_copyArea(int sx,int sy, int w, int h, int dx, int dy) { + SDL_Rect r_src, r_dst; + + setRect(r_src, sx, sy, w, h); + setRect(r_dst, dx, dy, w, h); + + SDL_BlitSurface(sdl_dib, &r_src, sdl_dib, &r_dst); +} + +/* + * dib に指定のパレット sp を抜いてコピー + */ +void sdl_copyAreaSP(int sx, int sy, int w, int h, int dx, int dy, int sp) { + SDL_Rect r_src, r_dst; + + sdl_pal_check(); + + if (sdl_dib->format->BitsPerPixel > 8 && sp < 256) { + sp = SDL_MapRGB(sdl_dib->format, + sdl_col[sp].r & 0xf8, + sdl_col[sp].g & 0xfc, + sdl_col[sp].b & 0xf8); + } + + SDL_SetColorKey(sdl_dib, SDL_SRCCOLORKEY, sp); + + setRect(r_src, sx, sy, w, h); + setRect(r_dst, dx, dy, w, h); + + SDL_BlitSurface(sdl_dib, &r_src, sdl_dib, &r_dst); + SDL_SetColorKey(sdl_dib, 0, 0); +} + +void sdl_drawImage8_fromData(cgdata *cg, int dx, int dy, int w, int h) { + SDL_Surface *s; + SDL_Rect r_src, r_dst; + + s = SDL_AllocSurface(SDL_SWSURFACE, w, h, 8, 0, 0, 0, 0); + + SDL_LockSurface(s); + +#if 0 /* for broken cg */ + if (s->pitch == s->w) { + memcpy(s->pixels, cg->pic, w * h); + } else +#endif + { + int i = h; + BYTE *p_src = (cg->pic + cg->data_offset), *p_dst = s->pixels; + + while (i--) { + memcpy(p_dst, p_src, w); + p_dst += s->pitch; + p_src += cg->width; + } + } + + SDL_UnlockSurface(s); + + sdl_pal_check(); + + if (sdl_dib->format->BitsPerPixel > 8 && cg->pal) { + int i, i_st = 0, i_end = 256; + SDL_Color *c = s->format->palette->colors; + BYTE *r = cg->pal->red, *g = cg->pal->green, *b = cg->pal->blue; + + if (cg->type == ALCG_VSP) { + i_st = (cg->vsp_bank << 4); + i_end = i_st + 16; + c += i_st; + } + for (i = i_st; i < i_end; i++) { + c->r = *(r++); + c->g = *(g++); + c->b = *(b++); + c++; + } + } else { + memcpy(s->format->palette->colors, sdl_col, sizeof(SDL_Color) * 256); + } + + if (cg->spritecolor != -1) { + SDL_SetColorKey(s, SDL_SRCCOLORKEY, cg->spritecolor); + } + + setRect(r_src, 0, 0, w, h); + setRect(r_dst, dx, dy, w, h); + + SDL_BlitSurface(s, &r_src, sdl_dib, &r_dst); + SDL_FreeSurface(s); +} + +/* 直線描画 */ +void sdl_drawLine(int x1, int y1, int x2, int y2, u_long cl) { + + sdl_pal_check(); + + if (sdl_dib->format->BitsPerPixel > 8 && cl < 256) { + cl = SDL_MapRGB(sdl_dib->format, + sdl_col[cl].r, sdl_col[cl].g, sdl_col[cl].b); + } + + SDL_LockSurface(sdl_dib); + + image_drawLine(sdl_dibinfo, x1, y1, x2, y2, cl); + + SDL_UnlockSurface(sdl_dib); + +} + +static agsurface_t* surface2com(SDL_Surface *src) { + agsurface_t *dst = g_new(agsurface_t, 1); + + dst->depth = src->format->BitsPerPixel; + dst->bytes_per_pixel = src->format->BytesPerPixel; + dst->bytes_per_line = src->pitch; + dst->pixel = src->pixels; + dst->width = src->w; + dst->height = src->h; + + return dst; +} + +static SDL_Surface *com2surface(agsurface_t *src) { + SDL_Surface *s; + int y; + BYTE *sp, *dp; + + s = SDL_AllocSurface(SDL_SWSURFACE, src->width, src->height, src->depth, 0, 0, 0, 0); + + SDL_LockSurface(s); + + sp = s->pixels; + dp = src->pixel; + + for (y = 0; y < src->height; y++) { + memcpy(sp, dp, src->width); + sp += s->pitch; + dp += src->bytes_per_line; + } + + SDL_UnlockSurface(s); + return s; +} + +static SDL_Surface *com2alphasurface(agsurface_t *src, int cl) { + SDL_Surface *s; + int x,y; + BYTE *sp, *dp; + SDL_Rect r_src; + + s = SDL_AllocSurface(SDL_SWSURFACE, src->width, src->height, + sdl_dib->format->BitsPerPixel <= 24 ? sdl_dib->format->BitsPerPixel+8:32, + sdl_dib->format->Rmask,sdl_dib->format->Gmask, + sdl_dib->format->Bmask, + sdl_dib->format->BitsPerPixel<24?0xFF0000:0xFF000000); + + setRect(r_src, 0, 0, src->width, src->height); + SDL_FillRect(s, &r_src, + SDL_MapRGB(sdl_dib->format, sdl_col[cl].r, sdl_col[cl].g, sdl_col[cl].b)); + + SDL_LockSurface(s); + + for (y = 0; y < src->height; y++) { + sp = src->pixel + y * src->bytes_per_line; + dp = s->pixels + y * s->pitch; +#ifndef WORDS_BIGENDIAN + dp += s->format->BytesPerPixel -1; +#endif + + for (x = 0; x < src->width; x++) { + *dp = R_ALPHA(*sp); + sp++; + dp += s->format->BytesPerPixel; + } + } + + SDL_UnlockSurface(s); + return s; +} + + + +/* msg is EUC */ +int sdl_drawString(int x, int y, char *msg, u_long col) { + int w; + + sdl_pal_check(); + + if (sdl_font->self_drawable()) { + w = sdl_font->draw_glyph(x, y, msg, col); + } else { + agsurface_t *glyph = sdl_font->get_glyph(msg); + SDL_Rect r_src, r_dst; + + if (glyph == NULL) return 0; + setRect(r_src, 0, 0, glyph->width, glyph->height); + setRect(r_dst, x, y, glyph->width, glyph->height); + if (sdl_font->antialiase_on && sdl_dib->format->BitsPerPixel != 8) { + SDL_Surface *src = com2alphasurface(glyph, col); + + SDL_BlitSurface(src, &r_src, sdl_dib, &r_dst); + SDL_FreeSurface(src); + } else { + int i; + SDL_Surface *src = com2surface(glyph); + for (i = 1; i < 256; i++) { + memcpy(src->format->palette->colors + i, &sdl_col[col], + sizeof(SDL_Color)); + } + SDL_SetColorKey(src, SDL_SRCCOLORKEY, 0); + SDL_BlitSurface(src, &r_src, sdl_dib, &r_dst); + SDL_FreeSurface(src); + } + w = glyph->width; + } + + return w; +} + +void sdl_Mosaic(int sx, int sy, int w, int h, int dx, int dy, int slice) { + + SDL_LockSurface(sdl_dib); + + image_Mosaic(sdl_dibinfo, sx, sy, w, h, dx, dy, slice); + + SDL_UnlockSurface(sdl_dib); +} + +static void setBligtness(SDL_Surface *s, int val) { + int i; + Pallet256 *pal = nact->sys_pal; + Uint8 *r = pal->red, *g = pal->green, *b = pal->blue; + SDL_Color *cl = sdl_col; + + for (i = 0; i < 256; i++) { + cl->r = (val * (*(r++))) / 255; + cl->g = (val * (*(g++))) / 255; + cl->b = (val * (*(b++))) / 255; + cl++; + } + SDL_SetColors(s, sdl_col, 0, 256); +} + +static void setWhiteness(SDL_Surface *s, int val) { + int i; + Pallet256 *pal = nact->sys_pal; + Uint8 *r = pal->red, *g = pal->green, *b = pal->blue; + SDL_Color *cl = sdl_col; + + for (i = 0; i < 256; i++) { + cl->r = (((255- *r) * val) / 256) + *r; r++; + cl->g = (((255- *g) * val) / 256) + *g; g++; + cl->b = (((255- *b) * val) / 256) + *b; b++; + cl++; + } + SDL_SetColors(s, sdl_col, 0, 256); +} + +static void fader_in(int n) { + static agsurface_t *work, *disp; + + if (n == 0) { + SDL_Rect r_src, r_dst; + + s_fader = SDL_AllocSurface(sdl_dib->flags, sdl_display->w, sdl_display->h, + sdl_display->format->BitsPerPixel, 0, 0, 0, 0); + + if (sdl_display->format->BitsPerPixel == 8) { + memcpy(s_fader->format->palette->colors, + sdl_display->format->palette->colors, + sizeof(SDL_Color) * 256); + } + setRect(r_src, view_x, view_y, view_w, view_h); + setRect(r_dst, winoffset_x, winoffset_y, view_w, view_h); + SDL_BlitSurface(sdl_dib, &r_src, s_fader, &r_dst); + + work = surface2com(s_fader); + disp = surface2com(sdl_display); + } + + if (n == 255) { + SDL_FreeSurface(s_fader); + sdl_updateAll(); + g_free(work); + g_free(disp); + return; + } + + SDL_LockSurface(s_fader); + SDL_LockSurface(sdl_display); + + image_fadeIn(work, disp, n / 16); + + SDL_UnlockSurface(sdl_display); + SDL_UnlockSurface(s_fader); + SDL_UpdateRect(sdl_display,0,0,0,0); +} + +static void fader_out(int n,Uint32 c) { + static agsurface_t *disp; + + if (n == 0) { + disp = surface2com(sdl_display); + } + + if (n == 255) { + SDL_FillRect(sdl_display, NULL, c); + g_free(disp); + return; + } + + SDL_LockSurface(sdl_display); + + image_fadeOut(disp, (255 - n) / 16, c); + + SDL_UnlockSurface(sdl_display); + + SDL_UpdateRect(sdl_display,0,0,0,0); +} + +static __inline void sdl_fade_blit(void) { + SDL_Rect r_dst; + setRect(r_dst, winoffset_x, winoffset_y, view_w, view_h); + + SDL_BlitSurface(sdl_dib, &sdl_view, sdl_display, &r_dst); + SDL_UpdateRect(sdl_display, 0, 0, view_w, view_h); +} + +void sdl_fadeIn(int step) { + if (sdl_display->flags & SDL_HWPALETTE) { + setBligtness(sdl_display, fadestep[step]); + } else if (sdl_dib->format->BitsPerPixel == 8) { + setBligtness(sdl_dib, fadestep[step]); + sdl_fade_blit(); + } else { + fader_in(step); + } +} + +void sdl_fadeOut(int step) { + if (sdl_display->flags & SDL_HWPALETTE) { + setBligtness(sdl_display, fadestep[255 - step]); + } else if (sdl_dib->format->BitsPerPixel == 8) { + setBligtness(sdl_dib, fadestep[255 - step]); + sdl_fade_blit(); + } else { + fader_out(step, SDL_MapRGB(sdl_display->format, 0, 0, 0)); + } +} + +void sdl_whiteIn(int step) { + if (sdl_display->flags & SDL_HWPALETTE) { + setWhiteness(sdl_display, fadestep[step]); + } else if (sdl_dib->format->BitsPerPixel == 8) { + setWhiteness(sdl_dib, fadestep[255 - step]); /* ??? */ + sdl_fade_blit(); + } else { + fader_in(step); + } +} + +void sdl_whiteOut(int step) { + if (sdl_display->flags & SDL_HWPALETTE) { + setWhiteness(sdl_display, fadestep[255 - step]); + } else if (sdl_dib->format->BitsPerPixel == 8) { + setWhiteness(sdl_dib, fadestep[step]); /* ??? */ + sdl_fade_blit(); + } else { + fader_out(step, SDL_MapRGB(sdl_display->format, 255, 255, 255)); + } +} + +/* + * 指定範囲にパレット col を rate の割合で重ねる CK1 + */ +void sdl_wrapColor(int sx, int sy, int w, int h, int cl, int rate) { + SDL_Surface *s; + SDL_Rect r_src,r_dst; + + s = SDL_AllocSurface(SDL_SWSURFACE, w, h, + sdl_dib->format->BitsPerPixel, 0, 0, 0, 0); + + if (s->format->BitsPerPixel == 8) { + memcpy(s->format->palette->colors, sdl_dib->format->palette->colors, + sizeof(SDL_Color)*256); + } else { + cl = (cl < 256) ? SDL_MapRGB(sdl_dib->format, sdl_col[cl].r, sdl_col[cl].g, sdl_col[cl].b) : cl; + } + + setRect(r_src, 0, 0, w, h); + SDL_FillRect(s, &r_src, cl); + + SDL_SetAlpha(s, RLEFLAG(SDL_SRCALPHA), R_ALPHA(rate)); + setRect(r_dst, sx, sy, w, h); + SDL_BlitSurface(s, &r_src, sdl_dib, &r_dst); + SDL_FreeSurface(s); +} + +/* mask update まだ */ +void sdl_maskupdate(int sx, int sy, int w, int h, int dx, int dy, int func, int step) { + + if (step == 256) { + ags_copyArea(sx, sy, w, h, dx, dy); + ags_updateArea(dx, dy, w, h); + } +} diff --git a/src/sdl_event.c b/src/sdl_event.c new file mode 100644 index 0000000..58729b4 --- /dev/null +++ b/src/sdl_event.c @@ -0,0 +1,238 @@ +/* + * sdl_darw.c SDL event handler + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_event.c,v 1.5 2001/12/16 17:12:56 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "counter.h" +#include "nact.h" +#include "sdl_private.h" +#include "key.h" +#include "menu.h" +#include "imput.h" +#include "joystick.h" +#include "sdl_input.c" + +static void sdl_getEvent(void); +static void keyEventProsess(SDL_KeyboardEvent *e, boolean bool); +static int check_button(void); + + +/* pointer の状態 */ +static int mousex, mousey, mouseb; +boolean RawKeyInfo[256]; +/* SDL Joystick */ +static int joyinfo=0; + +static int mouse_to_rawkey(int button) { + switch(button) { + case SDL_BUTTON_LEFT: + return KEY_MOUSE_LEFT; + case SDL_BUTTON_MIDDLE: + return KEY_MOUSE_MIDDLE; + case SDL_BUTTON_RIGHT: + return KEY_MOUSE_RIGHT; + } + return 0; +} + +/* Event処理 */ +static void sdl_getEvent(void) { + SDL_Event e; + boolean m2b = FALSE, msg_skip = FALSE; + int i; + + while (SDL_PollEvent(&e)) { + switch (e.type) { + case SDL_ACTIVEEVENT: + if (e.active.state & SDL_APPMOUSEFOCUS) { + ms_active = e.active.gain; +#if 0 + if (sdl_fs_on) { + if (ms_active) { + SDL_WM_GrabInput(SDL_GRAB_ON); + } else { + SDL_WM_GrabInput(SDL_GRAB_OFF); + } + } +#endif + } + if (e.active.state & SDL_APPINPUTFOCUS) { + } + + break; + case SDL_KEYDOWN: + keyEventProsess(&e.key, TRUE); + break; + case SDL_KEYUP: + keyEventProsess(&e.key, FALSE); + if (e.key.keysym.sym == SDLK_F1) msg_skip = TRUE; + if (e.key.keysym.sym == SDLK_F4) { + SDL_WM_ToggleFullScreen(sdl_display); + sdl_fs_on = !sdl_fs_on; + } + break; + case SDL_MOUSEMOTION: + mousex = e.motion.x; + mousey = e.motion.y; + break; + case SDL_MOUSEBUTTONDOWN: + mouseb |= (1 << e.button.button); + RawKeyInfo[mouse_to_rawkey(e.button.button)] = TRUE; +#if 0 + if (e.button.button == 2) { + keywait_flag=TRUE; + } +#endif + break; + case SDL_MOUSEBUTTONUP: + mouseb &= (0xffffffff ^ (1 << e.button.button)); + RawKeyInfo[mouse_to_rawkey(e.button.button)] = FALSE; + if (e.button.button == 2) { + m2b = TRUE; + } + break; +#if HAVE_SDLJOY + case SDL_JOYAXISMOTION: + if (abs(e.jaxis.value) < 0x4000) { + joyinfo &= e.jaxis.axis == 0 ? ~0xc : ~3; + } else { + i = (e.jaxis.axis == 0 ? 2 : 0) + + (e.jaxis.value > 0 ? 1 : 0); + joyinfo |= 1 << i; + } + break; + case SDL_JOYBALLMOTION: + break; + case SDL_JOYHATMOTION: + break; + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + if (e.jbutton.button < 4) { + i = 1 << (e.jbutton.button+4); + if (e.jbutton.state == SDL_PRESSED) + joyinfo |= i; + else + joyinfo &= ~i; + } else { + if (e.jbutton.state == SDL_RELEASED) { + } + } + break; +#endif + default: + printf("ev %x\n", e.type); + break; + } + } + + if (m2b) { + menu_open(); + } + + if (msg_skip) set_skipMode(!get_skipMode()); +} + +int sdl_keywait(int msec, boolean cancel) { + int key=0, n; + int cnt = get_high_counter(SYSTEMCOUNTER_MSEC); + + if (msec < 0) return 0; + + while (msec > (get_high_counter(SYSTEMCOUNTER_MSEC) - cnt)) { + sdl_getEvent(); + key = check_button() | sdl_getKeyInfo() | joy_getinfo(); + if (cancel && key) break; + n = msec - (get_high_counter(SYSTEMCOUNTER_MSEC) - cnt); + if (n < 0) break; + if (n < 10) { + usleep(1000 * n); + } else { + usleep(10000); + } + nact->callback(); + } + + return key; +} + +/* キー情報の取得 */ +static void keyEventProsess(SDL_KeyboardEvent *e, boolean bool) { + RawKeyInfo[sdl_keytable[e->keysym.sym]] = bool; +} + +int sdl_getKeyInfo() { + int rt; + + sdl_getEvent(); + + rt = ((RawKeyInfo[KEY_UP] || RawKeyInfo[KEY_PAD_8]) | + ((RawKeyInfo[KEY_DOWN] || RawKeyInfo[KEY_PAD_2]) << 1) | + ((RawKeyInfo[KEY_LEFT] || RawKeyInfo[KEY_PAD_4]) << 2) | + ((RawKeyInfo[KEY_RIGHT] || RawKeyInfo[KEY_PAD_6]) << 3) | + (RawKeyInfo[KEY_RETURN] << 4) | + (RawKeyInfo[KEY_SPACE ] << 5) | + (RawKeyInfo[KEY_ESC] << 6) | + (RawKeyInfo[KEY_TAB] << 7)); + + return rt; +} + +static int check_button(void) { + int m1, m2; + + m1 = mouseb & (1 << 1) ? SYS35KEY_RET : 0; + m2 = mouseb & (1 << 3) ? SYS35KEY_SPC : 0; + + return m1 | m2; +} + +int sdl_getMouseInfo(MyPoint *p) { + sdl_getEvent(); + + if (!ms_active) { + if (p) { + p->x = 0; p->y = 0; + } + return 0; + } + + if (p) { + p->x = mousex - winoffset_x; + p->y = mousey - winoffset_y; + } + return check_button(); +} + +#ifdef HAVE_SDLJOY +int sdl_getjoyinfo(void) { + sdl_getEvent(); + return joyinfo; +} +#endif + diff --git a/src/sdl_image.c b/src/sdl_image.c new file mode 100644 index 0000000..d5be4ec --- /dev/null +++ b/src/sdl_image.c @@ -0,0 +1,446 @@ +/* + * sdl_image.c image操作 for SDL + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_image.c,v 1.23 2003/07/20 19:30:16 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "sdl_private.h" +#include "cg.h" +#include "nact.h" +#include "alpha_plane.h" +#include "image.h" + +static unsigned char shlv_tbl[256*256]; + +/* + * dib内での拡大・縮小コピー + */ +void sdl_scaledCopyArea(SDL_Surface *src, SDL_Surface *dst, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int mirror) { + float a1, a2, xd, yd; + int *row, *col; + int x, y; + SDL_Surface *ss; + SDL_Rect r_src, r_dst; + + if (src == NULL) { + src = sdl_dib; + } + + if (dst == NULL) { + dst = sdl_dib; + } + ss = SDL_AllocSurface(SDL_ANYFORMAT, dw, dh, dst->format->BitsPerPixel, 0, 0, 0, 0); + + SDL_LockSurface(ss); + + if (dst->format->BitsPerPixel == 8) { + memcpy(ss->format->palette->colors, dst->format->palette->colors, + sizeof(SDL_Color) * 256); + } + + a1 = (float)sw / (float)dw; + a2 = (float)sh / (float)dh; + // src width と dst width が同じときに問題があるので+1 + row = g_new0(int, dw+1); + // 1おおきくして初期化しないと col[dw-1]とcol[dw]が同じになる + // 可能性がある。 + col = g_new0(int, dh+1); + + if(mirror & 1){ + /*上下反転 added by tajiri@wizard*/ + for (yd = sh-a2, y = 0; ypixels + sx * src->format->BytesPerPixel + sy * src->pitch;\ + type *p_dd = ss->pixels, *p_src, *p_dst;\ + int l=src->pitch/src->format->BytesPerPixel; \ + int m=ss->pitch/ss->format->BytesPerPixel; \ + for (y = 0; y < dh; y++) { \ + p_src = p_ss + col[y] * l; \ + p_dst = p_dd + y * m; \ + for (x = 0; x < dw ; x++) { \ + *(p_dst++) = *(p_src + *(row + x)); \ + } \ + } \ +} + switch(dst->format->BytesPerPixel) { + case 1: + sccp(BYTE); + break; + case 2: + sccp(WORD); + break; + case 3: { + BYTE *p_ss=(BYTE *)(src->pixels+sx*src->format->BytesPerPixel+sy*src->pitch); + BYTE *p_src=p_ss,*p_dd=ss->pixels, *p_dst; + for (y = 0; y < dh; y++) { + p_src = p_ss + col[y] * src->pitch; + p_dst = p_dd + y * ss->pitch; + for (x = 0; x < dw ; x++) { + *(p_dst) = *(p_src + (*(row + x))*3 ); + *(p_dst+1) = *(p_src + (*(row + x))*3 + 1); + *(p_dst+2) = *(p_src + (*(row + x))*3 + 2); + p_dst+=3; + } + } + break; + } + case 4: + sccp(Uint32); + break; + } + + SDL_UnlockSurface(ss); + + setRect(r_src, 0, 0, dw, dh); + setRect(r_dst, dx, dy, dw, dh); + SDL_BlitSurface(ss, &r_src, dst, &r_dst); + + SDL_FreeSurface(ss); + + g_free(row); + g_free(col); +} + +void sdl_zoom(int x, int y, int w, int h) { + sdl_scaledCopyArea(sdl_dib, sdl_display, x, y, w, h, 0, 0, view_w, view_h, 0); + SDL_UpdateRect(sdl_display, 0, 0, view_w, view_h); +} + + +/* + * dibに16bitCGの描画 + */ +void sdl_drawImage16_fromData(cgdata *cg, int dx, int dy, int w, int h) { + /* draw alpha pixel */ + SDL_Surface *s; + SDL_Rect r_src,r_dst; + + if (cg->alpha != NULL && cg->spritecolor != -1) { + unsigned short *p_ds, *p_src = (WORD *)(cg->pic + cg->data_offset); + unsigned short *p_dst; + BYTE *a_src = cg->alpha; + BYTE *adata = GETOFFSET_ALPHA(sdl_dibinfo, dx, dy); + int x, y, l; + +#ifndef WORDS_BIGENDIAN + s = SDL_AllocSurface(SDL_ANYFORMAT, w, h, 32, + 0xf800, 0x07e0, 0x001f, 0xFF0000); +#else + s = SDL_AllocSurface(SDL_ANYFORMAT,w, h, 32, + 0xf800, 0x07e0, 0x001f, 0xFF000000); +#endif +#if 0 +#ifdef HAVE_SDLRLE + SDL_SetAlpha(s,RLEFLAG(SDL_SRCALPHA),0); +#endif +#endif + SDL_LockSurface(s); + p_ds = s->pixels; + l = s->pitch/2; + for (y = 0; y < h; y++) { + p_dst = p_ds; + memcpy(adata, a_src, w); + for (x = 0; x < w; x++) { +#ifndef WORDS_BIGENDIAN + *(p_dst++) = *(p_src++); + *(p_dst++) = R_ALPHA(*(a_src++)); +#else + *(p_dst++) = R_ALPHA(*(a_src++)); + *(p_dst++) = *(p_src++); +#endif + } + p_ds += l; + adata += sdl_dibinfo->width; + } + SDL_UnlockSurface(s); + } else { + BYTE *p_dst; + unsigned short *p_src = (WORD *)(cg->pic + cg->data_offset); + int i, l = w * 2; + + s = SDL_AllocSurface(SDL_ANYFORMAT, w, h, 16, 0, 0, 0, 0); + SDL_LockSurface(s); + p_dst = s->pixels; + for (i = 0; i < h; i++) { + memcpy(p_dst, p_src, l); + p_dst += s->pitch; + p_src += cg->width; + } + if (cg->alpha) { + BYTE *a_src = cg->alpha; + BYTE *adata = GETOFFSET_ALPHA(sdl_dibinfo, dx, dy); + + for (i = 0; i < h; i++) { + memcpy(adata, a_src, w); + adata += sdl_dibinfo->width; + a_src += cg->width; + } + } + SDL_UnlockSurface(s); + } + setRect(r_src, 0, 0, w, h); + setRect(r_dst, dx, dy, w, h); + SDL_BlitSurface(s, &r_src, sdl_dib, &r_dst); + SDL_FreeSurface(s); +} + +/* + * 16bit専用の dib の指定領域コピー alphaつき + */ +void sdl_shadow_init(void) { + int i, j; + unsigned char *c = shlv_tbl; + + for (i = 0; i < 255; i++) { + for (j = 0; j < 256; j++) { + *(c++) = (unsigned char)(R_ALPHA(i * j / 255)); + } + } +} + +void sdl_copyAreaSP16_shadow(int sx, int sy, int w, int h, int dx, int dy, int lv) { + BYTE *adata = GETOFFSET_ALPHA(sdl_dibinfo, sx, sy); + BYTE *p_src, *p_dst, *p_ds; + + SDL_Surface *s = SDL_AllocSurface(SDL_ANYFORMAT, w, h, 32, sdl_dib->format->Rmask, + sdl_dib->format->Gmask, sdl_dib->format->Bmask, + 0xFF000000); + SDL_Rect r_src, r_dst; + int x, y; + + setRect(r_dst, sx, sy, w, h); + setRect(r_src, 0, 0, w, h); + SDL_BlitSurface(sdl_dib, &r_dst, s, &r_src); + + SDL_LockSurface(s); + +#ifndef WORDS_BIGENDIAN + p_ds = s->pixels + 3; +#else + p_ds = s->pixels; +#endif + switch(lv) { + case 255: + for (y = 0; y < h; y++) { + p_src = adata; + p_dst = p_ds; + for (x = 0; x < w; x++) { + *p_dst = R_ALPHA(*(p_src++)); + p_dst += 4; + } + adata += sdl_dibinfo->width; + p_ds += s->pitch; + } + break; + default: + { + unsigned char *lvtbl = shlv_tbl + lv * 256; + for (y = 0; y < h; y++) { + p_src = adata; + p_dst = p_ds; + for (x = 0; x < w; x++) { + *p_dst = lvtbl[(int)(*(p_src++))]; + p_dst += 4; + } + adata += sdl_dibinfo->width; + p_ds += s->pitch; + } + } + break; + } + SDL_UnlockSurface(s); +#if 0 +#ifdef HAVE_SDLRLE + SDL_SetAlpha(s, RLEFLAG(SDL_SRCALPHA), 0); +#endif +#endif + + setRect(r_dst, dx, dy, w, h); + SDL_BlitSurface(s, &r_src, sdl_dib, &r_dst); + SDL_FreeSurface(s); +} + +void sdl_copyAreaSP16_alphaBlend(int sx, int sy, int w, int h, int dx, int dy, int lv) { + SDL_Rect r_src, r_dst; + + setRect(r_src, sx, sy, w, h); + setRect(r_dst, dx, dy, w, h); + SDL_SetAlpha(sdl_dib, RLEFLAG(SDL_SRCALPHA), R_ALPHA(lv)); + SDL_BlitSurface(sdl_dib, &r_src, sdl_dib, &r_dst); + SDL_SetAlpha(sdl_dib, 0, 0); +} + +#define copyAreaSP_level(fn, cn, v) void sdl_copyAreaSP16_##fn(int sx, int sy, int w, int h, int dx, int dy, int lv) { \ + SDL_Rect r_src,r_dst; \ + setRect(r_src, sx, sy, w, h); \ + setRect(r_dst, dx, dy, w, h); \ + SDL_SetAlpha(sdl_dib, RLEFLAG(SDL_SRCALPHA), v); \ + SDL_FillRect(sdl_dib, &r_dst, cn); \ + SDL_BlitSurface(sdl_dib, &r_src, sdl_dib, &r_dst); \ + SDL_SetAlpha(sdl_dib, 0, 0); \ +} + +#ifdef HAVE_SDLRALPHA +copyAreaSP_level(alphaLevel, 0, lv); +copyAreaSP_level(whiteLevel, sdl_white, 255 - lv); +#else +copyAreaSP_level(alphaLevel, 0, 255 - lv); +copyAreaSP_level(whiteLevel, sdl_white, lv); +#endif + +void sdl_copy_from_alpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag) { + SDL_LockSurface(sdl_dib); + image_copy_from_alpha(nact->ags.dib, sx, sy, w, h, dx, dy, flag); + SDL_UnlockSurface(sdl_dib); +} + +void sdl_copy_to_alpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag) { + SDL_LockSurface(sdl_dib); + image_copy_to_alpha(nact->ags.dib, sx, sy, w, h, dx, dy, flag); + SDL_UnlockSurface(sdl_dib); +} + +/* + * dib のピクセル情報を取得 + */ +void sdl_getPixel(int x, int y, Pallet *cell) { + SDL_LockSurface(sdl_dib); + + if (sdl_dib->format->BitsPerPixel == 8) { + BYTE *rt = setOffset(sdl_dib, x, y); + cell->pixel = *rt; + } else { + Uint32 cl=0; + BYTE *p = setOffset(sdl_dib, x, y); + + switch (sdl_dib->format->BytesPerPixel) { + case 2: + { + unsigned short *pp = (unsigned short *)p; + cl = *pp; + } + break; + case 3: +#ifndef WORDS_BIGENDIAN + cl = (p[2]<<16)+(p[1]<<8) + p[0]; +#else + cl = (p[0]<<16)+(p[1]<<8) + p[2]; +#endif + break; + case 4: + { + Uint32 *pp = (Uint32 *)p; + cl = *pp; + } + break; + } + SDL_GetRGB(cl, sdl_dib->format, &cell->r, &cell->g, &cell->b); + } + + SDL_UnlockSurface(sdl_dib); +} + +/* + * dib から領域の切り出し + */ +SDL_Surface* sdl_saveRegion(int x, int y, int w, int h) { + SDL_Surface *s; + SDL_Rect r_src, r_dst; + + s = SDL_AllocSurface(sdl_dib->flags, w, h, sdl_dib->format->BitsPerPixel, + sdl_dib->format->Rmask, sdl_dib->format->Gmask, + sdl_dib->format->Bmask, sdl_dib->format->Amask); + if (sdl_dib->format->BitsPerPixel == 8) + memcpy(s->format->palette->colors, sdl_dib->format->palette->colors, + sizeof(SDL_Color) * sdl_dib->format->palette->ncolors); + setRect(r_src, x, y, w, h); + setRect(r_dst, 0, 0, w, h); + SDL_BlitSurface(sdl_dib, &r_src, s, &r_dst); + return s; +} + +/* + * dib にセーブした領域を回復 + */ +void sdl_putRegion(SDL_Surface *src, int x, int y) { + SDL_Rect r_src,r_dst; + + setRect(r_src, 0, 0, src->w, src->h); + setRect(r_dst, x, y, src->w, src->h); + + SDL_BlitSurface(src, &r_src, sdl_dib, &r_dst); +} + +/* + * dib にセーブした領域からコピー + */ +void sdl_CopyRegion(SDL_Surface *src, int sx, int sy, int w,int h, int dx, int dy) { + SDL_Rect r_src,r_dst; + + setRect(r_src, sx, sy, w, h); + setRect(r_dst, dx, dy, w, h); + + SDL_BlitSurface(src, &r_src, sdl_dib, &r_dst); +} + +/* + * dib に dstを描画後、後始末 + */ +void sdl_restoreRegion(SDL_Surface *src, int x, int y) { + sdl_putRegion(src, x ,y); + SDL_FreeSurface(src); +} + +void sdl_sync() { + // imageXX等でsurface内を直接操作する際に、本当はlock/unlockで + // はさまないといけないんだけど、lockすればそれまでキューに入って + // いた SDL内部の処理がすべて終ると予想されるのでXsyncと同様の + // 効果があると思う。しかしUnlockしているので非同期でimageXXの処理中 + // にSDLの描画命令が入る可能性もあるが、X11ではたぶん大丈夫? + SDL_LockSurface(sdl_dib); + SDL_UnlockSurface(sdl_dib); +} diff --git a/src/sdl_input.c b/src/sdl_input.c new file mode 100644 index 0000000..374347c --- /dev/null +++ b/src/sdl_input.c @@ -0,0 +1,82 @@ +static int sdl_keytable[SDLK_LAST] = { + 0, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_BACKSPACE, KEY_TAB, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_CLEAR, KEY_RETURN, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_PAUSE, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_ESCAPE, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_SPACE, 33, 34, 35, + 36, KEY_UNDEFINED, 38, 39, + 40, 41, 42, 43, + 44, 45, 46, 47, + KEY_0, KEY_1, KEY_2, KEY_3, + KEY_4, KEY_5, KEY_6, KEY_7, + KEY_8, KEY_9, 58, 59, + 60, 61, 62, 63, + 64, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, 91, + 92, 93, 94, 95, + 96, KEY_A, KEY_B, KEY_C, + KEY_D, KEY_E, KEY_F, KEY_G, + KEY_H, KEY_I, KEY_J, KEY_K, + KEY_L, KEY_M, KEY_N, KEY_O, + KEY_P, KEY_Q, KEY_R, KEY_S, + KEY_T, KEY_U, KEY_V, KEY_W, + KEY_X, KEY_Y, KEY_Z, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_DELETE, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + 0 /* SDL_WORLD_0 */, 0 /* SDL_WORLD_1 */, 0 /* SDL_WORLD_2 */, 0 /* SDL_WORLD_3 */, + 0 /* SDL_WORLD_4 */, 0 /* SDL_WORLD_5 */, 0 /* SDL_WORLD_6 */, 0 /* SDL_WORLD_7 */, + 0 /* SDL_WORLD_8 */, 0 /* SDL_WORLD_9 */, 0 /* SDL_WORLD_10 */, 0 /* SDL_WORLD_11 */, + 0 /* SDL_WORLD_12 */, 0 /* SDL_WORLD_13 */, 0 /* SDL_WORLD_14 */, 0 /* SDL_WORLD_15 */, + 0 /* SDL_WORLD_16 */, 0 /* SDL_WORLD_17 */, 0 /* SDL_WORLD_18 */, 0 /* SDL_WORLD_19 */, + 0 /* SDL_WORLD_20 */, 0 /* SDL_WORLD_21 */, 0 /* SDL_WORLD_22 */, 0 /* SDL_WORLD_23 */, + 0 /* SDL_WORLD_24 */, 0 /* SDL_WORLD_25 */, 0 /* SDL_WORLD_26 */, 0 /* SDL_WORLD_27 */, + 0 /* SDL_WORLD_28 */, 0 /* SDL_WORLD_29 */, 0 /* SDL_WORLD_30 */, 0 /* SDL_WORLD_31 */, + 0 /* SDL_WORLD_32 */, 0 /* SDL_WORLD_33 */, 0 /* SDL_WORLD_34 */, 0 /* SDL_WORLD_35 */, + 0 /* SDL_WORLD_36 */, 0 /* SDL_WORLD_37 */, 0 /* SDL_WORLD_38 */, 0 /* SDL_WORLD_39 */, + 0 /* SDL_WORLD_40 */, 0 /* SDL_WORLD_41 */, 0 /* SDL_WORLD_42 */, 0 /* SDL_WORLD_43 */, + 0 /* SDL_WORLD_44 */, 0 /* SDL_WORLD_45 */, 0 /* SDL_WORLD_46 */, 0 /* SDL_WORLD_47 */, + 0 /* SDL_WORLD_48 */, 0 /* SDL_WORLD_49 */, 0 /* SDL_WORLD_50 */, 0 /* SDL_WORLD_51 */, + 0 /* SDL_WORLD_52 */, 0 /* SDL_WORLD_53 */, 0 /* SDL_WORLD_54 */, 0 /* SDL_WORLD_55 */, + 0 /* SDL_WORLD_56 */, 0 /* SDL_WORLD_57 */, 0 /* SDL_WORLD_58 */, 0 /* SDL_WORLD_59 */, + 0 /* SDL_WORLD_60 */, 0 /* SDL_WORLD_61 */, 0 /* SDL_WORLD_62 */, 0 /* SDL_WORLD_63 */, + 0 /* SDL_WORLD_64 */, 0 /* SDL_WORLD_65 */, 0 /* SDL_WORLD_66 */, 0 /* SDL_WORLD_67 */, + 0 /* SDL_WORLD_68 */, 0 /* SDL_WORLD_69 */, 0 /* SDL_WORLD_70 */, 0 /* SDL_WORLD_71 */, + 0 /* SDL_WORLD_72 */, 0 /* SDL_WORLD_73 */, 0 /* SDL_WORLD_74 */, 0 /* SDL_WORLD_75 */, + 0 /* SDL_WORLD_76 */, 0 /* SDL_WORLD_77 */, 0 /* SDL_WORLD_78 */, 0 /* SDL_WORLD_79 */, + 0 /* SDL_WORLD_80 */, 0 /* SDL_WORLD_81 */, 0 /* SDL_WORLD_82 */, 0 /* SDL_WORLD_83 */, + 0 /* SDL_WORLD_84 */, 0 /* SDL_WORLD_85 */, 0 /* SDL_WORLD_86 */, 0 /* SDL_WORLD_87 */, + 0 /* SDL_WORLD_88 */, 0 /* SDL_WORLD_89 */, 0 /* SDL_WORLD_90 */, 0 /* SDL_WORLD_91 */, + 0 /* SDL_WORLD_92 */, 0 /* SDL_WORLD_93 */, 0 /* SDL_WORLD_94 */, 0 /* SDL_WORLD_95 */, + KEY_PAD_0, KEY_PAD_1, KEY_PAD_2, KEY_PAD_3, + KEY_PAD_4, KEY_PAD_5, KEY_PAD_6, KEY_PAD_7, + KEY_PAD_8, KEY_PAD_9, KEY_PAD_PERIOD, KEY_PAD_DIVIDE, + KEY_PAD_MULTIPLY, KEY_PAD_MINUS, KEY_PAD_PLUS, KEY_PAD_ENTER, + KEY_PAD_EQUALS, KEY_UP, KEY_DOWN, KEY_RIGHT, + KEY_LEFT, KEY_INSERT, KEY_HOME, KEY_END, + KEY_PAGEUP, KEY_PAGEDOWN, KEY_F1, KEY_F2, + KEY_F3, KEY_F4, KEY_F5, KEY_F6, + KEY_F7, KEY_F8, KEY_F9, KEY_F10, + KEY_F11, KEY_F12, KEY_F13, KEY_F14, + KEY_F15, KEY_UNDEFINED, KEY_UNDEFINED, KEY_UNDEFINED, + KEY_NUMLOCK, KEY_CAPSLOCK, KEY_SCROLLOCK, KEY_RSHIFT, + KEY_RSHIFT, KEY_RCTRL, KEY_RCTRL, KEY_RALT, + KEY_RALT, 0 /* SDL_RMETA */, 0 /* SDL_LMETA */, 0 /* SDL_LSUPER */, + 0 /* SDL_RSUPER */, 0 /* SDL_MODE */, KEY_UNDEFINED, KEY_HELP, + 0 /* SDL_PRINT */, 0 /* SDL_SYSREQ */, 0 /* SDL_BREAK */, 0 /* SDL_MENU */, + 0 /* SDL_POWER */, 0 /* SDL_EURO */, }; diff --git a/src/sdl_mode.c b/src/sdl_mode.c new file mode 100644 index 0000000..17a5d75 --- /dev/null +++ b/src/sdl_mode.c @@ -0,0 +1,131 @@ +/* + * sdl_darw.c SDL video mode and full-screen + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_mode.c,v 1.6 2003/01/04 17:01:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "sdl_private.h" + + +static SDL_Rect **modes; + + +void sdl_vm_init(void) { + modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE); + + /* Check is there are any modes available */ + if (modes == (SDL_Rect **)0) { + SYSERROR("No modes available!\n"); + } + + /* Check if or resolution is restricted */ + if (modes == (SDL_Rect **)-1){ + NOTICE("All resolutions available.\n"); + } else { + int i; + /* Print valid modes */ + NOTICE("Available Modes\n"); + for(i = 0; modes[i]; i++) { + NOTICE(" %d x %d\n", modes[i]->w, modes[i]->h); + } + } + +} + +static int search_preferable_fullscreen_mode() { + int i, vm = 0, delta = INT_MAX; + + /* すべてのmodeのなかで最も適切なモードを選択 */ + for (i = 0; modes[i]; i++) { + if (modes[i]->w >= view_w && + modes[i]->h >= view_y) { + int deltaw = modes[i]->w - view_w; + int deltah = modes[i]->h - view_h; + if (delta > (deltaw + deltah)) { + vm = i; + delta = deltaw + deltah; + } + } + } + return vm; +} + +static void enter_fullscreen() { + Uint32 mode = sdl_vflag; + + mode |= SDL_FULLSCREEN; + + sdl_display = SDL_SetVideoMode(view_w, view_h, sdl_vinfo->vfmt->BitsPerPixel, mode); +} + +static void quit_fullscreen() { + +} + + +void sdl_FullScreen(boolean on) { + + if (on && !sdl_fs_on) { + sdl_fs_on = TRUE; + enter_fullscreen(); + } else if (!on && sdl_fs_on) { + quit_fullscreen(); + sdl_fs_on = FALSE; + } +} + + +/* Windowの大きさの変更 */ +void sdl_setWindowSize(int x, int y, int w, int h) { + Uint32 mode = sdl_vflag; + + view_x = x; + view_y = y; + + if (w == view_w && h == view_h) return; + + view_w = w; + view_h = h; + + if (sdl_fs_on) { + int m = search_preferable_fullscreen_mode(); + + if (modes[m]->w != view_w || modes[m]->h != view_h) { + winoffset_x = (modes[m]->w - view_w) / 2; + winoffset_y = (modes[m]->h - view_h) / 2; + w = modes[m]->w; + h = modes[m]->h; + } else { + winoffset_x = winoffset_y = 0; + } + + mode |= SDL_FULLSCREEN; + } + + sdl_display = SDL_SetVideoMode(w, h, sdl_vinfo->vfmt->BitsPerPixel, mode); + ms_active = (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ? TRUE : FALSE; +} diff --git a/src/sdl_private.h b/src/sdl_private.h new file mode 100644 index 0000000..d752168 --- /dev/null +++ b/src/sdl_private.h @@ -0,0 +1,102 @@ +/* + * sdl_private.h SDL only private data + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_private.h,v 1.4 2002/04/29 05:48:21 chikama Exp $ */ + +#ifndef __SDL_PRIVATE_H__ +#define __SDL_PRIVATE_H__ + +#include "config.h" + +#include + +#include "portab.h" +#include "ags.h" +#include "font.h" + +struct sdl_private_data { + const SDL_VideoInfo *vf; /* sdl video information */ + + SDL_Surface *dsp; /* toplevel surface */ + + Uint32 vflag; /* video mode flag */ + + SDL_Surface *dib; /* offscreen surface */ + + SDL_Color col[256]; /* color pallet */ + + unsigned long white; /* white pixel */ + + agsurface_t *cimg; + + SDL_Rect view; + + FONT *font; + + boolean ms_active; /* mouse is active */ + + boolean fs_on; + + int winoffset_x; /* draw offset in Window x */ + int winoffset_y; /* y */ + +}; + +extern void sdl_cursor_init(void); +extern void sdl_shadow_init(void); +extern void sdl_vm_init(void); + + +extern struct sdl_private_data *sdl_videodev; + +#define sdl_vinfo (sdl_videodev->vf) +#define sdl_display (sdl_videodev->dsp) +#define sdl_vflag (sdl_videodev->vflag) +#define sdl_dib (sdl_videodev->dib) +#define sdl_col (sdl_videodev->col) +#define sdl_white (sdl_videodev->white) +#define sdl_dibinfo (sdl_videodev->cimg) +#define sdl_font (sdl_videodev->font) +#define sdl_view (sdl_videodev->view) +#define view_x (sdl_videodev->view.x) +#define view_y (sdl_videodev->view.y) +#define view_w (sdl_videodev->view.w) +#define view_h (sdl_videodev->view.h) +#define ms_active (sdl_videodev->ms_active) +#define sdl_fs_on (sdl_videodev->fs_on) +#define winoffset_x (sdl_videodev->winoffset_x) +#define winoffset_y (sdl_videodev->winoffset_y) + +#define setRect(r,xx,yy,ww,hh) (r).x=(xx),(r).y=(yy),(r).w=(ww),(r).h=(hh) +#define setOffset(s,x,y) (s->pixels) + (x) * (s->format->BytesPerPixel) + (y) * s->pitch + +#ifdef HAVE_SDLRLE +#define RLEFLAG(v) ((v)|SDL_RLEACCEL) +#ifdef HAVE_SDLRALPHA +#define R_ALPHA(v) (v) +#else +#define R_ALPHA(v) (255-(v)) +#endif +#else +#define RLEFLAG(v) (v) +#define R_ALPHA(v) (v) +#endif + +#endif /* __SDL_PRIVATE_H__ */ diff --git a/src/sdl_video.c b/src/sdl_video.c new file mode 100644 index 0000000..4d081dd --- /dev/null +++ b/src/sdl_video.c @@ -0,0 +1,214 @@ +/* + * sdl_video.c SDL video init + * + * Copyright (C) 2000- Fumihiko Murata + * + * 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 + * +*/ +/* $Id: sdl_video.c,v 1.11 2003/01/04 17:01:02 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "sdl_core.h" +#include "sdl_private.h" +#include "xsystem35.h" +#include "font.h" +#include "joystick.h" +#include "image.h" + +static void window_init(void); +static void makeDIB(int width, int height, int depth); + +struct sdl_private_data *sdl_videodev; + +boolean RawKeyInfo[256]; + + +/* SDL の初期化 */ +int sdl_Initilize(void) { + sdl_videodev = g_new0(struct sdl_private_data, 1); + + /* make topleve window */ + window_init(); + + /* offscreen Pixmap */ + makeDIB(SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, SYS35_DEFAULT_DEPTH); + + /* title */ + SDL_WM_SetCaption("XSystem3.5 Version "VERSION, NULL); + + /* init cursor */ + sdl_cursor_init(); + + sdl_vm_init(); + + memset(RawKeyInfo, 0, sizeof(RawKeyInfo)); + + sdl_setWindowSize(0, 0, SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT); + + sdl_shadow_init(); + + joy_open(); + return 0; +} + +void sdl_Remove(void) { + if (sdl_videodev == NULL) return; + + if (sdl_display) { + NOTICE("Now SDL shutdown ... "); + + SDL_FreeSurface(sdl_dib); + + joy_close(); + + SDL_Quit(); + + NOTICE("Done!\n"); + } +} + +/* name is EUC */ +void sdl_setWindowTitle(char *name) { + SDL_WM_SetCaption(name, NULL); +} + +/* Visual に応じて Window を生成する */ +static void window_init(void) { + char s[256]; + + SDL_Init(SDL_INIT_VIDEO +#ifdef HAVE_SDLJOY + |SDL_INIT_JOYSTICK +#endif + ); + + sdl_vinfo = SDL_GetVideoInfo(); + + SDL_VideoDriverName(s, 256); + + NOTICE("Video Info %s\n", s); + NOTICE(" hw_available %d\n", sdl_vinfo->hw_available); + NOTICE(" wm_available %d\n", sdl_vinfo->wm_available); + NOTICE(" Accelerated blits HW --> HW %d\n", sdl_vinfo->blit_hw); + NOTICE(" Accelerated blits with Colorkey %d\n", sdl_vinfo->blit_hw_CC); + NOTICE(" Accelerated blits with Alpha %d\n", sdl_vinfo->blit_hw_A); + NOTICE(" Accelerated blits SW --> HW %d\n", sdl_vinfo->blit_sw); + NOTICE(" Accelerated blits with Colorkey %d\n", sdl_vinfo->blit_sw_CC); + NOTICE(" Accelerated blits with Alpha %d\n", sdl_vinfo->blit_sw_A); + NOTICE(" Accelerated color fill %d\n", sdl_vinfo->blit_fill); + NOTICE(" The total amount of video memory %dK\n", sdl_vinfo->video_mem); + NOTICE(" BitsPerPixel %d\n", sdl_vinfo->vfmt->BitsPerPixel); + NOTICE(" R %04x G %04x B %04x A %04x\n", + sdl_vinfo->vfmt->Rmask, sdl_vinfo->vfmt->Gmask, + sdl_vinfo->vfmt->Bmask, sdl_vinfo->vfmt->Amask); + + sdl_vflag = SDL_HWSURFACE | SDL_ANYFORMAT; + + sdl_display = SDL_SetVideoMode(SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, + sdl_vinfo->vfmt->BitsPerPixel, sdl_vflag); + + NOTICE("Dsp_depth %d flag %x\n", + sdl_display->format->BitsPerPixel, sdl_display->flags); +} + +static void makeDIB(int width, int height, int depth) { + + if (sdl_display->format->BitsPerPixel == 8 && depth != 8) { + SYSERROR("You cannot play highcolor game in 256 color mode\n"); + } + + if (depth == 24) { + WARNING("SDL warning: if you are using SDL version 1.1.x (x<=3) and someting is wrong with graphics, please use version 1.1.4 or later\n"); + } + + if (sdl_dib) { + SDL_FreeSurface(sdl_dib); + } + + if (depth == 8) { + if (sdl_display->format->BitsPerPixel == depth) { + sdl_dib = SDL_AllocSurface(SDL_SWSURFACE, width, height, + depth, 0, 0, 0, 0); + } else { + sdl_dib = SDL_AllocSurface(SDL_HWSURFACE, width, height, + depth, 0, 0, 0, 0); + } + } else { + sdl_dib = SDL_AllocSurface(SDL_HWSURFACE, width, height, + sdl_display->format->BitsPerPixel, 0, 0, 0, 0); + } + +#if 0 + if (sdl_dib->format->BitsPerPixel == 8) { + memset(sdl_dib->format->palette->colors, 0, sizeof(SDL_Color)*256); + } +#endif + +#if 0 + printf("DIB depth %d\n", sdl_dib->format->BitsPerPixel); + printf(" R %04x G %04x B %04x A %04x\n", + sdl_dib->format->Rmask, sdl_dib->format->Gmask, + sdl_dib->format->Bmask, sdl_dib->format->Amask); +#endif + if (depth > 8) { + sdl_white = (sdl_dib->format->Rmask | sdl_dib->format->Gmask | sdl_dib->format->Bmask); + } + + if (sdl_dibinfo) { + g_free(sdl_dibinfo); + } + + sdl_dibinfo = g_new0(agsurface_t, 1); + sdl_dibinfo->depth = sdl_dib->format->BitsPerPixel; + sdl_dibinfo->bytes_per_pixel = sdl_dib->format->BytesPerPixel; + sdl_dibinfo->bytes_per_line = sdl_dib->pitch; + sdl_dibinfo->pixel = sdl_dib->pixels; + sdl_dibinfo->width = width; + sdl_dibinfo->height = height; + sdl_dibinfo->alpha = NULL; + + image_setdepth(sdl_dibinfo->depth); +} + +void sdl_setFontDevice(FONT *f) { + sdl_font = f; +} + +/* offscreen の設定 */ +void sdl_setWorldSize(int width, int height, int depth) { + makeDIB(width, height, depth); + SDL_FillRect(sdl_dib, NULL, 0); +} + +/* Windowの size と depth の取得 */ +void sdl_getWindowInfo(DispInfo *info) { + info->width = sdl_display->w; + info->height = sdl_display->h; + info->depth = sdl_display->format->BitsPerPixel; +} + +/* DIBの取得 */ +agsurface_t *sdl_getDIB(void) { + return sdl_dibinfo; +} + diff --git a/src/selection.c b/src/selection.c new file mode 100644 index 0000000..3bc8131 --- /dev/null +++ b/src/selection.c @@ -0,0 +1,504 @@ +/* + * selection.c 選択 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: selection.c,v 1.42 2003/04/22 16:34:28 chikama Exp $ */ + +#include +#include +#include +#include +#include "portab.h" +#include "xsystem35.h" +#include "ags.h" +#include "scenario.h" +#include "windowframe.h" +#include "imput.h" +#include "message.h" +#include "selection.h" + +/* ショートカット */ +#define sel nact->sel + +/* 選択ウィンドが開いた時のマウスの初期位置(最初の選択肢の囲み内) */ +#define MOUSE_INIT_X_RATIO 5 /* from 0 to 100 */ +#define MOUSE_INIT_Y_RATIO 30 /* from 0 to 100 */ + +/* 選択肢の最大数 */ +#define ELEMENT_MAX 20 +/* 選択肢の1つの最大長さ */ +#define ELEMENT_LENGTH 101 + +/**************** Private Variables **********************/ +/* 選択肢の要素 */ +static char elm[ELEMENT_MAX][ELEMENT_LENGTH]; +/* 選択したときに返す値 */ +static int elmv[ELEMENT_MAX]; +/* 現在登録中の選択肢の番号 */ +static int regnum = 0; +/* 選択肢の要素の最大長さ */ +static int maxElementLength = 0; +/* 選択肢ウィンド退避 */ +static MyRectangle saveArea; +/* 選択ウィンドの退避用 */ +static void *saveimg; +static void *saveimg2; +/* 選択時のワーク */ +static MyRectangle *workR; +/* callback functions 初期化/選択/キャンセル時に呼ばれるシナリオ内関数*/ +static int cb_select_page; +static int cb_select_address; +static int cb_cancel_page; +static int cb_cancel_address; +/* 選択肢 window を開いた時のマウスカーソルの動作 */ +static int default_element = 1; +/* 最後に選んだ選択肢の要素番号 */ +static int last_selected_element; +/* キーボードによる選択操作用 */ +static int keymode = 0; + + +/**************** Private Instance Methods **********************/ +static void drawLineFrame(int x, int y, int width, int height); +static int whereElement(void); + +/* + 各公開変数初期化 +*/ +void sel_init() { + /* Window枠の種類 */ + sel.WindowFrameType = 0; + sel.FrameCgNoTop = 0; + sel.FrameCgNoMid = 0; + sel.FrameCgNoBot = 0; + sel.Framedot = 0; + + /* メッセージフォントの大きさ */ + sel.MsgFontSize = 16; + + /* 各種色 */ + sel.MsgFontColor = 255; + sel.WinFrameColor = 255; + sel.WinBackgroundColor = 0; + sel.WinElementEncloseColor = 255; + sel.SelectedElementColor = 0; + sel.WinBackgroundTransparent = 255; + sel.EncloseType = 0; + + /* 選択したあとメッセージ領域を初期化するか */ + sel.ClearMsgWindow = TRUE; + + /* 選択Windowの大きさの変更 */ + sel.WinResizeWidth = FALSE; + sel.WinResizeHeight = TRUE; + +#if 0 + sel.WinInfo.x = 464; + sel.WinInfo.y = 80; + sel.WinInfo.width = 160; + sel.WinInfo.height = 160; + sel.WinInfo.save = TRUE; + sel.savedImage = NULL; +#endif + + /* 選択肢を登録中 */ + sel.in_setting = FALSE; +} + +/* 登録された選択肢の個数を削減する */ +void sel_reduce(int no) { + if (regnum > no) { + regnum = no; + } +} + +/* 登録された選択肢の個数を取得する */ +int sel_getnumberof() { + return regnum; +} + +/* 登録された選択肢文字列を取得する */ +char *sel_gettext(int no) { + return elm[no -1]; +} + +/* 登録された選択肢アドレスにジャンプする */ +void sel_goto(int no, int flag) { + sl_jmpNear(elmv[no -1]); + + if (flag) { + sel.in_setting = FALSE; + regnum = 0; + maxElementLength = 0; + } +} + +/* 登録された選択肢アドレスに、関数リターン後ジャンプする */ +void sel_returengoto(int no, int flag) { + // 積んであるのが far call の時は、sl_retFarでもどり、farJumpする + // sl_retNear(); + // sl_jmpNear(elmv[no -1]); + sl_returnGoto(elmv[no -1]); + + if (flag) { + sel.in_setting = FALSE; + regnum = 0; + maxElementLength = 0; + } +} + +/* 選択肢デフォルト番号指定 */ +void sel_setDefaultElement(int type) { + default_element = type; +} + +/* 選択時コールバック指定 */ +void sel_setCallback(int type, int page, int adr) { + switch(type) { + case 1: + cb_select_page = page; + cb_select_address = adr; + break; + case 2: + cb_cancel_page = page; + cb_cancel_address = adr; + break; + } +} + +/* 最後に選択された選択番号を取得 */ +int sel_getLastElement() { + return last_selected_element; +} + +/* 選択要素数を返す */ +int sel_getRegistoredElementNumber() { + return regnum; +} + +/* 選択肢最大文字幅取得 */ +int sel_getRegistoredElementWidth() { + return maxElementLength; +} + +/* 選択肢最大文字幅取得(ASCII) */ +int sel_getRegistoredElement_strlen() { + int i, _max = 0; + + for (i = 0; i < regnum; i++) { + _max = max(_max, strlen(elm[i])); + } + return _max; +} + +/* フォントの設定 */ +void sel_setFontSize(int size) { + sel.MsgFontSize = size; +} + +/* 選択肢の登録 */ +void sel_addElement(const char *str) { + int catlen; + + catlen = ELEMENT_LENGTH - strlen(elm[regnum]) -1; + strncat(elm[regnum], str, catlen); +} + +/* 選択したときの返り値を登録 */ +void sel_addRetValue(int val) { + elm[regnum][0] = 0; + elmv[regnum] = val; +} + +/* 1要素の登録の終了 */ +void sel_fixElement() { + maxElementLength = max(maxElementLength, strlen(elm[regnum]) /2); + regnum++; +} + +/* 選択肢ウィンドを開く為の準備 */ +static void init_selwindow() { + int i; + MyRectangle r; + + r.x = sel.win->x; + r.y = sel.win->y; + r.width = 4 + (sel.WinResizeWidth ? sel.MsgFontSize * maxElementLength : sel.win->width); + r.height = 2 + (sel.WinResizeHeight ? (sel.MsgFontSize +2) * regnum : max((sel.MsgFontSize +2) * regnum, sel.win->height)); + + if (sel.win->save) { + saveArea.x = r.x - sel.Framedot; + saveArea.y = r.y - sel.Framedot; + saveArea.width = r.width + 2 * sel.Framedot; + saveArea.height = r.height + 2 * sel.Framedot; + saveimg = ags_saveRegion(saveArea.x, saveArea.y, saveArea.width, saveArea.height); + } else { + saveArea = r; + } + + if (sel.WinBackgroundTransparent == 255) { + ags_fillRectangle(r.x, r.y, r.width, r.height, sel.WinBackgroundColor); + } else { + ags_wrapColor(r.x, r.y, r.width, r.height, sel.WinBackgroundColor, sel.WinBackgroundTransparent); + } + + switch(sel.WindowFrameType) { + case WINDOW_FRAME_EMPTY: + break; + case WINDOW_FRAME_LINE: + drawLineFrame(r.x, r.y, r.width, r.height); + break; + case WINDOW_FRAME_CG: + printf("frameType is CG %d,%d,%d\n",sel.FrameCgNoTop, sel.FrameCgNoMid, sel.FrameCgNoBot); + break; + default: + printf("frameType is Default"); + break; + } + ags_setFont(FONT_GOTHIC, sel.MsgFontSize); + for (i = 0; i < regnum; i++) { + DEBUG_MESSAGE("%d:%s\n", i +1, elm[i]); + ags_drawString(r.x +2, r.y + i * (sel.MsgFontSize +2) +2, elm[i], sel.MsgFontColor); + } + ags_updateArea(saveArea.x, saveArea.y, saveArea.width, saveArea.height); + + /* マウスカーソルの自動移動 */ + if (default_element == 0) { + MyPoint p; + sys_getMouseInfo(&p, TRUE); + if (p.y < r.y) { + ags_setCursorLocation(r.x + r.width * MOUSE_INIT_X_RATIO/100, + r.y + (sel.MsgFontSize +2) * MOUSE_INIT_Y_RATIO/100, + TRUE); + } else if (p.y > (r.y + r.height)) { + ags_setCursorLocation(r.x + r.width * MOUSE_INIT_X_RATIO/100, + r.y + (sel.MsgFontSize +2) * regnum * MOUSE_INIT_Y_RATIO/100, + TRUE); + } else { + ags_setCursorLocation(r.x + r.width * MOUSE_INIT_X_RATIO/100, + p.y * MOUSE_INIT_Y_RATIO/100, + TRUE); + } + } else if (default_element < regnum) { + ags_setCursorLocation(r.x + r.width * MOUSE_INIT_X_RATIO/100, + r.y + (sel.MsgFontSize +2) * default_element * MOUSE_INIT_Y_RATIO/100, TRUE); + } else if (default_element < 1000) { + ags_setCursorLocation(r.x + r.width * MOUSE_INIT_X_RATIO/100, + r.y + (sel.MsgFontSize +2) * regnum * MOUSE_INIT_Y_RATIO/100, TRUE); + } +} + +static void remove_selwindow() { + if (sel.win->save) { + ags_restoreRegion(saveimg, saveArea.x, saveArea.y); + ags_updateArea(saveArea.x, saveArea.y, saveArea.width, saveArea.height); + saveimg = NULL; + } +} + +static int whereElement(void) { + int i; + MyPoint p; + MyRectangle *r = workR; + static int mpx, mpy; + + sys_getMouseInfo(&p, TRUE); + if (keymode) { + if (abs(mpx - p.x) > 2 || abs(mpy - p.y) > 2) { + keymode = 0; + } else { + return -1; + } + } + + mpx = p.x; + mpy = p.y; + + for (i = 0; i < regnum; i++) { + if (p.x >= r[i].x && p.x < r[i].x + r[i].width && + p.y >= r[i].y && p.y < r[i].y + r[i].height) { + return i; + } + } + return -1; +} + +static void lineEncloseElement(MyRectangle *r, int col) { + ags_drawRectangle(r->x , r->y , r->width +2, r->height +2, col); + ags_drawRectangle(r->x +1, r->y+1, r->width , r->height , col); + ags_updateArea (r->x , r->y , r->width +2, r->height +2); +} + +static void encloseElement(int sw, int no) { + MyRectangle *r = &workR[no]; + + if (sw == 0) { /* off */ + if (sel.WinBackgroundTransparent != 255) { + ags_restoreRegion(saveimg2, r->x, r->y); + ags_updateArea(r->x, r->y, r->width +2, r->height +2); + saveimg2 = NULL; + } else { + switch(sel.EncloseType) { + case 0: + lineEncloseElement(r, sel.WinBackgroundColor); break; + case 1: + case 2: + ags_fillRectangle(r->x, r->y, r->width +2, r->height +2, sel.WinBackgroundColor); + ags_drawString(r->x +2, r->y +2, elm[no], sel.MsgFontColor); + ags_updateArea(r->x, r->y, r->width +2, r->height +2); + break; + default: + break; + } + } + + } else { /* on */ + if (sel.WinBackgroundTransparent != 255) { + saveimg2 = ags_saveRegion(r->x, r->y, r->width +2, r->height +2); + } + switch(sel.EncloseType) { + case 0: + lineEncloseElement(r, sel.MsgFontColor); break; + case 1: + case 2: + ags_fillRectangleNeg(r->x, r->y, r->width +2, r->height +2, sel.SelectedElementColor); + ags_drawString(r->x +2, r->y +2, elm[no], sel.SelectedElementColor); + ags_updateArea(r->x, r->y, r->width +2, r->height +2); + break; + default: + break; + } + } +} + +static void drawLineFrame(int x, int y, int width, int height) { + ags_drawRectangle(x - 8, y - 8, width + 16, height + 16, sel.WinFrameColor); + ags_drawRectangle(x - 7, y - 7, width + 14, height + 14, sel.WinFrameColor); + ags_drawRectangle(x - 6, y - 6, width + 12, height + 12, sel.WinFrameColor); + ags_drawRectangle(x - 5, y - 5, width + 10, height + 10, sel.WinBackgroundColor); + ags_drawRectangle(x - 4, y - 4, width + 8, height + 8, sel.WinBackgroundColor); + ags_drawRectangle(x - 3, y - 3, width + 6, height + 6, sel.WinFrameColor); + ags_drawRectangle(x - 2, y - 2, width + 4, height + 4, sel.WinBackgroundColor); + ags_drawRectangle(x - 1, y - 1, width + 2, height + 2, sel.WinBackgroundColor); +} + +/* 実際に選択 */ +void sel_select() { + int curElement = -1; + int preElement = -1; + int key, i; + + saveimg2 = NULL; + keymode = 0; + + /* 選択肢ウィンドの初期化 */ + init_selwindow(); + + /* マウス領域の初期化 */ + if (NULL == (workR = malloc(sizeof(MyRectangle) * regnum))) { + NOMEMERR(); + } + + for (i = 0; i < regnum; i++) { + workR[i].x = sel.win->x; + workR[i].y = sel.win->y + i * (sel.MsgFontSize +2); + workR[i].width = 2 + (sel.WinResizeWidth ? sel.MsgFontSize * maxElementLength : sel.win->width); + workR[i].height = 2 + sel.MsgFontSize; + } + + sys_key_releasewait(SYS35KEY_RET, FALSE); + while (1) { + key = sys_keywait(25, TRUE); + if (key == SYS35KEY_SPC) break; + if (key == SYS35KEY_RET && curElement != -1) break; + if (key & 3) { + curElement = -1; + if ((key & 1)) { + if (preElement > 0) curElement = preElement-1; + if (preElement < 0) curElement = 0; + } + + if ((key & 2) && preElement < (regnum-1)) { + curElement = preElement+1; + } + if (curElement >= 0) { + if (preElement >= 0) { + encloseElement(0, preElement); + } + sys_key_releasewait(key, FALSE); + encloseElement(1, curElement); + preElement = curElement; + } + keymode = 1; + } else { + curElement = whereElement(); + fflush(stdout); + if (keymode) { + curElement = preElement; + continue; + } + + if (curElement != preElement) { + if (preElement != -1) { + encloseElement(0, preElement); + preElement = -1; + } + } + if (curElement != -1 && curElement != preElement) { + encloseElement(1, curElement); + preElement = curElement; + } + } + } + sys_key_releasewait(SYS35KEY_RET, FALSE); + + if (saveimg2 != NULL) { + ags_delRegion(saveimg2); + saveimg2 = NULL; + } + + free(workR); + + /* sysVar[0] = key; 実際には入らない。thanx 田尻さん */ + + regnum = 0; + maxElementLength = 0; + remove_selwindow(); + + if (sel.ClearMsgWindow) { + msg_nextPage(TRUE); + } + + if (key == SYS35KEY_RET) { + sl_jmpNear(elmv[curElement]); + if (cb_select_page != 0) { + sl_callFar2(cb_select_page -1, cb_select_address); + } + last_selected_element = curElement + 1; + } else { + sl_jmpNear(sl_getIndex()); + if (cb_cancel_page != 0) { + sl_callFar2(cb_cancel_page -1, cb_cancel_address); + } + last_selected_element = 0; + } + + if (get_skipMode2()) set_skipMode(FALSE); +} diff --git a/src/selection.h b/src/selection.h new file mode 100644 index 0000000..7ddded8 --- /dev/null +++ b/src/selection.h @@ -0,0 +1,85 @@ +/* + * selection.h 選択 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: selection.h,v 1.14 2002/05/07 21:43:53 chikama Exp $ */ + +#ifndef __SELECTION__ +#define __SELECTION__ + +#include "portab.h" +#include "windowframe.h" + +extern void sel_init(); +extern void sel_reduce(int no); +extern int sel_getnumberof(); +extern char *sel_gettext(int no); +extern void sel_goto(int no, int flag); +extern void sel_returengoto(int no, int flag); +extern void sel_setDefaultElement(int type); +extern void sel_setCallback(int type, int page, int adr); +extern int sel_getLastElement(); +extern int sel_getRegistoredElementNumber(); +extern int sel_getRegistoredElementWidth(); +extern int sel_getRegistoredElement_strlen(); +extern void sel_setFontSize(int size); +extern void sel_addElement(const char *str); +extern void sel_addRetValue(int val); +extern void sel_fixElement(); +extern void sel_select(); + +struct _selection { + /* Window枠の種類 */ + int WindowFrameType; + int FrameCgNoTop; + int FrameCgNoMid; + int FrameCgNoBot; + int Framedot; + + /* メッセージフォントの大きさ */ + int MsgFontSize; + + /* 各種色 */ + int MsgFontColor; + int WinFrameColor; + int WinBackgroundColor; + int WinElementEncloseColor; + int SelectedElementColor; + int WinBackgroundTransparent; + int EncloseType; + + /* 選択したあとメッセージ領域を初期化するか */ + boolean ClearMsgWindow; + + /* 選択Windowの大きさの変更 */ + boolean WinResizeWidth; + boolean WinResizeHeight; + + /* 選択肢 Window */ + int winno; + Bcom_WindowInfo *win; // 現在使用中の window + Bcom_WindowInfo wininfo[SELWINMAX]; + + /* 選択肢を登録中 */ + boolean in_setting; +}; +typedef struct _selection sel_t; + +#endif /* __SELECTION__ */ diff --git a/src/sndcnv.c b/src/sndcnv.c new file mode 100644 index 0000000..b1c40b8 --- /dev/null +++ b/src/sndcnv.c @@ -0,0 +1,303 @@ +/* + * sndcnv.c PCM フォーマット変換 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: sndcnv.c,v 1.10 2003/08/22 17:09:23 chikama Exp $ */ + +#include +#include +#include + +#include "portab.h" +#include "music_pcm.h" +#include "music_server.h" + +#include "sndcnv_rate.c" + +#define RIGHT(datum, bits) ((datum) >> bits) +#define LEFT(datum, bits) ((datum) << bits) + + +static int sndcnv_convert(pcmobj_t *pcm, int lv, int outlen); +static int sndcnv_norateconvert(pcmobj_t *pcm, int lv, int outlen); + +int sndcnv_prepare(pcmobj_t *pcm, int outlen) { + pcm->conv.ifmt = pcm->fmt; + pcm->conv.ofmt = prv.ofmt; + + if (pcm->conv.ifmt.rate != pcm->conv.ofmt.rate) { + pcm->conv.convert = sndcnv_convert; + } else { + pcm->conv.convert = sndcnv_norateconvert; + } + + pcm->conv.buf = g_malloc(outlen); + pcm->conv.isample = + (outlen * (pcm->fmt.bit/8) * pcm->fmt.ch * pcm->fmt.rate) / + ((prv.ofmt.bit/8) * prv.ofmt.ch * prv.ofmt.rate); + + st_rate_start(&pcm->conv); + + //printf("in rate = %d, bit = %d, ch = %d\n", pcm->fmt.rate, + // pcm->fmt.bit, pcm->fmt.ch); + //printf("devbuflen = %d\n", prv.audiodev.buf.len); + return OK; +} + +static int sndcnv_norateconvert(pcmobj_t *pcm, int lv, int outlen) { + void *ibuf, *buf0, *pd; + int len, i; + int isample; + + if (pcm->conv.ifmt.ch == pcm->conv.ofmt.ch && + pcm->conv.ifmt.bit == pcm->conv.ofmt.bit && + lv == 100) { + // puts("norateconv"); + len = pcm->src->read(pcm->src, pcm->conv.buf, 1, pcm->conv.isample); + return len; + } + + ibuf = g_malloc(outlen*2); + + len = pcm->src->read(pcm->src, ibuf, 1, pcm->conv.isample); + + if (len == 0) { + g_free(ibuf); + return 0; + } + + buf0 = g_malloc(outlen*2); + + // 8bit -> 16bit + switch(pcm->fmt.bit) { + case 8: // 8bit + { + unsigned char *src = ibuf; + WORD *dst = buf0; + + isample = len; + for (i = 0; i < isample; i++) { + *dst = LEFT(*src-128, 7); + src++; dst++; + } + pd = buf0; + break; + } + case 16: + isample = len / 2; + pd = ibuf; + break; + default: + isample = 0; + printf("no supported\n"); + g_free(ibuf); + g_free(buf0); + return 0; + } + + // change volume + if (lv != 100) { + double v = lv / 100.0, y; + short *p = pd; + for (i = 0; i < isample; i++) { + y = v * *p; + if (y < -32767.0) { + y = -32767.0; + } else if (y > 32767.0) { + y = 32767.0; + } + *p++ = y + 0.5; + } + } + + // stereo 化 + if (pcm->fmt.ch == 1) { + unsigned short *src, *dst; + src = pd; dst = pcm->conv.buf; + for (i = 0; i < isample; i++) { + *dst = *src; dst++; + *dst = *src; dst++; src++; + } + isample *= 4; + } else { + memcpy(pcm->conv.buf, pd, isample * 2); + isample *= 2; + } + + g_free(buf0); + g_free(ibuf); + + return isample; +} + +static int sndcnv_convert(pcmobj_t *pcm, int lv, int outlen) { + void *ibuf, *buf0, *bufl, *bufr, *bufrw, *buflw; + int len, i; + void *pr, *pl; + LONG isample = 0, osample = 0; + LONG osampler = LONG_MAX, osamplel = LONG_MAX; + + ibuf = g_malloc(outlen*2); + + // printf("pcm->src = %p, sample = %d, outlen = %d\n", pcm->src, pcm->conv.isample, outlen); + len = pcm->src->read(pcm->src, ibuf, 1, pcm->conv.isample); + + if (len == 0) { + g_free(ibuf); + return 0; + } + + buf0 = g_malloc(outlen*2); + bufr = g_malloc(outlen*2); + bufl = g_malloc(outlen*2); + bufrw = g_malloc(outlen*2); + buflw = g_malloc(outlen*2); + + // 8|16 bit -> LONG 変換 + switch(pcm->fmt.bit) { + case 8: // 8bit + { + unsigned char *src = ibuf; + LONG *dst = buf0; + isample = len; + for (i = 0; i < isample; i++) { + *dst = LEFT(*src-128, 23); + src++; dst++; + } + break; + } + case 16: // 16 bit + { + unsigned short *src = ibuf; + LONG *dst = buf0; + + isample = len / 2; + for (i = 0; i < isample; i++) { + *dst = LEFT(*src, 16); + src++; dst++; + } + break; + } + } + + // change volume + if (lv != 100) { + double v = lv / 100.0, y; + LONG *p = buf0; + // puts("change vol"); + for (i = 0; i < isample; i++) { + y = v * *p; + if (y < -2147483647.0) { + y = -2147483647.0; + } else if (y > 2147483647.0) { + y = 2147483647.0; + } + *p++ = y + 0.5; + } + } + + // stereo 分解 + if (pcm->fmt.ch == 2) { + LONG *src = buf0, *dstl = bufl, *dstr = bufr; + isample /= 2; + for (i = 0; i < isample; i++) { + *dstl = *src; dstl++; src++; + *dstr = *src; dstr++; src++; + } + pl = bufl; + pr = bufr; + } else { + pl = buf0; + pr = NULL; + } + + // rate 変換 left + i = isample; + osamplel = outlen; + //printf("insample = %d, osample = %d\n", isample, osamplel); + st_rate_flow(&pcm->conv, pl, buflw, &isample, &osamplel); + //printf("insample = %d, osample = %d\n", isample, osamplel); + + // rate 変換 right + if (pcm->fmt.ch == 2) { + isample = i; + osampler = outlen; + //printf("insample = %d, osample = %d\n", isample, osampler); + st_rate_flow(&pcm->conv, pr, bufrw, &isample, &osampler); + //printf("insample = %d, osample = %d\n", isample, osampler); + } + osample = MIN(osampler, osamplel); + + // LONG -> 16bit 変換 + if (pcm->fmt.ch == 2) { + LONG *srcl, *srcr; + unsigned short *dstl, *dstr; + + srcl = buflw; srcr = bufrw; + dstl = bufl; dstr = bufr; + + for (i = 0; i < osample; i++) { + *dstl = RIGHT(*srcl, 16); dstl++; srcl++; + *dstr = RIGHT(*srcr, 16); dstr++; srcr++; + } + } else { + LONG *src = buflw; + unsigned short *dst = bufl; + + for (i = 0; i < osample; i++) { + *dst = RIGHT(*src, 16); dst++; src++; + } + } + + // stereo 化 + if (pcm->fmt.ch == 2) { + unsigned short *srcl, *srcr, *dst; + + srcl = bufl; srcr = bufr; + dst = pcm->conv.buf; + for (i = 0; i < osample; i++) { + *dst = *srcl; dst++; srcl++; + *dst = *srcr; dst++; srcr++; + } + } else { + unsigned short *src, *dst; + src = bufl; dst = pcm->conv.buf; + + for (i = 0; i < osample; i++) { + *dst = *src; dst++; + *dst = *src; dst++; src++; + } + } + + g_free(buflw); + g_free(bufrw); + g_free(bufl); + g_free(bufr); + g_free(buf0); + g_free(ibuf); + + //printf("outlen = %d\n", osample * 4); + return osample * 4; // 変換後の長さ(byte数) +} + +int sndcnv_drain(pcmobj_t *pcm) { + g_free(pcm->conv.buf); + return OK; +} diff --git a/src/sndcnv_rate.c b/src/sndcnv_rate.c new file mode 100644 index 0000000..72152e0 --- /dev/null +++ b/src/sndcnv_rate.c @@ -0,0 +1,125 @@ +/* + * sndcnv_rate.c PCM 周波数変換 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * based on sox/rate.c Copyright 1998 Fabrice Bellard. + * + * 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 + * +*/ +/* $Id: sndcnv_rate.c,v 1.1 2002/08/18 09:35:29 chikama Exp $ */ + +#include + +#define LONG gint32 +#define ULONG guint32 + +#define FRAC_BITS 16 + +/* Private data */ +typedef struct ratestuff { + ULONG opos_frac; /* fractional position of the output stream in input stream unit */ + ULONG opos; + ULONG opos_inc_frac; /* fractional position increment in the output stream */ + ULONG opos_inc; + ULONG ipos; /* position in the input stream (integer) */ + LONG ilast; /* last sample in the input stream */ +} *rate_t; + +/* + * Prepare processing. + */ +int st_rate_start(sndcnv_t *effp) { + rate_t rate = (rate_t) effp->priv; + ULONG incr; + + // printf("inrate = %d, outrate = %d\n", effp->ininfo.rate, effp->outinfo.rate); + if (effp->ifmt.rate >= 65535 || effp->ofmt.rate >= 65535) { + // st_fail("rate effect can only handle rates <= 65535"); + return NG; + } + + rate->opos_frac = 0; + rate->opos = 0; + + /* increment */ + incr = (ULONG)((double)effp->ifmt.rate / (double)effp->ofmt.rate * + (double) ((unsigned long)1 << FRAC_BITS)); + + rate->opos_inc_frac = incr & (((unsigned long)1 << FRAC_BITS) -1); + rate->opos_inc = incr >> FRAC_BITS; + + // printf("inc_frac = %d\n", rate->opos_inc_frac); + // printf("inc = %d\n", rate->opos_inc); + + rate->ipos = 0; + rate->ilast = 0; + + return OK; +} + +int st_rate_flow(sndcnv_t *effp, LONG *ibuf, LONG *obuf, LONG *isamp, LONG *osamp) { + rate_t rate = (rate_t) effp->priv; + LONG *istart, *iend; + LONG *ostart, *oend; + LONG ilast, icur, out; + ULONG tmp; + double t; + + ilast = rate->ilast; + + istart = ibuf; + iend = ibuf + *isamp; + + ostart = obuf; + oend = obuf + *osamp; + + while (obuf < oend) { + // printf("%p, %p\n", obuf, oend); + + /* Safety catch to make sure we have input samples. */ + if (ibuf >= iend) goto the_end; + + /* read as many input samples so that ipos > opos */ + + while (rate->ipos <= rate->opos) { + ilast = *ibuf++; + rate->ipos++; + /* See if we finished the input buffer yet */ + if (ibuf >= iend) goto the_end; + } + + icur = *ibuf; + + /* interpolate */ + t = (double)rate->opos_frac / ((unsigned long)1 << FRAC_BITS); + out = (double)ilast * (1.0 - t) + (double)icur * t; + + /* output sample & increment position */ + + *obuf++ = (LONG)out; + + tmp = rate->opos_frac + rate->opos_inc_frac; + rate->opos = rate->opos + rate->opos_inc + (tmp >> FRAC_BITS); + rate->opos_frac = tmp & (((unsigned long)1 << FRAC_BITS) - 1); + } + the_end: + *isamp = ibuf - istart; + *osamp = obuf - ostart; + rate->ilast = ilast; + return OK; +} diff --git a/src/system.h b/src/system.h new file mode 100644 index 0000000..314e327 --- /dev/null +++ b/src/system.h @@ -0,0 +1,66 @@ +/* + * system.h general error/debug message + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: system.h,v 1.12 2003/07/14 16:22:51 chikama Exp $ */ + +#ifndef __SYSTEM__ +#define __SYSTEM__ + +#include "config.h" + +#ifndef HAVE_FUNC +#ifndef __GNUC__ +#define __func__ "" +#else +#define __func__ __FUNCTION__ +#endif +#endif + +/* should define in somewhere */ +extern void sys_error(char *format, ...); /* show nessafe and exit system */ +extern void sys_exit(int code); /* exit system with code */ +extern void sys_message(char *format, ...); /* show various message */ +extern void sys_reset(); +extern int sys_nextdebuglv; /* message level */ + +/* + DEBUGLEVEL + 0: critical error message only (output to terminal or message box) + [stable release default] + 1: warning only(output to terminal) + 2+: more message [devel relase default] +*/ + +#ifdef DEBUG +#define DEBUGLEVEL 2 +#else +#define DEBUGLEVEL 0 +#endif /* DEBUG */ + +#define NOMEMERR() sys_error("Out of memory at %s()\n", __func__) +#define NOTICE sys_nextdebuglv = 2, sys_message + +#define WARNING sys_nextdebuglv = 1, \ +sys_message("*WARNING*(%s): ", __func__), sys_message + +#define SYSERROR fprintf(stderr, "*ERROR*(%s): ", __func__), sys_error + +#endif /* !__SYSTEM__ */ diff --git a/src/tempname.c b/src/tempname.c new file mode 100644 index 0000000..5294ec9 --- /dev/null +++ b/src/tempname.c @@ -0,0 +1,266 @@ +/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +#if !(HAVE_MKDTEMP) + +#include + +#include +#include + +#include +#ifndef __set_errno +# define __set_errno(Val) errno = (Val) +#endif + +#include +#ifndef P_tmpdir +# define P_tmpdir "/tmp" +#endif +#ifndef TMP_MAX +# define TMP_MAX 238328 +#endif +#ifndef __GT_FILE +# define __GT_FILE 0 +# define __GT_BIGFILE 1 +# define __GT_DIR 2 +# define __GT_NOCREATE 3 +#endif + +#if STDC_HEADERS +# include +# include +# include +#endif + +#if HAVE_FCNTL_H +# include +#endif + +#if HAVE_SYS_TIME_H +# include +#endif + +#if HAVE_STDINT_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + +#include +#if STAT_MACROS_BROKEN +# undef S_ISDIR +#endif +#if !defined S_ISDIR && defined S_IFDIR +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#endif +#if !S_IRUSR && S_IREAD +# define S_IRUSR S_IREAD +#endif +#if !S_IRUSR +# define S_IRUSR 00400 +#endif +#if !S_IWUSR && S_IWRITE +# define S_IWUSR S_IWRITE +#endif +#if !S_IWUSR +# define S_IWUSR 00200 +#endif +#if !S_IXUSR && S_IEXEC +# define S_IXUSR S_IEXEC +#endif +#if !S_IXUSR +# define S_IXUSR 00100 +#endif + +#define struct_stat64 struct stat +#define __getpid getpid +#define __gettimeofday gettimeofday +#define __mkdir mkdir +#define __open open +#define __open64 open +#define __lxstat64(version, path, buf) lstat (path, buf) +#define __xstat64(version, path, buf) stat (path, buf) + + +#if ! (HAVE___SECURE_GETENV) +# define __secure_getenv getenv +#endif + +/* Use the widest available unsigned type if uint64_t is not + available. The algorithm below extracts a number less than 62**6 + (approximately 2**35.725) from uint64_t, so ancient hosts where + uintmax_t is only 32 bits lose about 3.725 bits of randomness, + which is better than not having mkstemp at all. */ +#if !defined uint64_t +# define uint64_t guint64 +#endif + +/* These are the characters used in temporary filenames. */ +static const char letters[] = +"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +/* Generate a temporary file name based on TMPL. TMPL must match the + rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed + does not exist at the time of the call to __gen_tempname. TMPL is + overwritten with the result. + + KIND may be one of: + __GT_NOCREATE: simply verify that the name does not exist + at the time of the call. + __GT_FILE: create the file using open(O_CREAT|O_EXCL) + and return a read-write fd. The file is mode 0600. + __GT_BIGFILE: same as __GT_FILE but use open64(). + __GT_DIR: create a directory, which will be mode 0700. + + We use a clever algorithm to get hard-to-predict names. */ +static int +__gen_tempname (char *tmpl, int kind) +{ + int len; + char *XXXXXX; + static uint64_t value; + uint64_t random_time_bits; + unsigned int count; + int fd = -1; + int save_errno = errno; + struct_stat64 st; + + /* A lower bound on the number of temporary files to attempt to + generate. The maximum total number of temporary file names that + can exist for a given template is 62**6. It should never be + necessary to try all these combinations. Instead if a reasonable + number of names is tried (we define reasonable as 62**3) fail to + give the system administrator the chance to remove the problems. */ + unsigned int attempts_min = 62 * 62 * 62; + + /* The number of times to attempt to generate a temporary file. To + conform to POSIX, this must be no smaller than TMP_MAX. */ + unsigned int attempts = attempts_min < TMP_MAX ? TMP_MAX : attempts_min; + + len = strlen (tmpl); + if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) + { + __set_errno (EINVAL); + return -1; + } + + /* This is where the Xs start. */ + XXXXXX = &tmpl[len - 6]; + + /* Get some more or less random data. */ +#if HAVE_GETTIMEOFDAY + { + struct timeval tv; + __gettimeofday (&tv, NULL); + random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; + } +#else + random_time_bits = time (NULL); +#endif + value += random_time_bits ^ __getpid (); + + for (count = 0; count < attempts; value += 7777, ++count) + { + uint64_t v = value; + + /* Fill in the random bits. */ + XXXXXX[0] = letters[v % 62]; + v /= 62; + XXXXXX[1] = letters[v % 62]; + v /= 62; + XXXXXX[2] = letters[v % 62]; + v /= 62; + XXXXXX[3] = letters[v % 62]; + v /= 62; + XXXXXX[4] = letters[v % 62]; + v /= 62; + XXXXXX[5] = letters[v % 62]; + + switch (kind) + { + case __GT_FILE: + fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + break; + + case __GT_BIGFILE: + fd = __open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + break; + + case __GT_DIR: + fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR); + break; + + case __GT_NOCREATE: + /* This case is backward from the other three. __gen_tempname + succeeds if __xstat fails because the name does not exist. + Note the continue to bypass the common logic at the bottom + of the loop. */ + if (__lxstat64 (_STAT_VER, tmpl, &st) < 0) + { + if (errno == ENOENT) + { + __set_errno (save_errno); + return 0; + } + else + /* Give up now. */ + return -1; + } + continue; + + default: + assert (! "invalid KIND in __gen_tempname"); + } + + if (fd >= 0) + { + __set_errno (save_errno); + return fd; + } + else if (errno != EEXIST) + return -1; + } + + /* We got out of the loop because we ran out of combinations to try. */ + __set_errno (EEXIST); + return -1; +} + +/* Generate a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the filename unique. + The directory is created, mode 700, and its name is returned. + (This function comes from OpenBSD.) */ +char * +mkdtemp (template) + char *template; +{ + if (__gen_tempname (template, __GT_DIR)) + return NULL; + else + return template; +} + +#endif diff --git a/src/variable.c b/src/variable.c new file mode 100644 index 0000000..d56a71e --- /dev/null +++ b/src/variable.c @@ -0,0 +1,176 @@ +/* + * variable.c 変数管理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: variable.c,v 1.15 2002/09/18 13:16:22 chikama Exp $ */ + +#include +#include +#include +#include "portab.h" +#include "variable.h" +#include "xsystem35.h" + +/* システム変数 */ +int *sysVar; +/* 配列変数の情報 */ +arrayVarStruct *sysVarAttribute; +/* 配列本体 */ +arrayVarBufferStruct *arrayVarBuffer; +/* 64bit変数 */ +double longVar[SYSVARLONG_MAX]; +/* 文字列変数 */ +static char *strVar; +/* 文字列変数の属性(最大,1つあたりの大きさ) */ +int strvar_cnt = STRVAR_MAX; +int strvar_len = STRVAR_LEN; + + +/* 配列バッファの確保 DC ,page = 1~ */ +extern boolean v_allocateArrayBuffer(int page, int size, boolean flg) { + void *buf; + + if (page <= 0 || page > 256) { return false; } + if (size <= 0 || size > 65536) { return false; } + + if (NULL == (buf = malloc(size * sizeof(int) + 257))) { + NOMEMERR(); + } + memset(buf, 0, size * sizeof(int) + 257); + if (arrayVarBuffer[page - 1].value != NULL) { + int len = min(size, arrayVarBuffer[page - 1].max); + memcpy(buf, arrayVarBuffer[page - 1].value, len * sizeof(int)); + } + + arrayVarBuffer[page - 1].value = buf; + arrayVarBuffer[page - 1].max = size; + arrayVarBuffer[page - 1].saveflag = flg; + + return true; +} + +/* 配列変数の割り当て DS */ +extern boolean v_defineArrayVar(int datavar, int *pointvar, int offset, int page) { + if (datavar < 0 || datavar > SYSVAR_MAX - 1) { return false; } + if (page < 0 || page > ARRAYVAR_PAGEMAX - 1) { return false; } + if (offset < 0 || offset > arrayVarBuffer[page - 1].max - 1) { return false; } + + sysVarAttribute[datavar].pointvar = pointvar; + sysVarAttribute[datavar].page = page; + sysVarAttribute[datavar].offset = offset; + return true; +} + +/* 配列変数の割り当て解除 DR */ +extern boolean v_releaseArrayVar(int datavar) { + sysVarAttribute[datavar].page = 0; + return true; +} + +/* 指定ページの最大変数の取得 page = 1~ */ +extern int v_getArrayBufferCnt(int page) { + return arrayVarBuffer[page - 1].max; +} + +/* 指定ページは使用中 page = 1~ */ +extern boolean v_getArrayBufferStatus(int page) { + return (arrayVarBuffer[page - 1].value != NULL) ? true : false; +} + +/* 文字列変数の再初期化 */ +extern void v_initStringVars(int cnt,int len) { + strVar = realloc(strVar, cnt * len); + if (strVar == NULL) { + NOMEMERR(); + } + strvar_cnt = cnt; + strvar_len = len; +} + +/* 変数の初期化 */ +extern boolean v_initVars() { + sysVar = calloc(SYSVAR_MAX, sizeof(int)); + sysVarAttribute = calloc(SYSVAR_MAX, sizeof(arrayVarStruct)); + arrayVarBuffer = calloc(ARRAYVAR_PAGEMAX, sizeof(arrayVarBufferStruct)); + strVar = calloc(STRVAR_MAX, STRVAR_LEN); + + if (strVar == NULL || sysVar == NULL || sysVarAttribute == NULL || arrayVarBuffer == NULL) { + NOMEMERR(); + } + + return true; +} + +/* 文字変数への代入 */ +char *v_strcpy(int no, const char *str) { + return strncpy(strVar + no * strvar_len, str, strvar_len - 1); +} + +/* 文字変数への接続 */ +char *v_strcat(int no, const char *str) { + return strncat(strVar + no * strvar_len, str, strvar_len - 1); +} + +/* 文字変数の長さ */ +size_t v_strlen(int no) { + return strlen(strVar + no * strvar_len); +} + +/* 文字変数そのもの */ +char *v_str(int no) { + return strVar + no * strvar_len; +} + +#ifdef DEBUG + +void debug_showvariable() { + int i,j,k; + int *var; + FILE *fp = fopen("VARIABLES.TXT","a"); + if (fp == NULL) return; + + fprintf(fp, "Page = %d, index = %x\n", sl_getPage(), sl_getIndex()); + + var = &sysVar[0]; + fprintf(fp, "sysVar\n"); + for (i = 0; i < SYSVAR_MAX; i+=10) { + for (j = 0; j < 10; j++) { + fprintf(fp, "%d,", *var); var++; + } + fprintf(fp, "\n"); + } + + for (i = 0; i < ARRAYVAR_PAGEMAX; i++) { + if (arrayVarBuffer[i].value != NULL) { + fprintf(fp, "ArrayPage[%d],max=%d\n",i,arrayVarBuffer[i].max); + var = arrayVarBuffer[i].value; + for (j = 0; j < arrayVarBuffer[i].max; j+=10) { + for (k = 0; k < 10; k++) { + fprintf(fp, "%d,", *var); var++; + } + fprintf(fp, "\n"); + } + } + } + + fclose(fp); +} + +#endif diff --git a/src/variable.h b/src/variable.h new file mode 100644 index 0000000..27681bf --- /dev/null +++ b/src/variable.h @@ -0,0 +1,68 @@ +/* + * variable.h 変数管理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: variable.h,v 1.11 2003/04/22 16:34:28 chikama Exp $ */ + +#ifndef __VARIABLE__ +#define __VARIABLE__ + +#include +#include "portab.h" + + +// #define SYSVAR_MAX 1024 +//#define SYSVAR_MAX 8192# +#define SYSVAR_MAX 65536 +#define SYSVARLONG_MAX 128 +#define STRVAR_MAX 5000 +#define STRVAR_LEN 101 +#define ARRAYVAR_PAGEMAX 256 + +typedef struct { + int max; + boolean saveflag; + int *value; +} arrayVarBufferStruct; + +typedef struct { + int *pointvar; + int page; + int offset; +} arrayVarStruct; + +extern int *sysVar; +extern arrayVarStruct *sysVarAttribute; +extern arrayVarBufferStruct *arrayVarBuffer; +extern double longVar[]; +extern boolean v_allocateArrayBuffer(int , int , boolean ); +extern boolean v_defineArrayVar(int , int *, int , int ); +extern boolean v_releaseArrayVar(int ); +extern boolean v_releaseArrayVar(int datavar); +extern int v_getArrayBufferCnt(int page); +extern boolean v_getArrayBufferStatus(int page); +extern void v_initStringVars(int ,int ); +extern boolean v_initVars(); +extern char *v_strcpy(int no, const char *str); +extern char *v_strcat(int no, const char *str); +extern size_t v_strlen(int no); +extern char *v_str(int no); + +#endif /* !__VARIABLE__ */ diff --git a/src/vsp.c b/src/vsp.c new file mode 100644 index 0000000..5e76258 --- /dev/null +++ b/src/vsp.c @@ -0,0 +1,246 @@ +/* + * vsp.c extract VSP cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * 0.00 97/11/06 初版 + * 0.01 97/11/12 TYPO + * 0.01-01 97/11/13 ヘッダ情報の返しかたの変更 + * 0.01-02 97/11/27 記憶子の変更 + * 0.01-03 97/12/06 ヘッダの誤認識の修正 + * 0.02 98/02/26 デバッグ済み + * 0.03 98/03/20 ヘッダチェックのミス + * 0.03 98/12/19 dalkで640x401なCGがあったのでその対策 + * @version 1.5 00/09/17 rewrite for changeing interface +*/ +/* $Id: vsp.c,v 1.6 2000/11/25 18:31:49 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "LittleEndian.h" +#include "graphics.h" +#include "cg.h" +#include "vsp.h" + +/* + * static methods +*/ +static vsp_header *extract_header(BYTE *b); +static void getpal(Pallet256 *pal, BYTE *b); +static void extract(vsp_header *vsp, BYTE *pic, BYTE *b); + +/* + * extraction buffer +*/ +static BYTE _bc[4][480]; +static BYTE _bp[4][480]; +static BYTE *bc[4]; +static BYTE *bp[4]; + +/* + * Get information from cg header + * b: raw data (pointer to header) + * return: acquired vsp information object +*/ +static vsp_header *extract_header(BYTE *b) { + vsp_header *vsp = g_new(vsp_header, 1); + + vsp->vspX0 = LittleEndian_getW(b, 0); + vsp->vspY0 = LittleEndian_getW(b, 2); + vsp->vspXW = LittleEndian_getW(b, 4) - vsp->vspX0; + vsp->vspYW = LittleEndian_getW(b, 6) - vsp->vspY0; + vsp->vspPb = b[9]; + vsp->vspPp = 0x0a; + vsp->vspDp = 0x3a; + + return vsp; +} + +/* + * Get pallet from raw data + * pal: pallet to be stored + * b : raw data (pointer to pallet) +*/ +static void getpal(Pallet256 *pal, BYTE *b) { + int red, green, blue, i; + + for (i = 0; i < 16; i++) { + blue = b[i * 3 + 0]; + red = b[i * 3 + 1]; + green = b[i * 3 + 2]; + pal->red[i] = (red << 4); + pal->green[i] = (green << 4); + pal->blue[i] = (blue << 4); + } +} + +/* + * Do extract vsp image + * vsp: vsp header information + * pic: pixel to be stored + * b : raw data (pointer to pixel) +*/ +static void extract(vsp_header *vsp, BYTE *pic, BYTE *b) { + int c0; + BYTE b0, b1, b2, b3, mask = 0; + BYTE *bt; + int i, l, x, y, pl, loc; + + bp[0] = _bp[0]; bc[0] = _bc[0]; + bp[1] = _bp[1]; bc[1] = _bc[1]; + bp[2] = _bp[2]; bc[2] = _bc[2]; + bp[3] = _bp[3]; bc[3] = _bc[3]; + + for (x = 0; x < vsp->vspXW; x++) { + for (pl = 0; pl < 4; pl++) { + y = 0; + while(y < vsp->vspYW) { + c0 = *b++; + if (c0 >= 0x08) { + *(bc[pl] + y) = c0; y++; + } else if (c0 == 0x00) { + l = (*b) + 1; b++; + memcpy(bc[pl] + y, bp[pl] + y, l); + y+=l; + } else if (c0 == 0x01) { + l = (*b) + 1; b++; + b0 = *b++; + memset(bc[pl] + y, b0, l); + y+=l; + } else if (c0 == 0x02) { + l = (*b) + 1; b++; + b0 = *b++; b1 = *b++; + for (i = 0; i < l; i++) { + *(bc[pl] + y) = b0; y++; + *(bc[pl] + y) = b1; y++; + } + } else if (c0 == 0x03) { + l = (*b) + 1; b++; + for (i = 0; i < l; i++) { + *(bc[pl] + y) = (*(bc[0] + y) ^ mask); y++; + } + mask = 0; + } else if (c0 == 0x04) { + l = (*b) + 1; b++; + for (i = 0; i < l; i++) { + *(bc[pl] + y) = (*(bc[1] + y) ^ mask); y++; + } + mask = 0; + } else if (c0 == 0x05) { + l = (*b) + 1; b++; + for (i = 0; i < l; i++) { + *(bc[pl] + y) = (*(bc[2] + y) ^ mask); y++; + } + mask = 0; + } else if (c0 == 0x06) { + mask = 0xff; + } else if (c0 == 0x07) { + *(bc[pl] + y) = *b++ ; y++; + } + } + } + /* plane -> packed 展開 */ + for (y = 0; y < vsp->vspYW; y++) { + loc = (y * vsp->vspXW + x) * 8; + b0 = bc[0][y]; b1 = bc[1][y]; + b2 = bc[2][y]; b3 = bc[3][y]; + *(pic + loc + 0) = ((b0>>7)&0x01)|((b1>>6)&0x02)|((b2>>5)&0x04)|((b3>>4)&0x08); + *(pic + loc + 1) = ((b0>>6)&0x01)|((b1>>5)&0x02)|((b2>>4)&0x04)|((b3>>3)&0x08); + *(pic + loc + 2) = ((b0>>5)&0x01)|((b1>>4)&0x02)|((b2>>3)&0x04)|((b3>>2)&0x08); + *(pic + loc + 3) = ((b0>>4)&0x01)|((b1>>3)&0x02)|((b2>>2)&0x04)|((b3>>1)&0x08); + *(pic + loc + 4) = ((b0>>3)&0x01)|((b1>>2)&0x02)|((b2>>1)&0x04)|((b3 )&0x08); + *(pic + loc + 5) = ((b0>>2)&0x01)|((b1>>1)&0x02)|((b2 )&0x04)|((b3<<1)&0x08); + *(pic + loc + 6) = ((b0>>1)&0x01)|((b1 )&0x02)|((b2<<1)&0x04)|((b3<<2)&0x08); + *(pic + loc + 7) = ((b0 )&0x01)|((b1<<1)&0x02)|((b2<<2)&0x04)|((b3<<3)&0x08); + } + /* bc -> bpにコピー */ + bt = bp[0]; bp[0] = bc[0]; bc[0] = bt; + bt = bp[1]; bp[1] = bc[1]; bc[1] = bt; + bt = bp[2]; bp[2] = bc[2]; bc[2] = bt; + bt = bp[3]; bp[3] = bc[3]; bc[3] = bt; + } +} + +/* + * Check data is vsp format cg or not + * data: raw data (pointer to data top) + * return: TRUE if data is vsp +*/ +boolean vsp_checkfmt(BYTE *data) { + int x0 = LittleEndian_getW(data, 0); + int y0 = LittleEndian_getW(data, 2); + int w = LittleEndian_getW(data, 4) - x0; + int h = LittleEndian_getW(data, 6) - y0; + + if (x0 < 0 || x0 > 80 || y0 < 0 || y0 > 400) return FALSE; + /* 401: for dalk's broken cg */ + if (w < 0 || w > 80 || h < 0 || h > 401) return FALSE; + + return TRUE; +} + +/* + * Extract vsp, header, pallet and pixel + * data: raw data (pointer to data top) + * return: extracted image data and information +*/ +cgdata *vsp_extract(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + vsp_header *vsp = extract_header(data); + + cg->pal = g_new(Pallet256, 1); + getpal(cg->pal, data + vsp->vspPp); + + /* +10: margin for broken cg */ + cg->pic = g_new(BYTE, (vsp->vspXW * 8 + 10) * (vsp->vspYW + 10)); + extract(vsp, cg->pic, data + vsp->vspDp); + + cg->type = ALCG_VSP; + cg->x = vsp->vspX0 * 8; + cg->y = vsp->vspY0; + cg->width = vsp->vspXW * 8; + cg->height = vsp->vspYW; + cg->vsp_bank = vsp->vspPb; + cg->alpha = NULL; + + g_free(vsp); + + return cg; +} + +/* + * Extract vsp pallet only + * data: raw data (pointer to data top) + * return: extracted pallet data +*/ +cgdata *vsp_getpal(BYTE *data) { + cgdata *cg = g_new0(cgdata, 1); + vsp_header *vsp = extract_header(data); + + cg->pal = g_new(Pallet256, 1); + getpal(cg->pal, data + vsp->vspPp); + + cg->type = ALCG_VSP; + cg->pic = NULL; + cg->alpha = NULL; + + g_free(vsp); + + return cg; +} diff --git a/src/vsp.h b/src/vsp.h new file mode 100644 index 0000000..28929da --- /dev/null +++ b/src/vsp.h @@ -0,0 +1,52 @@ +/* + * vsp.h extract VSP cg + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * + * @version 1.1 00/09/17 rewrite for changeing interface +*/ +/* $Id: vsp.h,v 1.1 2000/09/20 10:33:17 chikama Exp $ */ + +#ifndef __VSP__ +#define __VSP__ + +#include "portab.h" +#include "cg.h" + +typedef struct { + int vspX0; /* display location x */ + int vspY0; /* display location y */ + int vspXW; /* image width */ + int vspYW; /* image height */ + int vspPb; /* default pallet bank */ + int vspPp; /* pointer to pallet */ + int vspDp; /* pointer to pixel data */ +} vsp_header; +/* + * vspPb: + * VSP has only 16 pallets. When 256 pallets mode, this parameter determine + * where to copy these 16 pallets in 256 pallets. + * The parameter is from 0 to 15, and for example, if it is 1 then copy + * 16 palltes into pal[16] ~ pal[31]. +*/ + +extern boolean vsp_checkfmt(BYTE *data); +extern cgdata *vsp_extract(BYTE *data); +extern cgdata *vsp_getpal(BYTE *data); + +#endif /* !__VSP__ */ diff --git a/src/wavfile.c b/src/wavfile.c new file mode 100644 index 0000000..db8b904 --- /dev/null +++ b/src/wavfile.c @@ -0,0 +1,178 @@ +/* + * wavfile.c check and load .WAV file + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * Based on wavfile.c (c) Erik de Castro Lopo erikd@zip.com.au + * + * 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 + * +*/ +/* $Id: wavfile.c,v 1.16 2003/11/16 15:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "wavfile.h" +#include "LittleEndian.h" + +#define PCM_WAVE_FORMAT 0x0001 +#define IMA_ADPCM_FORMAT 0x0011 + +extern int ImaBytesPerBlock(WORD chans, WORD samplesPerBlock); +extern int ImaSamplesIn(int dataLen, WORD chans, WORD blockAlign, WORD samplesPerBlock); + +static int header_check(char *wave_buf, WAVFILE *wfile) { + char *ptr; + int l, fmt_len, extsize; + int fmt, dwAvgBytesPerSec, wBitsPerSample; + + ptr = wave_buf; + if (0 != strncmp(ptr, "RIFF", 4)) { + // don't print for ogg + //NOTICE("Cannot find RIFF file marker\n"); + return NG; + } + + l = LittleEndian_getDW(ptr, 4); + ptr += 8; + + if (0 != strncmp(ptr, "WAVE", 4)) { + WARNING("Cannot find WAV file marker\n"); + return NG; + } + + ptr += 4; + + if (0 != strncmp(ptr, "fmt ", 4)) { + WARNING("Cannot find fmt file marker\n"); + return NG; + } + + fmt_len = l = LittleEndian_getDW(ptr, 4); + if (l < 16) { + WARNING("fmt length (%d) must be >= 16\n", l); + return NG; + } + + ptr += 8; + fmt = LittleEndian_getW(ptr, 0); + wfile->ch = LittleEndian_getW(ptr, 2); + wfile->rate = LittleEndian_getDW(ptr, 4); + dwAvgBytesPerSec = LittleEndian_getDW(ptr, 8); + wfile->block_align = LittleEndian_getW(ptr, 12); + wBitsPerSample = LittleEndian_getW(ptr, 14); + + l -= 16; + + extsize = 0; + if (fmt != PCM_WAVE_FORMAT) { + if (l >= 2) { + extsize = LittleEndian_getW(ptr, 16); + l -= 2; + } else { + WARNING("Cannot find fmtext file marker\n"); + return NG; + } + } + if (extsize > l) { + WARNING("wExtSize inconsistent with wFmtLen\n"); + return NG; + } + + switch (fmt) { + case IMA_ADPCM_FORMAT: + if (extsize < 2) { + WARNING("wExtSize must >= 2 \n"); + return NG; + } + if (wBitsPerSample != 4) { + WARNING("Only handle 4bit-IMA ADPCM\n"); + return NG; + } + wfile->samples_per_block = LittleEndian_getW(ptr, 18); + wfile->bytes_per_block = ImaBytesPerBlock(wfile->ch, wfile->samples_per_block); + if (wfile->bytes_per_block > wfile->block_align || wfile->samples_per_block % 8 != 1) { + WARNING("Sample per block =%d, block align = %d\n", + wfile->samples_per_block, wfile->block_align); + return NG; + } + l -= 2; + break; + case PCM_WAVE_FORMAT: + break; + default: + WARNING("Not supported format %d\n", fmt); + return NG; + } + + ptr += fmt_len; + + // IMA ADPCM has "fact" + if (0 == strncmp(ptr, "fact", 4)) { + l = LittleEndian_getDW(ptr, 4); + ptr += (l+8); + } + + if (0 != strncmp(ptr, "data", 4)) { + WARNING("Cannot find data file marker\n"); + return NG; + } + + wfile->bytes = LittleEndian_getDW(ptr, 4); + ptr += 8; + wfile->data = ptr; + + switch (fmt) { + case IMA_ADPCM_FORMAT: + { + int num_samples; + num_samples = ImaSamplesIn(wfile->bytes, wfile->ch, wfile->block_align, wfile->samples_per_block); + wfile->samples = num_samples; + wfile->bits = 16; + wfile->type = SND_WAVE_IMAADPCM; + break; + } + case PCM_WAVE_FORMAT: + wfile->samples = wfile->bytes / wfile->block_align; + wfile->bits = wBitsPerSample; + wfile->type = SND_WAVE; + break; + } + + return OK; +} + +WAVFILE * wav_getinfo(char *data) { + WAVFILE *wfile = g_new(WAVFILE, 1); + + if (NG == header_check(data, wfile)) { + g_free(wfile); + return NULL; + } + + return wfile; +} diff --git a/src/wavfile.h b/src/wavfile.h new file mode 100644 index 0000000..12066a7 --- /dev/null +++ b/src/wavfile.h @@ -0,0 +1,59 @@ +/* + * wavfile.h + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: wavfile.h,v 1.12 2003/11/09 15:06:13 chikama Exp $ */ + +#ifndef __WAVFILE_H__ +#define __WAVFILE_H__ + +#include "portab.h" + +enum { + SND_WAVE, + SND_WAVE_IMAADPCM, + SND_MP3, + SND_OGG, + SND_PIPE, +}; + +typedef struct { + int type; + int rate; /* Hz */ + int ch; /* 1: Mono, 2: Stereo */ + int bits; /* 8: 8bit, 16: 16bit */ + int samples; /* number of samples */ + int bytes; /* total bytes (sample * bits * ch) */ + + // for IMA ADPCM + int samples_per_block; + int bytes_per_block; + int block_align; + + void *data; + + void *dfile; /* for dridata */ +} WAVFILE; + +extern WAVFILE *wav_getinfo(char *data); +extern WAVFILE *wav_mix(WAVFILE *wl, WAVFILE *wr); + +#endif /* WAVFILE_H__ */ + diff --git a/src/wavmix.c b/src/wavmix.c new file mode 100644 index 0000000..3a8db75 --- /dev/null +++ b/src/wavmix.c @@ -0,0 +1,159 @@ +/* + * wavmix.c WAV ファイルのミックス + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: wavmix.c,v 1.14 2003/04/22 16:34:28 chikama Exp $ */ + +#include +#include +#include "portab.h" +#include "audio.h" +#include "system.h" +#include "wavfile.h" + +WAVFILE *wav_mix(WAVFILE *wfileL, WAVFILE *wfileR) { + WAVFILE *wfileM; + + int rate; + int channel; + int bits; + int i; + int max_samples; + int min_samples; + + if (wfileL->rate != wfileR->rate) return NULL; + if (wfileL->ch != wfileR->ch) return NULL; + if (wfileL->bits != wfileR->bits) return NULL; + + rate = wfileL->rate; + channel = 2; + bits = wfileL->bits; + + if (wfileL->bytes > wfileR->bytes) { + max_samples = wfileL->samples; + min_samples = wfileR->samples; + } else { + max_samples = wfileR->samples; + min_samples = wfileL->samples; + } + + // printf("max = %d, min = %d\n",max_samples, min_samples); + + wfileM = (WAVFILE *)malloc(sizeof(WAVFILE)); + if (wfileM == NULL) { + NOMEMERR(); + } + + wfileM->rate = rate; + wfileM->ch = channel; + wfileM->samples = max_samples; + wfileM->bits = bits; + wfileM->bytes = max_samples * 2 * (bits/8); + wfileM->data = (char *)malloc(max_samples * 2 * (bits/8)); + + if (wfileM->data == NULL) { + NOMEMERR(); + } + + switch(bits) { + case 8: { + BYTE *srcR = wfileR->data; + BYTE *srcL = wfileL->data; + BYTE *dst = wfileM->data; + + if (channel == 1) { + for (i = 0; i < min_samples; i++) { + *(dst + i) = (*(srcL + i) + *(srcR + i)) >> 1; + } + if (min_samples == max_samples) break; + if (wfileL->samples > wfileR->samples) { + for (i = min_samples; i < max_samples; i++) { + *(dst + i) = *(srcL + i); + } + } else { + for (i = min_samples; i < max_samples; i++) { + *(dst + i) = *(srcR + i); + } + } + } else { + for (i = 0; i < min_samples; i++) { + *(dst + i * 2 ) = *(srcL + i); + *(dst + i * 2 + 1) = *(srcR + i); + } + if (min_samples == max_samples) break; + if (wfileL->samples > wfileR->samples) { + for (i = min_samples; i < max_samples; i++) { + *(dst + i * 2 ) = *(srcL + i); + *(dst + i * 2 + 1) = 0x80; + } + } else { + for (i = min_samples; i < max_samples; i++) { + *(dst + i * 2 ) = 0x80; + *(dst + i * 2 + 1) = *(srcR + i); + } + } + } + break; + } + case 16: { + WORD *srcR = (WORD *)wfileR->data; + WORD *srcL = (WORD *)wfileL->data; + WORD *dst = (WORD *)wfileM->data; + + if (channel == 1) { + for (i = 0; i < min_samples; i++) { + *(dst + i) = (*(srcL + i) + *(srcR + i)) >> 1; + } + if (min_samples == max_samples) break; + if (wfileL->samples > wfileR->samples) { + for (i = min_samples; i < max_samples; i++) { + *(dst + i) = *(srcL + i); + } + } else { + for (i = min_samples; i < max_samples; i++) { + *(dst + i) = *(srcR + i); + } + } + } else { + for (i = 0; i < min_samples; i++) { + *(dst + i * 2 ) = *(srcL + i); + *(dst + i * 2 + 1) = *(srcR + i); + } + if (min_samples == max_samples) break; + if (wfileL->samples > wfileR->samples) { + for (i = min_samples; i < max_samples; i++) { + *(dst + i * 2 ) = *(srcL + i); + *(dst + i * 2 + 1) = 0; + } + } else { + for (i = min_samples; i < max_samples; i++) { + *(dst + i * 2 ) = 0; + *(dst + i * 2 + 1) = *(srcR + i); + } + } + } + + break; + } + default: + break; + } + return wfileM; +} diff --git a/src/windowframe.h b/src/windowframe.h new file mode 100644 index 0000000..1837622 --- /dev/null +++ b/src/windowframe.h @@ -0,0 +1,50 @@ +/* + * windowframe.h message / selection window frame definition + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: windowframe.h,v 1.5 2006/04/21 16:40:48 chikama Exp $ */ + +#ifndef __WINDOWFRAME__ +#define __WINDOWFRAME__ + +#include "portab.h" + +/* 枠の種類 */ +#define WINDOW_FRAME_EMPTY 0 +#define WINDOW_FRAME_LINE 1 +#define WINDOW_FRAME_CG 2 + +/* 選択・メッセージウィンドの最大 */ +#define SELWINMAX 128 +#define MSGWINMAX 128 + +/* メッセージ・選択ウィンドの情報 */ +typedef struct { + int x; + int y; + int width; + int height; + boolean save; + void *savedimg; +} Bcom_WindowInfo; + +// extern Bcom_WindowInfo *sel_winInfo; + +#endif /* !__WINDOWFRAME__ */ diff --git a/src/xcore.h b/src/xcore.h new file mode 100644 index 0000000..fc5b1e5 --- /dev/null +++ b/src/xcore.h @@ -0,0 +1,171 @@ +/* + * xcore.h Xlibとの通信 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore.h,v 1.42 2003/04/22 16:34:28 chikama Exp $ */ + +#ifndef __XCORE_H__ +#define __XCORE_H__ + +#include "config.h" +#include +#include "portab.h" +#include "image.h" +#include "font.h" +#include "cursor.h" +#include "ags.h" + +/* 初期化関係 */ +extern int Xcore_Initilize(void); +extern void Xcore_Remove(void); + +/* ウィンド関係 */ +extern void Xcore_setWorldSize(int width, int height, int depth); +extern void Xcore_setWindowSize(int x, int y, int width, int height); +extern void Xcore_setWindowTitle(char *name); +extern void Xcore_getWindowInfo(DispInfo *info); +extern void Xcore_fullScreen(boolean on); +extern agsurface_t *Xcore_getDIB(); + +/* 画面更新 */ +extern void Xcore_updateArea(MyRectangle *src, MyPoint *dst); +extern void Xcore_sync(); + +/* パレット関係 */ +extern void Xcore_setPallet(Pallet256 *pal, int src, int cnt); +extern void Xcore_setForeground(u_long col); + +/* 描画関係 */ +extern void Xcore_drawRectangle(int x, int y, int w, int h, u_long col); +extern void Xcore_fillRectangle(int x, int y, int w, int h, u_long col); +extern void Xcore_drawLine(int x0, int y0, int x1, int y1, u_long col); +extern int Xcore_drawString(int x, int y, char *msg, u_long col); +extern void Xcore_copyArea(int sx, int sy, int w, int h, int dx, int dy); +// extern void Xcore_drawTT(int x, int y, int w, int h, const char *bitmap, int ww, boolean antialiased); +extern int Xcore_eCopyArea(int sx, int sy, int w, int h, int dx, int dy, int t,int opt, boolean flg, int spCol); +extern void Xcore_zoom(int x, int y, int w, int h); +extern void Xcore_restoreRegion(void *img, int x, int y); +extern void Xcore_delRegion(void *img); +extern void Xcore_putRegion(void *img, int x, int y); +extern void *Xcore_saveRegion(int x, int y, int w, int h); +extern void Xcore_copyRegion(void *i, int sx, int sy, int w, int h, int dx, int dy); +extern void Xcore_maskupdate(int sx, int sy, int w, int h, int dx, int dy, int func, int step); + +/* フォント関連 */ +// extern FONT *Xcore_getFontDevice(void); +extern void Xcore_setFontDevice(FONT *f); + +/* fader */ +extern void Xcore_fadeIn(int step); +extern void Xcore_fadeOut(int step); +extern void Xcore_whiteIn(int step); +extern void Xcore_whiteOut(int step); + +/* key/pointer 関係 */ +extern int Xcore_getMouseInfo(MyPoint *p); +extern int Xcore_getKeyInfo(); +extern void Xcore_setCursorLocation(int x, int y); +extern boolean Xcore_cursorNew(BYTE* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry); +extern void Xcore_setCursorType(int type); +extern int Xcore_keywait(int ms, boolean cancel); +extern void Xcore_setAutoRepeat(boolean bool); + +/* misc */ +// extern void Xcore_mainloop(int (*idle_func)(void)); +extern void Xcore_eventCallnack(); +extern void Xcore_setNoShmMode(); +extern void Xcore_mainIterarion(); +extern boolean RawKeyInfo[256]; + +/* 初期化関係 */ +#define GraphicsInitilize() Xcore_Initilize() +#define GraphicsRemove() Xcore_Remove() + +/* ウィンド関係 */ +#define GetWindowInfo(info) Xcore_getWindowInfo(info) +#define SetWorldSize(w,h,d) Xcore_setWorldSize((w),(h),(d)) +#define SetWindowSize(x,y,w,h) Xcore_setWindowSize((x),(y),(w),(h)) +#define SetWindowTitle(size) Xcore_setWindowTitle((size)) +#define GetDIB() Xcore_getDIB() + +/* 画面更新 */ +#define DspDeviceSync() Xcore_sync() +#define UpdateArea(src,dst) Xcore_updateArea((src),(dst)) +#define FullScreen(on) Xcore_fullScreen(on) + +/* パレット関係 */ +#define SetPallet(pal,src,cnt) Xcore_setPallet((pal),(src),(cnt)) +#define SetForeground(col) Xcore_setForeground((col)) + +/* 描画関係 */ +#define DrawString(x,y,str,col) Xcore_drawString((x),(y),(str),(col)) +#define FillRectangle(x,y,w,h,col) Xcore_fillRectangle((x),(y),(w),(h),(col)) +#define CopyArea(sx,sy,w,h,dx,dy) Xcore_copyArea((sx),(sy),(w),(h),(dx),(dy)) +#define CopyAreaSP(sx,sy,w,h,dx,dy,col) image_copyAreaSP(nact->ags.dib, (sx),(sy),(w),(h),(dx),(dy),(col)) +#define DrawLine(x0,y0,x1,y1,col) Xcore_drawLine((x0),(y0),(x1),(y1),(col)) +#define DrawTT(x,y,w,h,bm,ww,anti) Xcore_drawTT((x),(y),(w),(h),(bm),(ww),(anti)) +#define ScaledCopyArea(sx,sy,sw,sh,dx,dy,dw,dh,mirror_sw) image_scaledCopyArea(NULL,nact->ags.dib,sx,sy,sw,sh,dx,dy,dw,dh,mirror_sw) +#define Zoom(x,y,w,h) Xcore_zoom(x,y,w,h) +#define WrapColor(x,y,w,h,p1,p2) image_wrapColor(nact->ags.dib,x,y,w,h,p1,p2) +#define GetPixel(x,y,cell) image_getPixel(nact->ags.dib,x,y,cell) +#define DrawImage8_fromData(info,x,y,w,h) image_drawImage8_fromData(nact->ags.dib, info,x,y,w,h) +#define DrawImage16_fromData(info,x,y,w,h) image_drawImage16_fromData(nact->ags.dib, info,x,y,w,h) +#define CopyAreaSP16_shadow(sx,sy,w,h,dx,dy) image_copyAreaSP16_shadow(nact->ags.dib,sx,sy,w,h,dx,dy,255) +#define CopyAreaSP16_shadow_withRate(sx,sy,w,h,dx,dy,lv) image_copyAreaSP16_shadow(nact->ags.dib,sx,sy,w,h,dx,dy,lv) +#define CopyAreaSP16_alphaLevel(sx,sy,w,h,dx,dy,lv) image_copyAreaSP16_alphaLevel(nact->ags.dib,sx,sy,w,h,dx,dy,lv) +#define CopyAreaSP16_alphaBlend(sx,sy,w,h,dx,dy,lv) image_copyAreaSP16_alphaBlend(nact->ags.dib,sx,sy,w,h,dx,dy,lv) +#define CopyAreaSP16_whiteLevel(sx,sy,w,h,dx,dy,lv) image_copyAreaSP16_whiteLevel(nact->ags.dib,sx,sy,w,h,dx,dy,lv) +#define Copy_from_alpha(sx,sy,w,h,dx,dy,flg) image_copy_from_alpha(nact->ags.dib,sx,sy,w,h,dx,dy,flg) +#define Copy_to_alpha(sx,sy,w,h,dx,dy,flg) image_copy_to_alpha(nact->ags.dib,sx,sy,w,h,dx,dy,flg) +#define ChangeColorArea(x,y,w,h,s,d,c) Xcore_changeColorArea(x,y,w,h,s,d,c) +#define DrawRectangle(x,y,w,h,col) Xcore_drawRectangle((x),(y),(w),(h),(col)) +#define Mosaic(sx,sy,w,h,dx,dy,sl) image_Mosaic(nact->ags.dib,(sx),(sy),(w),(h),(dx),(dy),(sl)) +#define RestoreRegion(img,x,y) image_restoreRegion(nact->ags.dib,(img),(x),(y)) +#define SaveRegion(x,y,w,h) image_saveRegion(nact->ags.dib,(x),(y),(w),(h)) +#define DelRegion(i) image_delRegion(i) +#define PutRegion(i,x,y) image_putRegion(nact->ags.dib,i,x,y) +#define CopyRegion(i,sx,sy,w,h,dx,dy) image_copyRegion(i,sx,sy,w,h,nact->ags.dib,dx,dy) +#define Maskupdate(sx,sy,w,h,dx,dy,f,st) Xcore_maskupdate(sx,sy,w,h,dx,dy,f,st) + +/* フォント関連 */ +#define SetFontDevice(f) Xcore_setFontDevice(f) + +/* fader 関連 */ +#define FadeOut Xcore_fadeOut +#define FadeIn Xcore_fadeIn +#define WhiteIn Xcore_whiteIn +#define WhiteOut Xcore_whiteOut + +/* key/pointer 関係 */ +#define GetKeyInfo() Xcore_getKeyInfo() +#define SetCursorType(t) Xcore_setCursorType((t)) +#define GetMouseInfo(info) Xcore_getMouseInfo(info) +#define Keywait(r,flg) Xcore_keywait(r,flg) +#define SetCursorLocation(x,y) Xcore_setCursorLocation((x),(y)) +#define CursorNew(d,no,i,dir) Xcore_cursorNew((d),(no),(i),(dir)) +#define SetAutoRepeat(b) Xcore_setAutoRepeat(b); + +/* misc */ +// #define Mainloop(ptr) Xcore_mainloop(ptr) +#define SetNoShmMode Xcore_setNoShmMode +// #define MainIteration() Xcore_mainIteration() +#define EventCallback Xcore_eventCallback + +#endif /* !__XCORE_H__ */ diff --git a/src/xcore_cursor.c b/src/xcore_cursor.c new file mode 100644 index 0000000..f4b965e --- /dev/null +++ b/src/xcore_cursor.c @@ -0,0 +1,257 @@ +/* + * xcore_cursor.c カーソル処理 for Xcore + * + * Copyright (C) 2000- TAJIRI Yasuhiro + * + * 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 + * +*/ +/* $Id: xcore_cursor.c,v 1.8 2001/03/30 19:16:38 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "portab.h" +#include "system.h" +#include "cursor.h" +#include "xcore_private.h" + +/* マウスカーソルフォントイメージ*/ +#include "bitmaps/curbm0.xbm" +#include "bitmaps/curbm1.xbm" +#include "bitmaps/curbm2.xbm" +#include "bitmaps/curbm3.xbm" +#include "bitmaps/curbm4.xbm" +#include "bitmaps/curbm5.xbm" +#include "bitmaps/curbm6.xbm" +#include "bitmaps/maskbm0.xbm" +#include "bitmaps/maskbm1.xbm" +#include "bitmaps/maskbm2.xbm" +#include "bitmaps/maskbm3.xbm" +#include "bitmaps/maskbm4.xbm" +#include "bitmaps/maskbm5.xbm" +#include "bitmaps/maskbm6.xbm" + +static Cursor cursor[256]; +static GC cursorGC; + +/* mouse cursur の初期化 */ +void x11_init_cursor(void) { + XColor black, white; + Pixmap curPix[7], maskPix[7],tmpPixmap; + MyPoint spot[7] = {{10, 6}, {15, 15}, {14, 15}, {14, 15}, {14, 14}, {15, 15},{16,16}}; + + black.pixel = 0x00000000; + black.red = 0; + black.green = 0; + black.blue = 0; + white.pixel = 0xffffffff; + white.red = 0xffff; + white.green = 0xffff; + white.blue = 0xffff; + + curPix[0] = XCreateBitmapFromData(x11_display, x11_window, curbm0_bits, + curbm0_width, curbm0_height); + maskPix[0] = XCreateBitmapFromData(x11_display, x11_window, maskbm0_bits, + maskbm0_width, maskbm0_height); + curPix[1] = XCreateBitmapFromData(x11_display, x11_window, curbm1_bits, + curbm1_width, curbm1_height); + maskPix[1] = XCreateBitmapFromData(x11_display, x11_window, maskbm1_bits, + maskbm1_width, maskbm1_height); + curPix[2] = XCreateBitmapFromData(x11_display, x11_window, curbm2_bits, + curbm2_width, curbm2_height); + maskPix[2] = XCreateBitmapFromData(x11_display, x11_window, maskbm2_bits, + maskbm2_width, maskbm2_height); + curPix[3] = XCreateBitmapFromData(x11_display, x11_window, curbm3_bits, + curbm3_width, curbm3_height); + maskPix[3] = XCreateBitmapFromData(x11_display, x11_window, maskbm3_bits, + maskbm3_width, maskbm3_height); + curPix[4] = XCreateBitmapFromData(x11_display, x11_window, curbm4_bits, + curbm4_width, curbm4_height); + maskPix[4] = XCreateBitmapFromData(x11_display, x11_window, maskbm4_bits, + maskbm4_width, maskbm4_height); + curPix[5] = XCreateBitmapFromData(x11_display, x11_window, curbm5_bits, + curbm5_width, curbm5_height); + maskPix[5] = XCreateBitmapFromData(x11_display, x11_window, maskbm5_bits, + maskbm5_width, maskbm5_height); + curPix[6] = XCreateBitmapFromData(x11_display, x11_window, curbm6_bits, + curbm6_width, curbm6_height); + maskPix[6] = XCreateBitmapFromData(x11_display, x11_window, maskbm6_bits, + maskbm6_width, maskbm6_height); + + cursor[IDC_ARROW] = XCreatePixmapCursor(x11_display, curPix[0], maskPix[0], + &black, &white, spot[0].x, spot[0].y); + cursor[IDC_CROSS] = XCreateFontCursor(x11_display, XC_tcross); + cursor[IDC_IBEAM] = cursor[IDC_ICON] = XCreateFontCursor(x11_display, XC_icon); + cursor[IDC_NO] = XCreateFontCursor(x11_display, XC_X_cursor); + cursor[IDC_SIZE] = XCreatePixmapCursor(x11_display, curPix[6], maskPix[6], + &black, &white, spot[6].x, spot[6].y); + cursor[IDC_SIZEALL] = cursor[IDC_SIZE]; + cursor[IDC_SIZENESW] = XCreatePixmapCursor(x11_display, curPix[4], maskPix[4], + &black, &white, spot[4].x, spot[4].y); + cursor[IDC_SIZENS] = XCreatePixmapCursor(x11_display, curPix[2], maskPix[2], + &black, &white, spot[2].x, spot[2].y); + cursor[IDC_SIZENWSE] = XCreatePixmapCursor(x11_display, curPix[3], maskPix[3], + &black, &white, spot[3].x, spot[3].y); + cursor[IDC_SIZEWE] = XCreatePixmapCursor(x11_display, curPix[1], maskPix[1], + &black, &white, spot[1].x, spot[1].y); + cursor[IDC_UPARROW] = XCreateFontCursor(x11_display, XC_sb_up_arrow); +// cursor[IDC_WAIT] = XCreateFontCursor(x11_display, XC_watch); + cursor[IDC_WAIT] = XCreatePixmapCursor(x11_display, curPix[5], maskPix[5], + &black, &white, spot[5].x, spot[5].y); + + if ((tmpPixmap = XCreatePixmap(x11_display,x11_window, 1, 1, 1))) + { + cursorGC = XCreateGC( x11_display, tmpPixmap, 0, NULL ); + XSetGraphicsExposures( x11_display, cursorGC, False ); + XFreePixmap( x11_display, tmpPixmap ); + } +} + +boolean Xcore_cursorNew(BYTE* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry) { + int xormasklen, andmasklen, xornum; + int i, j, k, l; + int h = 0; + BYTE *buf1, *buf2, *buf3,*buf4; + Pixmap xorPix, andPix; + XColor bg, fg; + + bg.pixel = 0xffffff; + bg.red = cursorImage->icColors[0].rgbRed*256; + bg.green = cursorImage->icColors[0].rgbGreen*256; + bg.blue = cursorImage->icColors[0].rgbBlue*256; + fg.pixel = 0xffffff; + fg.red = cursorImage->icColors[1].rgbRed*256; + fg.green = cursorImage->icColors[1].rgbGreen*256; + fg.blue = cursorImage->icColors[1].rgbBlue*256; + + xornum = (cursordirentry->bWidth * cursordirentry->bHeight); + xormasklen = (xornum * cursorImage->icHeader.biBitCount) / 8; + NOTICE("Cursor: xormasklen==%d, xornum==%d\n", xormasklen, xornum); + + andmasklen = xornum / 8; + cursorImage->xormasklen = xormasklen; + cursorImage->andmasklen = andmasklen; + + + buf1 = g_new(BYTE, xornum); + buf2 = g_new(BYTE, xornum); + buf3 = g_new(BYTE, xornum); + buf4 = g_new(BYTE, xornum); + + memcpy(buf1, data, MIN(xormasklen, xornum)); + data += xormasklen; + + memcpy(buf2, data, MIN(andmasklen, xornum)); + data += andmasklen; + +#define height cursordirentry->bHeight +#define width cursordirentry->bWidth + + for (j = 0; j < height; j++) { + for (i = 0; i < width * cursorImage->icHeader.biBitCount /8; i++) { + k = buf1[(height-j-1)*height*cursorImage->icHeader.biBitCount/8+i]; + l = buf2[(height-j-1)*height*cursorImage->icHeader.biBitCount/8+i]; +#define SWAPBITS(x) ((x& 1)<<7|(x& 2)<<5|(x& 4)<<3|(x& 8)<<1|\ + (x&0x10)>>1|(x&0x20)>>3|(x&0x40)>>5|(x&0x80)>>7) + buf3[h] = SWAPBITS(l); + buf4[h] = SWAPBITS(k); + h++; +#undef SWAPBITS + } + } + xorPix = XCreateBitmapFromData(x11_display, x11_window, buf3, width, height); + andPix = XCreateBitmapFromData(x11_display, x11_window, buf4, width, height); + + /*ここから、XOR,ANDがたから、X用のカーソルに作りかえ*/ + /*wine-991114 windows/x11drv/mouse.cより引用 + * X11 mouse driver + * + * Copyright 1998 Ulrich Weigand + */ + { + Pixmap pixmapBits, pixmapMask, pixmapMaskInv; + pixmapBits = XCreatePixmap( x11_display, x11_window, + width, height, 1 ); + pixmapMask = XCreatePixmap( x11_display, x11_window, + width, height, 1 ); + pixmapMaskInv = XCreatePixmap( x11_display, x11_window, + width, height, 1 ); + + if (pixmapBits && pixmapMask && xorPix && andPix) + { + XSetFunction( x11_display, cursorGC, GXcopy ); + XCopyArea( x11_display, xorPix, pixmapBits, cursorGC, + 0, 0, width, height, 0, 0 ); + XCopyArea( x11_display, xorPix, pixmapMask, cursorGC, + 0, 0, width, height, 0, 0 ); + XCopyArea( x11_display, xorPix, pixmapMaskInv, cursorGC, + 0, 0, width, height, 0, 0 ); + XSetFunction( x11_display, cursorGC, GXand ); + XCopyArea( x11_display, andPix, pixmapMaskInv, cursorGC, + 0, 0, width, height, 0, 0 ); + XSetFunction( x11_display, cursorGC, GXandReverse ); + XCopyArea( x11_display, andPix, pixmapBits, cursorGC, + 0, 0, width, height, 0, 0 ); + XSetFunction( x11_display, cursorGC, GXorReverse ); + XCopyArea( x11_display, andPix, pixmapMask, cursorGC, + 0, 0, width, height, 0, 0 ); + XSetFunction( x11_display, cursorGC, GXor ); + XCopyArea( x11_display, pixmapMaskInv, pixmapMask, cursorGC, + 0, 0, width, height, 1, 1 ); + XCopyArea( x11_display, pixmapMaskInv, pixmapBits, cursorGC, + 0, 0, width, height, 1, 1 ); + XSetFunction( x11_display, cursorGC, GXcopy ); + cursor[no] = XCreatePixmapCursor(x11_display, pixmapBits, pixmapMask, + &fg, &bg, cursordirentry->wxHotspot, + cursordirentry->wyHotspot); + } + + if (xorPix) XFreePixmap( x11_display, xorPix ); + if (andPix) XFreePixmap(x11_display, andPix ); + if (pixmapBits) XFreePixmap( x11_display, pixmapBits ); + if (pixmapMask) XFreePixmap( x11_display, pixmapMask ); + if (pixmapMaskInv) XFreePixmap( x11_display, pixmapMaskInv ); + } + + g_free(buf1); + g_free(buf2); + g_free(buf3); + g_free(buf4); + +#undef height +#undef width + + return TRUE; +} + +/* マウスの位置の移動 */ +void Xcore_setCursorLocation(int x, int y) { + XWarpPointer(x11_display, x11_window, x11_window, + 0, 0, 0, 0, + x + winoffset_x, y + winoffset_y); + XFlush(x11_display); +} + +/* マウスカーソルの形状の設定 */ +void Xcore_setCursorType(int type) { + XDefineCursor(x11_display, x11_window, cursor[type]); +} diff --git a/src/xcore_draw.c b/src/xcore_draw.c new file mode 100644 index 0000000..0ea8c9a --- /dev/null +++ b/src/xcore_draw.c @@ -0,0 +1,606 @@ +/* + * xcore_draw.c X11 draw to DIB + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore_draw.c,v 1.7 2004/10/31 04:18:06 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#ifdef X_LOCALE +#include +#else +#include +#endif + +#include + +#include "portab.h" +#include "font.h" +#include "ags.h" +#include "image.h" +#include "nact.h" +#include "xcore.h" +#include "xcore_private.h" + +static void Xcore_updateAll(); +static void rect_comimg(agsurface_t *src, agsurface_t *dst, int sx, int sy, int sw, int sh); +static void workImageToWindow(); +static void DIBToWorkImage(int sx, int sy, int w, int h, int dx, int dy); + + +/* 全画面更新 */ +static void Xcore_updateAll() { + MyRectangle src; + MyPoint dst; + + src.x = view_x; + src.y = view_y; + src.width = min(DIB->width, view_w); + src.height = min(DIB->height, view_h); + dst.x = dst.y = 0; + Xcore_updateArea(&src, &dst); +} + +/* offscreenの指定領域をWindowへ転送 */ +void Xcore_updateArea(MyRectangle *src, MyPoint *dst) { + agsurface_t _dib, _work; + + if (x11_dibinfo->shared) { + XCopyArea(x11_display, x11_pixmap, x11_window, x11_gc_pix, + src->x, src->y, src->width, src->height, + winoffset_x + dst->x, winoffset_y + dst->y); + } else { + if (DIB_DEPTH == 8) { + if (WIN_DEPTH == 8) { + XPutImage(x11_display, x11_window, + x11_gc_pix, x11_dibinfo->ximg, + src->x, src->y, + winoffset_x + dst->x, winoffset_y + dst->y, + src->width, src->height); + } else { + rect_comimg(DIB, &_dib, + src->x, src->y, src->width, src->height); + rect_comimg(WORK, &_work, + dst->x, dst->y, src->width, src->height); + + image_expandPixel(&_dib, &_work, 255); + + if (x11_workinfo->shared) { + XShmPutImage(x11_display, x11_window, + x11_gc_win, x11_workinfo->ximg, + dst->x, dst->y, + winoffset_x + dst->x, winoffset_y + dst->y, + src->width, src->height, False); + } else { + XPutImage(x11_display, x11_window, + x11_gc_win, x11_workinfo->ximg, + dst->x, dst->y, + winoffset_x + dst->x, winoffset_y + dst->y, + src->width, src->height); + } + } + } else { + if (packed24bpp) { + rect_comimg(DIB, &_dib, + src->x, src->y, src->width, src->height); + rect_comimg(WORK, &_work, + dst->x, dst->y, src->width, src->height); + + image_trans_pixel_24to24p(&_dib, &_work); + + XPutImage(x11_display, x11_window, + x11_gc_win, x11_workinfo->ximg, + dst->x, dst->y, + winoffset_x + dst->x, winoffset_y + dst->y, + src->width, src->height); + } else { + XPutImage(x11_display, x11_window, + x11_gc_pix, x11_dibinfo->ximg, + src->x, src->y, + winoffset_x + dst->x, winoffset_y + dst->y, + src->width, src->height); + } + } + } + + XSync(x11_display, False); x11_needSync = False; +} + +/* draw rectangle */ +void Xcore_drawRectangle(int x, int y, int w, int h, u_long col) { + if (!x11_dibinfo->shared) { + image_drawRectangle(DIB, x, y, w, h, PAL2PIC(col)); + } else { + Xcore_setForeground(col); + XDrawRectangle(x11_display, x11_pixmap, x11_gc_pix, x, y, w - 1, h - 1); + x11_needSync = TRUE; + } +} + +/* fill rectangle */ +void Xcore_fillRectangle(int x, int y, int w, int h, u_long col) { + if (!x11_dibinfo->shared) { + image_fillRectangle(DIB, x, y, w, h, PAL2PIC(col)); + } else { + Xcore_setForeground(col); + XFillRectangle(x11_display, x11_pixmap, x11_gc_pix, x, y, w, h); + x11_needSync = TRUE; + } +} + +/* copy area */ +void Xcore_copyArea(int sx, int sy, int w, int h, int dx, int dy) { + if (!x11_dibinfo->shared) { + image_copyArea(DIB, sx, sy, w, h, dx, dy); + } else { + XCopyArea(x11_display, x11_pixmap, x11_pixmap, x11_gc_pix, + sx, sy, w, h, dx, dy); + x11_needSync = TRUE; + } +} + +/* 直線描画 */ +void Xcore_drawLine(int x1, int y1, int x2, int y2, u_long col) { + if (!x11_dibinfo->shared) { + image_drawLine(DIB, x1, y1, x2, y2, PAL2PIC(col)); + } else { + Xcore_setForeground(col); + XDrawLine(x11_display, x11_pixmap, x11_gc_pix, x1, y1, x2, y2); + x11_needSync = TRUE; + } +} + +int Xcore_drawString(int x, int y, char *msg, u_long col) { + int w; + + if (x11_font->self_drawable()) { + w = x11_font->draw_glyph(x, y, msg, col); + x11_needSync = TRUE; + } else { + agsurface_t *glyph = x11_font->get_glyph(msg); + + if (glyph == NULL) return 0; + + if (x11_font->antialiase_on && DIB_DEPTH != 8) { + if (x > 0) x -= 1; + if (y > 0) y -= 1; + image_draw_antialiased_pattern(DIB, glyph, + x, y, + glyph->width +2, glyph->height +2, + PAL2PIC(col)); + } else { + image_draw_pattern(DIB, glyph, + x, y, + glyph->width, glyph->height, + PAL2PIC(col)); + } + w = glyph->width; + } + + return w; +} + +void Xcore_zoom(int x, int y, int w, int h) { + if (DIB_DEPTH == WIN_DEPTH) { + agsurface_t _dib, _work; + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + rect_comimg(DIB, &_dib, x, y, w, h); + image_scaledCopyArea(DIB, &_work, x, y, w, h, + 0, 0, view_w, view_h, 0); + workImageToWindow(); + } else { + /* TODO */ + } +} + +/* Color の複数個指定 */ +void Xcore_setPallet(Pallet256 *pal, int src, int cnt) { + int i; + + if (x11_visual->class == PseudoColor) { + for (i = 0; i < cnt; i++) { + x11_col[src + i].pixel = src + i; + x11_col[src + i].flags = DoRed | DoGreen | DoBlue; + x11_col[src + i].red = pal->red [src + i] * 257; + x11_col[src + i].green = pal->green[src + i] * 257; + x11_col[src + i].blue = pal->blue [src + i] * 257; + } + XStoreColors(x11_display, x11_cm, &x11_col[src], cnt); + } +} + +/* foreground のセット */ +void Xcore_setForeground(u_long col) { + static u_long fc = 0; + + if (fc == col && x11_visual->class == PseudoColor) return; + + fc = col; + + if (x11_visual->class != PseudoColor) { + XSetForeground(x11_display, x11_gc_pix, PAL2PIC(col)); + } else { + XSetForeground(x11_display, x11_gc_pix, col); + } +} + +/* background のセット */ +void Xcore_setBackground(u_long col) { + static u_long bc = 0; + + if (bc == col) return; + + bc = col; + + if (x11_visual->class != PseudoColor) { + XSetBackground(x11_display, x11_gc_win, PAL2PIC(col)); + } else { + XSetBackground(x11_display, x11_gc_win, col); + } +} + +/* X-Serverとの同期を取る */ +void Xcore_sync() { + if (x11_needSync) { XSync(x11_display, False); x11_needSync = FALSE; } +} + +static void rect_comimg(agsurface_t *src, agsurface_t *dst, int sx, int sy, int sw, int sh) { + memcpy(dst, src, sizeof(agsurface_t)); + + //dst->x = sx; + //dst->y = sy; + dst->width = sw; + dst->height = sh; + dst->pixel = GETOFFSET_PIXEL(src, sx, sy); +} + +/* fader で workImage の内容をWindowに描画 */ +static void workImageToWindow() { + if (x11_workinfo->shared) { + XSync(x11_display, False); + XShmPutImage(x11_display, x11_window, + x11_gc_win, x11_workinfo->ximg, + 0, 0, + winoffset_x, winoffset_y, + view_w, view_h, False); + } else { + XPutImage(x11_display, x11_window, + x11_gc_win, x11_workinfo->ximg, + 0, 0, + winoffset_x, winoffset_y, + view_w, view_h); + } +} + +/* DIB から work image への展開 */ +static void DIBToWorkImage(int sx, int sy, int w, int h, int dx, int dy) { + if (DIB_DEPTH == dib_depth_candidate) { + int y; + BYTE *src = GETOFFSET_PIXEL(&(x11_dibinfo->cimg), sx, sy); + BYTE *dst = GETOFFSET_PIXEL(&(x11_workinfo->cimg), dx, dy); + for (y = 0; y < h; y++) { + memcpy(dst, src, w * x11_dibinfo->cimg.bytes_per_pixel); + src += x11_dibinfo->cimg.bytes_per_line; + dst += x11_workinfo->cimg.bytes_per_line; + } + } else { + agsurface_t _dib, _work; + rect_comimg(DIB, &_dib, sx, sy, w, h); + rect_comimg(WORK, &_work, dx, dy, w, h); + image_expandPixel(&_dib, &_work, 255); + } +} + +/* 指定の明度以上に明るさを設定 */ +/* (255-col)/255 * val + col */ +static void setWhiteness8(int val) { + int i; + Pallet256 *pal = nact->sys_pal; + + for (i = 0; i < 256; i++) { + x11_col[i].pixel = i; + x11_col[i].flags = DoRed | DoGreen | DoBlue; + x11_col[i].red = ((((255 - pal->red[i]) * val) / 256) + pal->red[i]) * 257; + x11_col[i].green = ((((255 - pal->green[i]) * val) / 256) + pal->green[i]) * 257; + x11_col[i].blue = ((((255 - pal->blue[i]) * val) / 256) + pal->blue[i]) * 257; + } + XStoreColors(x11_display, x11_cm, x11_col, 256); +} + +/* 指定の明度以下に明るさを抑える */ +static void setBlightness8(int val) { + int i; + Pallet256 *pal = nact->sys_pal; + + for (i =0; i < 256; i++) { + x11_col[i].pixel = i; + x11_col[i].flags = DoRed | DoGreen | DoBlue; + x11_col[i].red = (val * pal->red[i] / 255) * 257; + x11_col[i].green = (val * pal->green[i] / 255) * 257; + x11_col[i].blue = (val * pal->blue[i] / 255) * 257; + } + XStoreColors(x11_display, x11_cm, x11_col, 256); +} + +static int fadestep[256] = +{0,1,3,4,6,7,9,10,12,14,15,17,18,20,21,23,25,26,28,29,31,32,34,36,37,39,40, + 42,43,45,46,48,49,51,53,54,56,57,59,60,62,63,65,66,68,69,71,72,74,75,77,78, + 80,81,83,84,86,87,89,90,92,93,95,96,97,99,100,102,103,105,106,108,109,110, + 112,113,115,116,117,119,120,122,123,124,126,127,128,130,131,132,134,135,136, + 138,139,140,142,143,144,146,147,148,149,151,152,153,155,156,157,158,159,161, + 162,163,164,166,167,168,169,170,171,173,174,175,176,177,178,179,181,182,183, + 184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202, + 203,204,205,206,207,208,209,210,211,211,212,213,214,215,216,217,217,218,219, + 220,221,221,222,223,224,225,225,226,227,227,228,229,230,230,231,232,232,233, + 234,234,235,235,236,237,237,238,238,239,239,240,241,241,242,242,243,243,244, + 244,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,251,251, + 251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255}; + +static void fadein_8_n8(int step) { + static agsurface_t _dib, _work; + + if (step == 0) { + rect_comimg(DIB, &_dib, view_x, view_y, view_w, view_h); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + } + image_expandPixel(&_dib, &_work, fadestep[step]); + workImageToWindow(); +} + +static void fadein_n8(int step) { + static agsurface_t _dib, _work; + + if (step == 0) { + rect_comimg(DIB, &_dib, view_x, view_y, view_w, view_h); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + memset(_work.pixel, 0, x11_workinfo->cimg.bytes_per_pixel * view_w * view_h); + } + if (step == 255) { + ags_updateFull(); + return; + } + image_fadeIn(&_dib, &_work, step /16); + workImageToWindow(); +} + +static void fadeout_8_n8(int step) { + static agsurface_t _dib, _work; + + if (step == 0) { + rect_comimg(DIB, &_dib, view_x, view_y, view_w, view_h); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + } + if (step == 255) { + Xcore_setBackground(0); + XClearWindow(x11_display, x11_window); + return; + } + image_expandPixel(&_dib, &_work, fadestep[255 - step]); + workImageToWindow(); +} + +static void fadeout_n8(int step) { + static agsurface_t _work; + + if (step == 0) { + DIBToWorkImage(view_x, view_y, view_w, view_h, 0, 0); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + } + if (step == 255) { + Xcore_setBackground(0); + XClearWindow(x11_display, x11_window); + return; + } + image_fadeOut(&_work, (255-step)/16, 0); + workImageToWindow(); +} + +static void whitein_8_n8(int step) { + static agsurface_t _dib, _work; + + if (step == 0) { + rect_comimg(DIB, &_dib, view_x, view_y, view_w, view_h); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + } + image_expandPixel(&_dib, &_work, fadestep[255-step]+255); + workImageToWindow(); +} + +static void whitein_n8(int step) { + static agsurface_t _dib, _work; + + if (step == 0) { + rect_comimg(DIB, &_dib, view_x, view_y, view_w, view_h); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + } + if (step == 255) { + ags_updateFull(); + return; + } + image_fadeIn(&_dib, &_work, (255-step)/16); + workImageToWindow(); +} + +static void whiteout_8_n8(int step) { + static agsurface_t _dib, _work; + + if (step == 0) { + rect_comimg(DIB, &_dib, view_x, view_y, view_w, view_h); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + } + image_expandPixel(&_dib, &_work, fadestep[step]+255); + workImageToWindow(); +} + +static void whiteout_n8(int step) { + static agsurface_t _work; + + if (step == 0) { + DIBToWorkImage(view_x, view_y, view_w, view_h, 0, 0); + rect_comimg(WORK, &_work, 0, 0, view_w, view_h); + } + if (step == 255) { + memset(x11_workinfo->cimg.pixel, 255, x11_workinfo->cimg.bytes_per_pixel * view_w * view_h); + workImageToWindow(); + return; + } + image_fadeOut(&_work, step/16, 0xffffffff); + workImageToWindow(); +} + +void Xcore_fadeIn(int step) { + + if (step == 0) { + Xcore_sync(); + } + + if (DIB_DEPTH == 8) { + if (WIN_DEPTH == 8) { + if (step == 0) Xcore_updateAll(); + setBlightness8(fadestep[step]); + } else { + fadein_8_n8(step); + } + } else { + fadein_n8(step); + } +} + +void Xcore_fadeOut(step) { + + if (step == 0) { + Xcore_sync(); + } + + if (DIB_DEPTH == 8) { + if (WIN_DEPTH == 8) { + setBlightness8(fadestep[255-step]); + } else { + fadeout_8_n8(step); + } + } else { + fadeout_n8(step); + } +} + +void Xcore_whiteIn(int step) { + + if (step == 0) { + Xcore_sync(); + } + + if (DIB_DEPTH == 8) { + if (WIN_DEPTH == 8) { + if (step == 0) Xcore_updateAll(); + setWhiteness8(fadestep[step]); + } else { + whitein_8_n8(step); + } + } else { + whitein_n8(step); + } +} + +void Xcore_whiteOut(int step) { + + if (step == 0) { + Xcore_sync(); + } + + if (DIB_DEPTH == 8) { + if (WIN_DEPTH == 8) { + setWhiteness8(fadestep[255-step]); + } else { + whiteout_8_n8(step); + } + } else { + whiteout_n8(step); + } +} + +Pixmap x11_clip_from_DIB(int sx, int sy, int w, int h) { + agsurface_t _dib, _work; + Pixmap clippix; + + clippix = XCreatePixmap(x11_display, x11_window, w, h, WIN_DEPTH); + + if (x11_dibinfo->shared) { + XCopyArea(x11_display, x11_pixmap, clippix, x11_gc_pix, + sx, sy, w, h, 0, 0); + } else { + if (DIB_DEPTH == 8) { + if (WIN_DEPTH == 8) { + XPutImage(x11_display, clippix, + x11_gc_pix, x11_dibinfo->ximg, + sx, sy, 0, 0, w, h); + } else { + rect_comimg(DIB, &_dib, + sx, sy, w, h); + rect_comimg(WORK, &_work, + 0, 0, w, h); + + image_expandPixel(&_dib, &_work, 255); + + if (x11_workinfo->shared) { + XShmPutImage(x11_display, clippix, + x11_gc_win, x11_workinfo->ximg, + 0, 0, + 0, 0, + sx, sy, False); + } else { + XPutImage(x11_display, clippix, + x11_gc_win, x11_workinfo->ximg, + 0, 0, + 0, 0, + w, h); + } + } + } else { + if (packed24bpp) { + rect_comimg(DIB, &_dib, + sx, sy, w, h); + rect_comimg(WORK, &_work, + 0, 0, w, h); + + image_trans_pixel_24to24p(&_dib, &_work); + + XPutImage(x11_display, clippix, + x11_gc_win, x11_workinfo->ximg, + 0, 0, + 0, 0, + w, h); + } else { + XPutImage(x11_display, clippix, + x11_gc_pix, x11_dibinfo->ximg, + sx, sy, + 0, 0, + w, h); + } + } + } + + return clippix; +} diff --git a/src/xcore_event.c b/src/xcore_event.c new file mode 100644 index 0000000..e249307 --- /dev/null +++ b/src/xcore_event.c @@ -0,0 +1,259 @@ +/* + * xcore_event.c X11 event handler + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore_event.c,v 1.12 2004/10/31 04:18:06 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include "portab.h" +#include "system.h" +#include "xcore.h" +#include "xcore_private.h" +#include "nact.h" +#include "counter.h" +#include "imput.h" +#include "menu.h" +#include "joystick.h" +#include "xcore_input.c" + +static boolean xcore_getEvent(void); +static int check_button(void); + +/* pointer の状態 */ +static int mousex, mousey; + +static boolean xcore_getEvent(void) { + XEvent e; + Window root, child; + int rx, ry, wx, wy; + int mask; + boolean getkey = FALSE, msg_skip = FALSE; + + while(XPending(x11_display)) { + XNextEvent(x11_display, &e); + switch(e.type) { + case LeaveNotify: + mousex = -1; mousey = -1; // mouseb = 0; + memset(RawKeyInfo, 0, sizeof(RawKeyInfo)); + getkey = TRUE; + if (x11_fs_on) { + XUngrabPointer(x11_display, CurrentTime); + XSync(x11_display, False); + } + break; + case EnterNotify: + if (x11_fs_on) { + XGrabPointer(x11_display, x11_window, True, 0, + GrabModeAsync, GrabModeAsync, + x11_window, None, CurrentTime); + XSync(x11_display, False); + } + break; + case MotionNotify: + if (!XQueryPointer(x11_display, x11_window, &root, &child, &rx, &ry, &wx, &wy, &mask)) + break; + mousex = wx; mousey = wy; + if (nact->ags.eventcb) { + agsevent_t agse; + agse.type = AGSEVENT_MOUSE_MOTION; + agse.d1 = wx; agse.d2 = wy; agse.d3 = 0; + nact->ags.eventcb(&agse); + } + break; + +#if 0 + case ButtonPress: + mouseb |= (1 << e.xbutton.button); + getkey = TRUE; + break; + + case ButtonRelease: + mouseb &= (0xffffffff ^ (1 << e.xbutton.button)); + getkey = TRUE; + break; +#endif + case ButtonPress: + case ButtonRelease: + buttonEventProcess((XButtonEvent *)&e); + getkey = TRUE; + break; + + case Expose: { + MyRectangle src; + MyPoint dst; + XExposeEvent *ev = (XExposeEvent *)&e; + if (ev->count == 0) { + src.x = view_x + ev->x - winoffset_x; + src.y = view_y + ev->y - winoffset_y; + src.width = min(DIB->width, ev->width); + src.height = min(DIB->height, ev->height); + dst.x = ev->x - winoffset_x; + dst.y = ev->y - winoffset_y; + if (src.x > view_w || src.x < 0) break; + if (src.y > view_h || src.y < 0) break; + Xcore_updateArea(&src, &dst); + } + break; + } + + case KeyPress: + keyEventProsess((XKeyEvent *)&e); + getkey = TRUE; + break; + + case KeyRelease: { + KeySym sym; + + keyEventProsess((XKeyEvent *)&e); + sym = XKeycodeToKeysym(x11_display, e.xkey.keycode, 0); + if (sym == XK_F4) { + Xcore_fullScreen(!x11_fs_on); + } else if (sym == XK_F1) { + msg_skip = TRUE; + } + getkey = TRUE; + break; + } + + case ClientMessage: + if (e.xclient.message_type == atom_wmprot && + e.xclient.data.l[0] == atom_delwin) { + menu_quitmenu_open(); + } + break; + } + } + + if (msg_skip) set_skipMode(!get_skipMode()); + return getkey; +} + +int Xcore_keywait(int msec, boolean cancel) { + boolean bool = FALSE; + int key = 0, retval, rest = msec; + int cnt = get_high_counter(SYSTEMCOUNTER_MSEC); + + if (msec < 0) return 0; +#if 1 + while (msec > (get_high_counter(SYSTEMCOUNTER_MSEC) - cnt)) { + bool = xcore_getEvent(); + //key = check_button() | Xcore_getKeyInfo() | joy_getinfo(); + key |= check_button() | Xcore_getKeyInfo() | joy_getinfo(); + if( cancel && key ) break; + rest = msec - (get_high_counter(SYSTEMCOUNTER_MSEC) - cnt); + if (rest < 0) break; + if (rest < 10) { + usleep(1000 * rest); + } else { + usleep(10000); + } + nact->callback(); + } +#endif +#if 0 + while (rest > 0) { + struct timeval tv; + fd_set fdset; + int x11_fd = ConnectionNumber(x11_display); + + FD_ZERO(&fdset); + FD_SET(x11_fd, &fdset); + + cnt = get_high_counter(SYSTEMCOUNTER_MSEC); + tv.tv_sec = 0; + if (rest < 100) { + tv.tv_usec = rest * 1000; + } else { + tv.tv_usec = 100 * 1000; + } + retval = select(x11_fd + 1, &fdset, NULL, NULL, &tv); + if (retval > 0) { + if (FD_ISSET(x11_fd, &fdset)) { + bool = xcore_getEvent(); + } + } else if (retval < 0) { + perror("select"); + } + if (bool) { + key |= (check_button() | Xcore_getKeyInfo()); + if (cancel) break; + } + rest -= (get_high_counter(SYSTEMCOUNTER_MSEC) - cnt); + nact->callback(); + } +#endif + return key; +} + +/* キー情報の取得 */ +int Xcore_getKeyInfo() { + xcore_getEvent(); + + return ((RawKeyInfo[KEY_UP] || RawKeyInfo[KEY_PAD_8]) | + ((RawKeyInfo[KEY_DOWN] || RawKeyInfo[KEY_PAD_2]) << 1) | + ((RawKeyInfo[KEY_LEFT] || RawKeyInfo[KEY_PAD_4]) << 2) | + ((RawKeyInfo[KEY_RIGHT] || RawKeyInfo[KEY_PAD_6]) << 3) | + (RawKeyInfo[KEY_ENTER] << 4) | + (RawKeyInfo[KEY_SPACE] << 5) | + (RawKeyInfo[KEY_ESC] << 6) | + (RawKeyInfo[KEY_TAB] << 7)); +} + +/* mouse 情報の取得 */ +int Xcore_getMouseInfo(MyPoint *p) { + xcore_getEvent(); + + if (mousex < 0) { + if (p) { + p->x=0; p->y=0; + } + return 0; + } + + if (p) { + p->x = mousex - winoffset_x; + p->y = mousey - winoffset_y; + } + return check_button(); +} + +/* mouse のボタン状態の取得 */ +static int check_button(void) { + int m1, m2; + + if (RawKeyInfo[KEY_MOUSE_MIDDLE]) { + menu_open(); + } else { + m1 = RawKeyInfo[KEY_MOUSE_LEFT] ? SYS35KEY_RET : 0; + m2 = RawKeyInfo[KEY_MOUSE_RIGHT] ? SYS35KEY_SPC : 0; + return m1|m2; + } + return 0; +} diff --git a/src/xcore_input.c b/src/xcore_input.c new file mode 100644 index 0000000..53a059c --- /dev/null +++ b/src/xcore_input.c @@ -0,0 +1,354 @@ +/* + * xcore_input.c キー入力処理 + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore_input.c,v 1.13 2003/04/25 17:23:55 chikama Exp $ */ + +#include "key.h" +#include +#include "ags.h" + + +boolean RawKeyInfo[256]; +static int convertKeyCode(unsigned int keycode); +static void keyEventProsess(XKeyEvent *e); +static void buttonEventProcess(XButtonEvent *e); + + +static void keyEventProsess(XKeyEvent *e) { + agsevent_t agse; + boolean bool; + int code = convertKeyCode(e->keycode); + + if (e->type == KeyPress) { + bool = TRUE; + agse.type = AGSEVENT_KEY_PRESS; + } else { + bool = FALSE; + agse.type = AGSEVENT_KEY_RELEASE; + } + + RawKeyInfo[code] = bool; + + if (nact->ags.eventcb) { + agse.d1 = e->x; + agse.d2 = e->y; + agse.d3 = code; + nact->ags.eventcb(&agse); + } +} + +static void buttonEventProcess(XButtonEvent *e) { + agsevent_t agse; + boolean bool; + + if (e->type == ButtonPress) { + bool = TRUE; + agse.type = AGSEVENT_BUTTON_PRESS; + } else { + bool = FALSE; + agse.type = AGSEVENT_BUTTON_RELEASE; + } + + switch(e->button) { + case Button1: + RawKeyInfo[KEY_MOUSE_LEFT] = bool; + agse.d3 = AGSEVENT_BUTTON_LEFT; + break; + case Button2: + RawKeyInfo[KEY_MOUSE_MIDDLE] = bool; + agse.d3 = AGSEVENT_BUTTON_MID; + break; + case Button3: + RawKeyInfo[KEY_MOUSE_RIGHT] = bool; + agse.d3 = AGSEVENT_BUTTON_RIGHT; + break; + case Button4: + agse.d3 = AGSEVENT_WHEEL_UP; + break; + case Button5: + agse.d3 = AGSEVENT_WHEEL_DN; + break; + default: + break; + } + + if (nact->ags.eventcb) { + agse.d1 = e->x; + agse.d2 = e->y; + nact->ags.eventcb(&agse); + } +} + +static int convertKeyCode(unsigned int keycode) { + KeySym sym = XKeycodeToKeysym(x11_display, keycode, 0); + switch(sym) { + case XK_BackSpace: + return KEY_BS; + case XK_Tab: + return KEY_TAB; + case XK_Clear: + return KEY_CLEAR; + case XK_Return: + case XK_KP_Enter: + return KEY_ENTER; + case XK_Shift_L: + case XK_Shift_R: + return KEY_SHIFT; + case XK_Control_L: + case XK_Control_R: + return KEY_CTRL; + case XK_Alt_L: + case XK_Alt_R: + return KEY_ALT; + case XK_Pause: + return KEY_PAUSE; + case XK_Caps_Lock: + return KEY_CAPSLOCK; + case XK_Kanji: + return KEY_KANAKAN; + case XK_Escape : + return KEY_ESC; + case XK_space: + return KEY_SPACE; + case XK_Page_Up: + return KEY_PAGEUP; + case XK_Page_Down: + return KEY_PAGEDOWN; + case XK_End: + return KEY_END; + case XK_Home: + return KEY_HOME; + case XK_Left: + return KEY_LEFT; + case XK_Up: + return KEY_UP; + case XK_Right: + return KEY_RIGHT; + case XK_Down: + return KEY_DOWN; + case XK_Select: + return KEY_SELECT; + case XK_Execute: + return KEY_EXECUTE; + case XK_Print: + return KEY_PRINTSCREEN; + case XK_Insert: + return KEY_INS; + case XK_Delete: + return KEY_DEL; + case XK_Help: + return KEY_HELP; + case XK_0: + return KEY_0; + case XK_1: + return KEY_1; + case XK_2: + return KEY_2; + case XK_3: + return KEY_3; + case XK_4: + return KEY_4; + case XK_5: + return KEY_5; + case XK_6: + return KEY_6; + case XK_7: + return KEY_7; + case XK_8: + return KEY_8; + case XK_9: + return KEY_9; + case XK_a: + case XK_A: + return KEY_A; + case XK_b: + case XK_B: + return KEY_B; + case XK_c: + case XK_C: + return KEY_C; + case XK_d: + case XK_D: + return KEY_D; + case XK_e: + case XK_E: + return KEY_E; + case XK_f: + case XK_F: + return KEY_F; + case XK_g: + case XK_G: + return KEY_G; + case XK_h: + case XK_H: + return KEY_H; + case XK_i: + case XK_I: + return KEY_I; + case XK_j: + case XK_J: + return KEY_J; + case XK_k: + case XK_K: + return KEY_K; + case XK_l: + case XK_L: + return KEY_L; + case XK_m: + case XK_M: + return KEY_M; + case XK_n: + case XK_N: + return KEY_N; + case XK_o: + case XK_O: + return KEY_O; + case XK_p: + case XK_P: + return KEY_P; + case XK_q: + case XK_Q: + return KEY_Q; + case XK_r: + case XK_R: + return KEY_R; + case XK_s: + case XK_S: + return KEY_S; + case XK_t: + case XK_T: + return KEY_T; + case XK_u: + case XK_U: + return KEY_U; + case XK_v: + case XK_V: + return KEY_V; + case XK_w: + case XK_W: + return KEY_W; + case XK_x: + case XK_X: + return KEY_X; + case XK_y: + case XK_Y: + return KEY_Y; + case XK_z: + case XK_Z: + return KEY_Z; + case XK_KP_Insert: + case XK_KP_0: + return KEY_PAD_0; + case XK_KP_End: + case XK_KP_1: + return KEY_PAD_1; + case XK_KP_Down: + case XK_KP_2: + return KEY_PAD_2; + case XK_KP_Page_Down: + case XK_KP_3: + return KEY_PAD_3; + case XK_KP_Left: + case XK_KP_4: + return KEY_PAD_4; + case XK_KP_5: + return KEY_PAD_5; + case XK_KP_Right: + case XK_KP_6: + return KEY_PAD_6; + case XK_KP_Home: + case XK_KP_7: + return KEY_PAD_7; + case XK_KP_Up: + case XK_KP_8: + return KEY_PAD_8; + case XK_KP_Page_Up: + case XK_KP_9: + return KEY_PAD_9; + case XK_KP_Multiply: + return KEY_PAD_STAR; + case XK_KP_Add: + return KEY_PAD_PLUS; + case XK_KP_Separator: + return KEY_PAD_SEP; + case XK_KP_Subtract: + return KEY_PAD_MINUS; + case XK_KP_Delete: + return KEY_PAD_DOT; + case XK_KP_Divide: + return KEY_PAD_SLASH; + case XK_F1: + return KEY_F1; + case XK_F2: + return KEY_F2; + case XK_F3: + return KEY_F3; + case XK_F4: + return KEY_F4; + case XK_F5: + return KEY_F5; + case XK_F6: + return KEY_F6; + case XK_F7: + return KEY_F7; + case XK_F8: + return KEY_F8; + case XK_F9: + return KEY_F9; + case XK_F10: + return KEY_F10; + case XK_F11: + return KEY_F11; + case XK_F12: + return KEY_F12; + case XK_F13: + return KEY_F13; + case XK_F14: + return KEY_F14; + case XK_F15: + return KEY_F15; + case XK_F16: + return KEY_F16; + case XK_F17: + return KEY_F17; + case XK_F18: + return KEY_F18; + case XK_F19: + return KEY_F19; + case XK_F20: + return KEY_F20; + case XK_F21: + return KEY_F21; + case XK_F22: + return KEY_F22; + case XK_F23: + return KEY_F23; + case XK_F24: + return KEY_F24; + case XK_Num_Lock: + return KEY_NUMLOCK; + case XK_Scroll_Lock: + return KEY_SCROLL_LOCK; + default: + return KEY_UNDEFINED; + } + return KEY_UNDEFINED; +} diff --git a/src/xcore_maskupdate.c b/src/xcore_maskupdate.c new file mode 100644 index 0000000..3f55acc --- /dev/null +++ b/src/xcore_maskupdate.c @@ -0,0 +1,372 @@ +/* + * xcore_maskupdate.c X11 mask 付き update + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore_maskupdate.c,v 1.4 2002/05/02 17:21:32 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "portab.h" +#include "xcore_private.h" + +static Pixmap maskpix; /* clipmask 用 Bitmap */ +static Pixmap clippix; /* copy 元 Pixmap */ +static Pixmap savepix; /* copy 先 Pixmap */ +static Pixmap doublepix;/* double buffer 用 Pixmap */ +static GC maskgc; /* clipmask Bitmap 用 GC */ + +static void draw_5star(double mul, double rad, int off_x, int off_y); +static void draw_6star(double mul, double rad, int off_x, int off_y); +static void draw_windwheel_90(double rad, int r, int off_x, int off_y); +static void draw_windwheel_180(double rad, int r, int off_x, int off_y); +static void draw_windwheel_360(double rad, int r, int off_x, int off_y); + +/* + * 五芒星を描く + * mul : 倍率 (1 で 100 * 100) の星が描かれる + * rad : 回転角度(radian) + * off_x: 中心座標の x 方向 offset + * off_y: 中心座標の y 方向 offset + */ +static void draw_5star(double mul, double rad, int off_x, int off_y) { + static XPoint pt[] = { + { 0, -50}, + {-29, 40}, + { 47, -15}, + {-47, -15}, + { 29, 40} + }; + XPoint p[5]; + int i; + + /* + * x' cos(X) -sin(X) mul 0 x + * = * * + * y' sin(X) cos(X) 0 mul y + */ + for (i = 0; i < 5; i++) { + p[i].x = mul * (pt[i].x * cos(rad) - pt[i].y * sin(rad)) + off_x; + p[i].y = mul * (pt[i].x * sin(rad) + pt[i].y * cos(rad)) + off_y; + } + + XFillPolygon(x11_display, maskpix, maskgc, p, 5, Complex, CoordModeOrigin); +} + +/* + * 六芒星を描く + * mul : 倍率 (1 で 100 * 100) の星が描かれる + * rad : 回転角度(radian) + * off_x: 中心座標の x 方向 offset + * off_y: 中心座標の y 方向 offset + */ +static void draw_6star(double mul, double rad, int off_x, int off_y) { + static XPoint pt1[] = { + { 0, -50}, + {-43, 25}, + { 43, 25} + }; + static XPoint pt2[] = { + {-43, -25}, + { 0, 50}, + { 43, -25} + }; + XPoint p[3]; + int i; + + for (i = 0; i < 3; i++) { + p[i].x = mul * (pt1[i].x * cos(rad) - pt1[i].y * sin(rad)) + off_x; + p[i].y = mul * (pt1[i].x * sin(rad) + pt1[i].y * cos(rad)) + off_y; + } + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); + + for (i = 0; i < 3; i++) { + p[i].x = mul * (pt2[i].x * cos(rad) - pt2[i].y * sin(rad)) + off_x; + p[i].y = mul * (pt2[i].x * sin(rad) + pt2[i].y * cos(rad)) + off_y; + } + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); +} + +/* + * 扇型の中心角 (てきとー) + * 0.2 radian + */ +#define WHEELDELTA 0.2 + +/* + * 風車90° + * rad : 回転角 (radian) 0 - pi/2 + * r : 半径 + * off_x: 中心座標の x 方向 offset + * off_y: 中心座標の y 方向 offset + */ +static void draw_windwheel_90(double rad, int r, int off_x, int off_y) { + XPoint p[3]; + + p[0].x = 0 + off_x; + p[0].y = 0 + off_y; + + p[1].x = r * sin(rad) + off_x; + p[1].y = -r * cos(rad) + off_y; + + p[2].x = r * sin(rad + WHEELDELTA) + off_x; + p[2].y = -r * cos(rad + WHEELDELTA) + off_y; + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); + + p[1].x = r * cos(rad) + off_x; + p[1].y = r * sin(rad) + off_y; + + p[2].x = r * cos(rad + WHEELDELTA) + off_x; + p[2].y = r * sin(rad + WHEELDELTA) + off_y; + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); + + p[1].x = -r * sin(rad) + off_x; + p[1].y = r * cos(rad) + off_y; + + p[2].x = -r * sin(rad + WHEELDELTA) + off_x; + p[2].y = r * cos(rad + WHEELDELTA) + off_y; + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); + p[1].x = -r * cos(rad) + off_x; + p[1].y = -r * sin(rad) + off_y; + + p[2].x = -r * cos(rad + WHEELDELTA) + off_x; + p[2].y = -r * sin(rad + WHEELDELTA) + off_y; + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); +} + +/* + * 風車180° + * rad : 回転角 (radian) 0 - pi + * r : 半径 + * off_x: 中心座標の x 方向 offset + * off_y: 中心座標の y 方向 offset + */ +static void draw_windwheel_180(double rad, int r, int off_x, int off_y) { + XPoint p[3]; + + p[0].x = 0 + off_x; + p[0].y = 0 + off_y; + + + p[1].x = -r * cos(rad) + off_x; + p[1].y = -r * sin(rad) + off_y; + + p[2].x = -r * cos(rad + WHEELDELTA) + off_x; + p[2].y = -r * sin(rad + WHEELDELTA) + off_y; + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); + + p[1].x = r * cos(rad) + off_x; + p[1].y = r * sin(rad) + off_y; + + p[2].x = r * cos(rad + WHEELDELTA) + off_x; + p[2].y = r * sin(rad + WHEELDELTA) + off_y; + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); +} + +/* + * 風車180° + * rad : 回転角 (radian) 0 - 2pi + * r : 半径 + * off_x: 中心座標の x 方向 offset + * off_y: 中心座標の y 方向 offset + */ +static void draw_windwheel_360(double rad, int r, int off_x, int off_y) { + XPoint p[3]; + + p[0].x = 0 + off_x; + p[0].y = 0 + off_y; + + p[1].x = -r * cos(rad) + off_x; + p[1].y = -r * sin(rad) + off_y; + + p[2].x = -r * cos(rad + WHEELDELTA) + off_x; + p[2].y = -r * sin(rad + WHEELDELTA) + off_y; + + XFillPolygon(x11_display, maskpix, maskgc, p, 3, Convex, CoordModeOrigin); + +} + +/* + * マスク付き領域更新 + * sx: コピー元 x 座標 + * sy: コピー元 y 座標 + * w : コピー元 width + * h : コピー元 height + * dx: コピー先 x 座標 + * dy: コピー先 y 座標 + * func: マスク種類 + * 44: 五芒星(内->外) + * 45: 五芒星(外->内) + * 46: 六芒星(内->外) + * 47: 六芒星(外->内) + * 50: 風車90° + * 51: 風車180° + * 52: 風車360° + * step: 呼び出し番号 0 - 256 + */ +void Xcore_maskupdate(int sx, int sy, int w, int h, int dx, int dy, int func, int step) { + GC gc; + + dx -= view_x; + dy -= view_y; + + if (step == 0) { + /* 最初にいろいろと準備 */ + XSync(x11_display, False); + /* コピー元を DIB から pixmap に持って来る */ + clippix = x11_clip_from_DIB(sx, sy, w, h); + + /* clip mask 用 Pixmap の生成 */ + maskpix = XCreatePixmap(x11_display, x11_window, w, h, 1); + maskgc = XCreateGC(x11_display, maskpix, None, NULL); + + /* clipmask 用 Pixmap の初期化 */ + XSetForeground(x11_display, maskgc, 0); + XFillRectangle(x11_display, maskpix, maskgc, 0, 0, w, h); + + /* 線が交差するときの塗りつぶしのルールを設定 */ + XSetFillRule(x11_display, maskgc, WindingRule); + + /* 更新先の Window の領域を保存 */ + savepix = XCreatePixmap(x11_display, x11_window, w, h, WIN_DEPTH); + XCopyArea(x11_display, x11_window, savepix, x11_gc_pix, + winoffset_x + dx, winoffset_y + dy, w, h, 0, 0); + + /* ダブルバッファ用に Pixmap を確保 */ + doublepix = XCreatePixmap(x11_display, x11_window, w, h, WIN_DEPTH); + XCopyArea(x11_display, x11_window, doublepix, x11_gc_pix, + winoffset_x + dx, winoffset_y + dy, w, h, 0, 0); + + XSync(x11_display, False); + return; + } else if (step == 256) { + /* 最後に後始末 */ +#if 0 + XCopyArea(x11_display, clippix, x11_window, x11_gc_pix, + 0, 0, w, h, winoffset_x + dx, winoffset_y + dy); +#endif +#if 0 + XCopyArea(x11_display, clippix, x11_pixmap, x11_gc_pix, + 0, 0, w, h, winoffset_x + dx, winoffset_y + dy); + ags_updateFull(); +#endif + ags_copyArea(sx, sy, w, h, dx + view_x, dy + view_y); + ags_updateArea(dx + view_x, dy + view_y, w, h); + XFreePixmap(x11_display, maskpix); + + XFreePixmap(x11_display, clippix); + XFreePixmap(x11_display, savepix); + XFreePixmap(x11_display, doublepix); + XFreeGC(x11_display, maskgc); + + return; + } + + /* clipmask 用の GC を生成 (毎回生成しなくても良いかも?) */ + gc = XCreateGC(x11_display, clippix, None, NULL); + XSetClipMask(x11_display, gc, maskpix); + XSetClipOrigin(x11_display, gc, 0, 0); + + switch(func) { + case 44: + case 46: + /* 内から外へ */ + XSetForeground(x11_display, maskgc, 0); + XFillRectangle(x11_display, maskpix, maskgc, 0, 0, w, h); + XSetForeground(x11_display, maskgc, 1); + break; + case 45: + case 47: + /* 外から内へ */ + XSetForeground(x11_display, maskgc, 1); + XFillRectangle(x11_display, maskpix, maskgc, 0, 0, w, h); + XSetForeground(x11_display, maskgc, 0); + break; + default: + XSetForeground(x11_display, maskgc, 1); + } + + /* mask を描画 */ + switch(func) { + case 44: + draw_5star(1.5 * (max(w,h) * step) / (256 * 50.0), + 1.0 * M_PI * step / 256, w/2, h/2); + break; + + case 45: + draw_5star(1.5 * (max(w,h) * (256-step)) / (256 * 50.0), + 1.0 * M_PI * step / 256, w/2, h/2); + break; + + case 46: + draw_6star((max(w,h) * step) / (256 * 50.0), + 1.0 * M_PI * step / 256, w/2, h/2); + break; + + case 47: + draw_6star((max(w,h) * (256-step)) / (256 * 50.0), + 1.0 * M_PI * step / 256, w/2, h/2); + break; + + case 50: + draw_windwheel_90(0.5 * M_PI * step / 256, sqrt(w*w+h*h)/2, + w/2, h/2); + break; + case 51: + draw_windwheel_180(1.0 * M_PI * step / 256, sqrt(w*w+h*h)/2, + w/2, h/2); + break; + case 52: + draw_windwheel_360(2.0 * M_PI * step / 256, sqrt(w*w+h*h)/2, + w/2, h/2); + break; + } + + /* double buffer へ 保存した window の内容をコピー */ + XCopyArea(x11_display, savepix, doublepix, x11_gc_win, + 0, 0, w, h, 0, 0); + + /* コピー元の内容を mask付きで double buffer へコピー */ + XCopyArea(x11_display, clippix, doublepix, gc, + 0, 0, w, h, 0, 0); + + /* double buffer から window へコピー */ + XCopyArea(x11_display, doublepix, x11_window, x11_gc_win, + 0, 0, w, h, winoffset_x + dx, winoffset_y + dy); + + /* 同期 */ + XSync(x11_display, False); + + /* clipmask 用 gc の破棄 */ + XFreeGC(x11_display, gc); +} diff --git a/src/xcore_mode.c b/src/xcore_mode.c new file mode 100644 index 0000000..486b6f2 --- /dev/null +++ b/src/xcore_mode.c @@ -0,0 +1,187 @@ +/* + * xcore_mode.c X11 video mode and full-screen + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore_mode.c,v 1.7 2003/01/31 12:58:28 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include + +#ifdef HAVE_XF86VMODE +# include +# include +#endif + +#include "portab.h" +#include "system.h" +#include "xcore.h" +#include "xcore_private.h" + +#ifdef HAVE_XF86VMODE +static int vm_count; +static XF86VidModeModeInfo **vm_modelines; +#endif +static boolean have_vm; + +void x11_vm_init(void) { +#ifdef HAVE_XF86VMODE + int foo, bar, i, ma, mi; + + if (XF86VidModeQueryExtension(x11_display, &foo, &bar)) { + XF86VidModeQueryVersion(x11_display, &ma, &mi); + + NOTICE("VidMode version %d.%d\n", ma, mi); + have_vm = TRUE; + + XF86VidModeGetAllModeLines(x11_display, XDefaultScreen(x11_display), + &vm_count, &vm_modelines); + NOTICE(" available video mode(s):"); + for (i = 0; i < vm_count; i++) { + NOTICE(" %dx%d", + vm_modelines[i]->hdisplay, vm_modelines[i]->vdisplay); + } + fprintf(stderr,"\n"); + } +#endif +} + +void x11_vm_exit() { +#ifdef HAVE_XF86VMODE + if (x11_fs_on) { + XF86VidModeSwitchToMode(x11_display, XDefaultScreen(x11_display), + vm_modelines[0]); + } +#endif + +} + +static int search_preferable_fullscreen_mode() { +#ifdef HAVE_XF86VMODE + int i, vm = 0, delta = INT_MAX; + + /* すべてのmodeのなかで最も適切なモードを選択 */ + for (i = 0; i < vm_count; i++) { + if (vm_modelines[i]->hdisplay >= view_w && + vm_modelines[i]->vdisplay >= view_y) { + int deltaw = vm_modelines[i]->hdisplay - view_w; + int deltah = vm_modelines[i]->vdisplay - view_h; + if (delta > (deltaw + deltah)) { + vm = i; + delta = deltaw + deltah; + } + } + } + return vm; +#else + return 0; +#endif + +} + +static void set_vidmode(int mode) { +#ifdef HAVE_XF86VMODE + XF86VidModeSwitchToMode(x11_display, DefaultScreen(x11_display), vm_modelines[mode]); +#endif +} + +/* Fullscreen 移行前の Window の座標 */ +static int winsave_x, winsave_y; + +static void enter_fullscreen() { +#ifdef HAVE_XF86VMODE + int w, h, b, d; + Window root; + + XGetGeometry(x11_display, x11_window, &root, &winsave_x, &winsave_y, + &w, &h, &b, &d); + Xcore_setWindowSize(view_x, view_y, view_w, view_h); + XSync(x11_display, False); +#endif +} + +static void quit_fullscreen() { +#ifdef HAVE_XF86VMODE + XF86VidModeSwitchToMode(x11_display, DefaultScreen(x11_display), vm_modelines[0]); + XUngrabPointer(x11_display, CurrentTime); + XMoveWindow(x11_display, x11_window, winsave_x, winsave_y); + XSync(x11_display, False); +#endif +} + +void Xcore_fullScreen(boolean on) { + if (!have_vm) return; + +#if HAVE_XF86VMODE + if (on && !x11_fs_on) { + x11_fs_on = TRUE; + enter_fullscreen(); + } else if (!on && x11_fs_on) { + quit_fullscreen(); + x11_fs_on = FALSE; + } + XSync(x11_display, False); +#endif +} + +/* Windowの大きさの変更 */ +void Xcore_setWindowSize(int x, int y, int width, int height) { + + view_x = x; + view_y = y; + + if (width == view_w && height == view_h && !x11_fs_on) return; + + view_w = width; + view_h = height; + +#ifdef HAVE_XF86VMODE + if (x11_fs_on) { + int mode = search_preferable_fullscreen_mode(); + NOTICE("width = %d, height = %d\n", + vm_modelines[mode]->hdisplay, + vm_modelines[mode]->vdisplay); + if (vm_modelines[mode]->hdisplay != view_w || + vm_modelines[mode]->vdisplay != view_h) { + winoffset_x = (vm_modelines[mode]->hdisplay - view_w)/2; + winoffset_y = (vm_modelines[mode]->vdisplay - view_h)/2; + width = vm_modelines[mode]->hdisplay; + height = vm_modelines[mode]->vdisplay; + XClearWindow(x11_display, x11_window); + } else { + winoffset_x = winoffset_y = 0; + } + XMoveWindow(x11_display, x11_window, 0, 0); + set_vidmode(mode); + XF86VidModeSetViewPort(x11_display, XDefaultScreen(x11_display), 0, 0); + + XGrabPointer(x11_display, x11_window, True, 0, + GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime); + XSync(x11_display, False); + } +#endif + + XResizeWindow(x11_display, x11_window, width, height); + x11_makeWorkImage(width, height); + XFlush(x11_display); +} diff --git a/src/xcore_private.h b/src/xcore_private.h new file mode 100644 index 0000000..4a80841 --- /dev/null +++ b/src/xcore_private.h @@ -0,0 +1,135 @@ +/* + * xcore_private.c X11 only private data + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore_private.h,v 1.5 2003/06/29 15:28:12 chikama Exp $ */ + +#ifndef __XCORE_PRIVATE_H__ +#define __XCORE_PRIVATE_H__ + +#include "config.h" + +#include +#include +#include + +#include "portab.h" +#include "font.h" +#include "ags.h" +#include "image.h" + +/* dib/work image 情報 */ +typedef struct { + XImage *ximg; /* XImage/ShmXImage 使用時の XImage */ + XShmSegmentInfo info; /* Shared Pixmap info */ + boolean shared; /* is Shared Pixmap ? */ + agsurface_t cimg; /* Common Image for image manupilate */ +} IMAGEINFO; + +struct xcore_private_data { + boolean local_X11; /* flag: TRUE if local display */ + Display *dsp; /* Used for event and window management */ + Visual *vis; /* Vidusl of Current Window */ + + Window win; /* Main Window */ + int win_depth; /* Main Window Depth */ + int winoffset_x; /* draw offset in Window x */ + int winoffset_y; /* y */ + + Atom atom_wmprot; /* window manager protocol atom */ + Atom atom_delwin; /* close-window protocol atom */ + + GC gc_win; /* The Graphics context for drawing to Window */ + + GC gc_pix; /* The Graphics context for drawing to Pixmap */ + Pixmap pix; /* Pixmap for offscreen image */ + + int dib_depth_candidate; /* DIB depth if required pixmap depth isnt 8 */ + + FONT *fontinfo; /* font object */ + + boolean noSHM; /* dont have X-SHM extension */ + + boolean packed24bpp; /* window is packed 24 bpp? */ + + /* SharedPixmapを使用中にXの描画が入った場合 XSyncを発行するためのフラグ */ + boolean needSync; + + boolean fullscreen; /* FullScreen Mode である */ + + IMAGEINFO *dib; /* DIB? information */ + int view_x; + int view_y; + int view_width; + int view_height; + + IMAGEINFO *work; + + XColor col[256]; /* pallet and color map */ + Colormap cm; +}; + +extern void x11_init_cursor(void); +extern void x11_makeWorkImage(int w, int h); +extern void x11_vm_init(void); +extern void x11_vm_exit(void); +extern Pixmap x11_clip_from_DIB(int sx, int sy, int w, int h); + + +extern struct xcore_private_data *x11_videodev; + +#define local_X11 (x11_videodev->local_X11) +#define x11_display (x11_videodev->dsp) +#define x11_visual (x11_videodev->vis) +#define x11_window (x11_videodev->win) +#define winoffset_x (x11_videodev->winoffset_x) +#define winoffset_y (x11_videodev->winoffset_y) +#define atom_delwin (x11_videodev->atom_delwin) +#define atom_wmprot (x11_videodev->atom_wmprot) +#define x11_gc_win (x11_videodev->gc_win) +#define x11_gc_pix (x11_videodev->gc_pix) +#define x11_pixmap (x11_videodev->pix) +#define dib_depth_candidate (x11_videodev->dib_depth_candidate) +#define x11_font (x11_videodev->fontinfo) +#define x11_noSHM (x11_videodev->noSHM) +#define packed24bpp (x11_videodev->packed24bpp) +#define x11_needSync (x11_videodev->needSync) +#define x11_dibinfo (x11_videodev->dib) +#define x11_workinfo (x11_videodev->work) +#define view_x (x11_videodev->view_x) +#define view_y (x11_videodev->view_y) +#define view_w (x11_videodev->view_width) +#define view_h (x11_videodev->view_height) +#define x11_cm (x11_videodev->cm) +#define x11_col (x11_videodev->col) +#define x11_fs_on (x11_videodev->fullscreen) +#define DRAW_BY_X (!x11_dibinfo->shared) +#define DIB (&(x11_dibinfo->cimg)) +#define DIB_DEPTH (x11_dibinfo->cimg.depth) +#define WIN_DEPTH (x11_videodev->win_depth) + +#define WORK (&(x11_workinfo->cimg)) + +// #define WROK_DEPTH (x11_workinfo->cimg.depth) + +#define PAL2PIC(i) image_index2pixel(DIB_DEPTH, i) + + +#endif /* __XCORE_PRIVATE_H__ */ diff --git a/src/xcore_video.c b/src/xcore_video.c new file mode 100644 index 0000000..a418a03 --- /dev/null +++ b/src/xcore_video.c @@ -0,0 +1,528 @@ +/* + * xcore_video.c X11 video init + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xcore_video.c,v 1.15 2003/06/29 15:28:12 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef X_LOCALE +#include +#else +#include +#endif + +#include + +#include "portab.h" +#include "system.h" +#include "font.h" +#include "joystick.h" +#include "xsystem35.h" +#include "xcore.h" +#include "xcore_private.h" + +static void check_SHMext(void); +static void check_packed24bpp(void); +static void init_window(void); +static void init_offscreen(void); +static void releaseDIB(void); +static void makeNonShmXImage(IMAGEINFO *simg, int w, int h, int depth); +static boolean makeShmXImage(IMAGEINFO *simg, int w, int h, int depth); +static void releaseNonShmXImage(IMAGEINFO *simg); +static void releaseShmXImage(IMAGEINFO *simg); +static void makeDIB(int w, int h, int depth); +static void releaseWorkImage(); + + +struct xcore_private_data *x11_videodev; +static boolean noshm; + +/* init/remove */ + +int Xcore_Initilize(void) { + char *display; + + x11_videodev = g_new0(struct xcore_private_data, 1); + x11_noSHM = noshm; + + /* locale init ( for no gtk option ) */ + if (setlocale(LC_ALL,"") == NULL) { + if (setlocale(LC_ALL, "C") == NULL) { + SYSERROR("locale not supported\n"); + } + } + + + /* Open the X11 display */ + display = NULL; /* Get it from DISPLAY environment variable */ + + if ((strncmp(XDisplayName(display), ":", 1) == 0) || + (strncmp(XDisplayName(display), "unix:", 5) == 0)) { + local_X11 = TRUE; + } else { + local_X11 = FALSE; + } + + x11_display = XOpenDisplay(NULL); + if (x11_display == NULL) { + SYSERROR("Can't Open Display\n"); + } + + /* check packed 24 bpp */ + check_packed24bpp(); + + /* check SHM extension is avaibale */ + check_SHMext(); + + /* create toplevel window */ + init_window(); + + /* map window to display */ + XMapWindow(x11_display, x11_window); + + /* discpriter init */ + //x11_selinfo.fd_x = ConnectionNumber(x11_display); + + /* event mask */ + XSelectInput(x11_display, x11_window, ExposureMask | + KeyPressMask | KeyReleaseMask | + LeaveWindowMask | EnterWindowMask | + ButtonPressMask | ButtonReleaseMask | +// PointerMotionMask | PointerMotionHintMask); + PointerMotionMask); + /* ???? */ + XSetGraphicsExposures(x11_display, x11_gc_win, False); + + /* create initial off-screen */ + init_offscreen(); + + /* Window title bar */ + XStoreName(x11_display, x11_window, "XSystem3.5 Version "VERSION); + + /* wm hint */ + atom_wmprot = XInternAtom(x11_display, "WM_PROTOCOLS", False); + atom_delwin = XInternAtom(x11_display, "WM_DELETE_WINDOW", False); + XSetWMProtocols(x11_display, x11_window, &atom_delwin, 1); + + /* init cursor */ + x11_init_cursor(); + + /* final */ + XFlush(x11_display); + + /* window size set */ + Xcore_setWindowSize(0, 0, SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT); + + return 0; +} + +/* remove X */ +void Xcore_Remove(void) { + if (x11_videodev == NULL) return; + + if (x11_display != NULL) { + NOTICE("Now X shutdown ... "); + + x11_vm_exit(); + + if (x11_workinfo != NULL) { + releaseWorkImage(); + } + + if (x11_dibinfo != NULL) { + releaseDIB(); + } + XCloseDisplay(x11_display); + + joy_close(); + + NOTICE("Done!\n"); + } +} + + + +/* SHMext を使用しないモードに設定 */ +void Xcore_setNoShmMode(void) { + // x11_noSHM = TRUE; + noshm = TRUE; +} + +/* SHMext が使用できるかチェック */ +static void check_SHMext(void) { + int major, minor; + Bool pixmaps; + +#if defined(__osf__) + x11_noSHM = TRUE; /* buggy X at least DIGITAL UNIX V4.0F */ +#endif + + if (x11_noSHM) return; + + if (local_X11) { + x11_noSHM = FALSE; + return; + } + + if (False == XShmQueryVersion(x11_display, &major, &minor, &pixmaps)) { + WARNING("MIT-SHMextension is not supported\n"); + goto errexit; + } + + if (False == pixmaps) { + WARNING("SharedPixmap is not supported\n"); + goto errexit; + } + + if (ZPixmap != XShmPixmapFormat(x11_display)) { + WARNING("SharedPixmap's format is not ZPixmap\n"); + goto errexit; + } + + x11_noSHM = FALSE; + return; + + errexit: + x11_noSHM = TRUE; + return; +} + +static void check_packed24bpp(void) { + XPixmapFormatValues *list; + int i, cnt; + + list = XListPixmapFormats(x11_display, &cnt); + if (list == NULL) return; + + for (i = 0; i < cnt; i++) { + if (list[i].depth == 24 && list[i].bits_per_pixel == 24) { + packed24bpp = TRUE; + break; + } + } + XFree(list); +} + + +/* create toplevel window */ +static void init_window(void) { + int depth = DefaultDepth(x11_display, 0); + boolean simple = FALSE; + int attrib_mask; + XSetWindowAttributes at; + XVisualInfo vinfo; + + memset(&at, 0, sizeof(at)); + + if (depth == 8) { + /* 8bit の時 15/16/24bit True Color の visual を持っているか? */ + if (True == XMatchVisualInfo(x11_display, None, 16, TrueColor, &vinfo)) { + WIN_DEPTH = 16; + } else if (True == XMatchVisualInfo(x11_display, None, 15, TrueColor, &vinfo)) { + WIN_DEPTH = 15; + } else if (True == XMatchVisualInfo(x11_display, None, 24, TrueColor, &vinfo)) { + WIN_DEPTH = 24; + } else if (True == XMatchVisualInfo(x11_display, None, 8, PseudoColor, &vinfo)) { + WIN_DEPTH = 8; + simple = TRUE; + } else { + SYSERROR("No required Visual\n"); + } + } else { + simple = TRUE; + if (False == XMatchVisualInfo(x11_display, None, depth, TrueColor, &vinfo)) { + SYSERROR("No required Visual\n"); + } + WIN_DEPTH = depth; + } + + x11_visual = vinfo.visual; + + if (simple) { + x11_window = XCreateSimpleWindow(x11_display, RootWindow(x11_display, 0), + 0, 0, + SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, + 0, 0, 0); + /* colormap */ + if (x11_visual->class == PseudoColor) { + x11_cm = XCreateColormap(x11_display, RootWindow(x11_display,0), x11_visual, AllocAll); + XSetWindowColormap(x11_display, x11_window, x11_cm); + } else { + x11_cm = DefaultColormap(x11_display, 0); + } + /* backing store */ + at.backing_store = WhenMapped; + XChangeWindowAttributes(x11_display, x11_window, CWBackingStore, &at); + } else { + XVisualInfo *vinfo_g; + int vinfo_n; + + vinfo.depth = WIN_DEPTH; + vinfo_g = XGetVisualInfo(x11_display, VisualDepthMask | VisualClassMask| VisualRedMaskMask, &vinfo, &vinfo_n); + if (vinfo_g == NULL) { + SYSERROR("No required Visual\n"); + } + x11_visual = vinfo_g->visual; + XFree(vinfo_g); + + at.background_pixel = BlackPixel (x11_display, 0); + at.border_pixel = BlackPixel (x11_display, 0); + at.backing_store = WhenMapped; + attrib_mask = CWBorderPixel | CWBackPixel | CWColormap | CWBackingStore; + x11_cm = at.colormap = XCreateColormap(x11_display, RootWindow(x11_display, 0), x11_visual, AllocNone); + x11_window = XCreateWindow(x11_display, RootWindow(x11_display, 0), + 0, 0, SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, + 0, WIN_DEPTH, + InputOutput, x11_visual, attrib_mask, &at); + } + + /* determin dib depth candidate */ + dib_depth_candidate = (depth == 16 && vinfo.red_mask == 0x7c00) ? 15: WIN_DEPTH; + + /* create graphic context for window */ + x11_gc_win = XCreateGC(x11_display, x11_window, 0, 0); + + /* for fullscreen window init */ + x11_vm_init(); + +} + +static void init_offscreen(void) { + makeDIB(SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT, SYS35_DEFAULT_DEPTH); + + x11_makeWorkImage(SYS35_DEFAULT_WIDTH, SYS35_DEFAULT_HEIGHT); +} + +/* OffScreenImageに関する情報の解放 */ +static void releaseDIB(void) { + XFreePixmap(x11_display, x11_pixmap); + XFreeGC(x11_display, x11_gc_pix); + + if (x11_dibinfo->shared) { + releaseShmXImage(x11_dibinfo); + } else { + releaseNonShmXImage(x11_dibinfo); + } +} + +static void makeNonShmXImage(IMAGEINFO *simg, int w, int h, int depth) { + simg->ximg = XCreateImage(x11_display, x11_visual, depth, ZPixmap, 0, NULL, w, h, packed24bpp ? 8 : 32, 0); + + /* XXXX */ + if (depth == 32 && packed24bpp) { + simg->ximg->bytes_per_line = w * 4; + } + + if (NULL == (simg->ximg->data = malloc(simg->ximg->bytes_per_line * h))) { + NOMEMERR(); + } + +#ifdef WORDS_BIGENDIAN + simg->ximg->byte_order = MSBFirst; +#else + simg->ximg->byte_order = LSBFirst; +#endif +} + +static boolean makeShmXImage(IMAGEINFO *simg, int w, int h, int depth) { + simg->ximg = XShmCreateImage(x11_display, x11_visual, depth, ZPixmap, NULL, &simg->info, w, h); + + if ((simg->info.shmid = shmget(IPC_PRIVATE, + simg->ximg->bytes_per_line * h, + IPC_CREAT | 0666)) < 0) { + WARNING("shmget: size:%x %s\n", + simg->ximg->bytes_per_line * h, strerror(errno)); + XDestroyImage(simg->ximg); + return FALSE; + } + + if ((char *)-1 == (simg->info.shmaddr = simg->ximg->data = shmat(simg->info.shmid, 0, 0))) { + SYSERROR("shmat: %s\n", strerror(errno)); + } + + simg->info.readOnly = False; + XShmAttach(x11_display, &simg->info); + + return TRUE; +} + +static void releaseNonShmXImage(IMAGEINFO *simg) { + XDestroyImage(simg->ximg); +} + +static void releaseShmXImage(IMAGEINFO *simg) { + XShmDetach(x11_display, &simg->info); + XDestroyImage(simg->ximg); + + if (0 > shmdt(simg->info.shmaddr)) { + SYSERROR("shmdt: %s\n", strerror(errno)); + } + + if (0 > shmctl(simg->info.shmid, IPC_RMID, 0)) { + SYSERROR("shmctl: %s\n", strerror(errno)); + } +} + +static void makeDIB(int w, int h, int depth) { + static boolean alloced = FALSE; + + if (WIN_DEPTH == 8 && depth != 8) { + SYSERROR("You cannot play highcolor game in 256 color mode\n"); + } + + if (alloced) { + releaseDIB(); + g_free(x11_dibinfo); + } + + x11_dibinfo = g_new(IMAGEINFO, 1); + + if (depth != 8) { + depth = dib_depth_candidate; + } + + if (x11_noSHM || + packed24bpp || + depth != WIN_DEPTH || + !makeShmXImage(x11_dibinfo, w, h, depth)) { + makeNonShmXImage(x11_dibinfo, w, h, packed24bpp ? 32 : depth); + x11_pixmap = XCreatePixmap(x11_display, x11_window, w, h, WIN_DEPTH); + x11_dibinfo->shared = FALSE; + } else { + x11_pixmap = XShmCreatePixmap(x11_display, x11_window, x11_dibinfo->ximg->data, &x11_dibinfo->info, w, h, depth); + x11_dibinfo->shared = TRUE; + } + + x11_gc_pix = XCreateGC(x11_display, x11_pixmap, 0, 0); + + x11_dibinfo->cimg.width = w; + x11_dibinfo->cimg.height = h; + x11_dibinfo->cimg.pixel = x11_dibinfo->ximg->data; + x11_dibinfo->cimg.bytes_per_line = x11_dibinfo->ximg->bytes_per_line; + x11_dibinfo->cimg.depth = depth; + x11_dibinfo->cimg.bytes_per_pixel = (depth == 8 ? 1 : + depth == 15 || depth == 16 ? 2 : + depth == 24 || depth == 32 ? 4 : 1); + x11_dibinfo->cimg.alpha = NULL; + + image_setdepth(depth); + alloced = TRUE; +} + +/* fader用のImageを解放 */ +static void releaseWorkImage() { + if (x11_workinfo->shared) { + releaseShmXImage(x11_workinfo); + } else { + releaseNonShmXImage(x11_workinfo); + } +} + +/* fader/ecopy用のImageを確保 */ +void x11_makeWorkImage(int w, int h) { + static boolean alloced = FALSE; + + if (alloced) { + releaseWorkImage(); + g_free(x11_workinfo); + } + + x11_workinfo = g_new(IMAGEINFO, 1); + + if (x11_noSHM || + packed24bpp || + !makeShmXImage(x11_workinfo, w, h, WIN_DEPTH)) { + makeNonShmXImage(x11_workinfo, w, h, WIN_DEPTH); + x11_workinfo->shared = FALSE; + } else { + x11_workinfo->shared = TRUE; + } + + XSync(x11_display, False); + + x11_workinfo->cimg.width = w; + x11_workinfo->cimg.height = h; + x11_workinfo->cimg.pixel = x11_workinfo->ximg->data; + x11_workinfo->cimg.bytes_per_line = x11_workinfo->ximg->bytes_per_line; + x11_workinfo->cimg.depth = x11_workinfo->ximg->depth; + x11_workinfo->cimg.bytes_per_pixel = (WIN_DEPTH == 8 ? 1 : + WIN_DEPTH == 15 || WIN_DEPTH == 16 ? 2 : + WIN_DEPTH == 24 && packed24bpp ? 3 : + WIN_DEPTH == 24 || WIN_DEPTH == 32 ? 4 : 1); + x11_workinfo->cimg.alpha = NULL; + + alloced = TRUE; +} + +void Xcore_setFontDevice(FONT *f) { + x11_font = f; +} + +/* name is EUC */ +void Xcore_setWindowTitle(char *name) { + XmbSetWMProperties (x11_display, x11_window, + name, name, NULL, 0, NULL, NULL, NULL); +} + +/* offscreen の設定 */ +void Xcore_setWorldSize(int width, int height, int depth) { + makeDIB(width, height, depth); + Xcore_fillRectangle(0, 0, width, height, 0); + XSync(x11_display, False); +} + +/* Windowの size と depth の取得 */ +void Xcore_getWindowInfo(DispInfo *info) { + info->width = DisplayWidth(x11_display, 0); + info->height = DisplayHeight(x11_display, 0); + info->depth = WIN_DEPTH; +} + +/* + DIBの取得 + SharedPixma / XImage / MemoryImageのいずれか + */ +agsurface_t *Xcore_getDIB(void) { + return DIB; +} + +/* AutoRepeat の設定 */ +void Xcore_setAutoRepeat(boolean bool) { + if (bool) { + XAutoRepeatOn(x11_display); + } else { + XAutoRepeatOff(x11_display); + } +} diff --git a/src/xpg_basename.c b/src/xpg_basename.c new file mode 100644 index 0000000..52774f4 --- /dev/null +++ b/src/xpg_basename.c @@ -0,0 +1,70 @@ +/* Return basename of given pathname according to the weird XPG specification. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +char * +__xpg_basename (char *filename) +{ + char *p; + + if (filename == NULL || filename[0] == '\0') + /* We return a pointer to a static string containing ".". */ + p = (char *) "."; + else + { + p = strrchr (filename, '/'); + + if (p == NULL) + /* There is no slash in the filename. Return the whole string. */ + p = filename; + else + { + if (p[1] == '\0') + { + /* We must remove trailing '/'. */ + while (p > filename && p[-1] == '/') + --p; + + /* Now we can be in two situations: + a) the string only contains '/' characters, so we return + '/' + b) p points past the last component, but we have to remove + the trailing slash. */ + if (p > filename) + { + *p-- = '\0'; + while (p > filename && p[-1] != '/') + --p; + } + else + /* The last slash we already found is the right position + to return. */ + while (p[1] != '\0') + ++p; + } + else + /* Go to the first character of the name. */ + ++p; + } + } + + return p; +} diff --git a/src/xsys35rc.sample b/src/xsys35rc.sample new file mode 100644 index 0000000..4918814 --- /dev/null +++ b/src/xsys35rc.sample @@ -0,0 +1,151 @@ +#---------------------------------------------------------- +# XSyetem35 設定ファイル +# +# 行頭が '#' で始まる行はコメント行です + +# --------------------------------------------------------- +# 使用するフォントデバイスの選択 +# (x11,gtk,ttfが使用可能です) +# font_device: ttf + +# --------------------------------------------------------- +# 使用するフォントの指定 +# フォントサイズの場所を %d にするのを忘れないで下さい。 +# + +font_mincho: -*-mincho-medium-r-normal--%d-0-0-0-c-0-jisx0208.1983-0,-*-mincho-medium-r-normal--%d-0-0-0-c-0-jisx0201.1976-0 + +font_gothic: -*-*-medium-r-normal--%d-*-*-*-c-*-jisx0208.1983-0,-*-*-medium-r-normal--%d-*-*-*-c-*-jisx0201.1976-0 + +# ------------------------------------------------------------ + +# ---------------------------------------------------------- +# 使用するフォントの指定 for FreeType +# + +#ttfont_mincho: /usr/share/fonts/TrueType/mincho.ttc +#ttfont_gothic: /usr/share/fonts/TrueType/gothic.ttc + +# True Type フォントのエンコード方式を指定 +# Shift JIS0213 の場合以下のように指定 +#ttfont_mincho_code: jisx0213 +#ttfont_gothic_code: jisx0213 + +# True Type フォントのフェイス指定 +#ttfont_mincho_face: 0 +#ttfont_gothic_face: 0 + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# CD-ROM のデバイス名 +# + +#cdrom_device: /dev/cdrom + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# audio device のデバイス名 +# + +#dsp_device: /dev/dsp + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# mixer device のデバイス名 +# + +#mixer_device: /dev/mixer + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# raw midi device または sequencer device のデバイス名 +# + +#midi_device: /dev/midi +##midi_device: /dev/sequencer + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# オーディオ出力のデフォルトデバイス名 +# 'o' : OSS +# 's' : ALSA +# 'e' : ESD +# '0' : (ゼロ) オーディオ無効化 + +#audio_output_device: o + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# MIDI出力のデフォルト出力方法 +# 'e' : 外部プレーヤー +# 'r' : raw midi device +# 'sX' : sequencer device (Xはポート番号、通常は0) +# '0' : (ゼロ) MIDI無効化 +# + +#midi_output_device: e + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# joystick device のデバイス名 +# + +#joy_device: /dev/js0 + +# ------------------------------------------------------------ + +# ------------------------------------------------------------ +# 外部 MIDI プレーヤーの設定 +# プレーヤーとオプションを書きます。予めプレーヤーへPATHを通しておきます。 +# (none)を指定するとMIDI使用を不可にします。 + +#midi_player: playmidi -4 +#midi_player: timidity -A 100 -s 44100 -Oe +#midi_player: none + +# ----------------------------------------------------------- + +# ------------------------------------------------------------ +# 読み込むべき gtkrc ファイルへのホームディレクトリからの相対パス +# 指定しなければ、$(HOME)/.gtk/gtkrc が読み込まれます。 +# 「gtkrc_path: .gtkrc_xsys35」 +# とした場合には、$(HOME)/.gtkrc_xsys35 が読み込まれます。 + +#gtkrc_path: .gtkrc + +# ------------------------------------------------------------ + +# ----------------------------------------------------------- +# X の SharedMemoryExtension を使わない設定 +# Xdec(DigitalUNIX), Xpmac(LinuxPPC)で必要 + +#no_shm: Yes + +# ------------------------------------------------------------ + +# ----------------------------------------------------------- +# system35のシナリオが新規にセーブファイルを作る時 +# (*.gr ファイルの支配下にないファイル) +# 漢字コードを EUC/SJIS のどちらで書くか +# 0 : EUC (default) +# 1 : SJIS + +#qe_kanjicode: 0 + +# ------------------------------------------------------------ + +# ----------------------------------------------------------- +# リソースファイルによるマウスカーソルの形状変更を無効にする +# にする場合、以下を Yes にする (なにも指定しない場合は有効) +# + +#no_imagecursor: Yes + +# ----------------------------------------------------------- diff --git a/src/xsyskey.pl b/src/xsyskey.pl new file mode 100755 index 0000000..8cfd34d --- /dev/null +++ b/src/xsyskey.pl @@ -0,0 +1,50 @@ +#! /usr/bin/perl + +@key_list=(); +%keyh_list=(); +open(FX,") { + if( /^#define KEY_([^\s]*)\s+[(]([^)]*)[)]/ ) { + $key_list[eval($2)]="$1"; + $keyh_list{$1}=eval($2); + } +} +close(fp); + +@sdlk_list=(); +open(FS,") { + if( /SDLK_([^\s]+)\s+=\s*([^,]*),/ ) { + $sdlk_list[eval($2)]="$1"; + } +} +close(FS); + + +print "static int sdl_keytable[SDLK_LAST] = {\n\t"; +for( $i = 0 ; $i < scalar(@sdlk_list) ; $i ++ ) { + #print "$i @sdlk_list[$i] $keyh_list{@sdlk_list[$i]}\n"; + $x = @sdlk_list[$i]; + if( length($x) == 0 ) { + print "KEY_UNDEFINED, "; + } elsif ( $keyh_list{$x} ) { + print "KEY_@key_list[$keyh_list{$x}], "; + } elsif ( $x =~ /[a-z]/ ) { + print "KEY_".uc($x).", "; + } elsif ( $x =~ /KP/ ) { + if( $x =~ /[0-9]/ ) { + $x =~ s/^KP/PAD_/; + } else { + $x =~ s/^KP/PAD/; + } + print "KEY_$x, "; + } elsif ( $i < 0x61) { + print "$i, "; + } else { + print "0 /* SDL_$x */, "; + } + if(($i % 4) == 3 ) { + print "\n\t"; + } +} +print "};\n"; diff --git a/src/xsystem35.c b/src/xsystem35.c new file mode 100644 index 0000000..00e9092 --- /dev/null +++ b/src/xsystem35.c @@ -0,0 +1,898 @@ +/* + * xsystem35.c SYSTEM35 デコーダ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xsystem35.c,v 1.77 2003/11/16 15:29:52 chikama Exp $ */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ENABLE_GTK +# define GTK_RC_NAME ".gtk/gtkrc" +# include +#endif + +#ifdef HAVE_MKDTEMP +#include +#else +extern char *mkdtemp (char *template); +#endif + + +#include "nact.h" +#include "portab.h" +#include "xsystem35.h" +#include "nact.h" +#include "profile.h" +#include "randMT.h" +#include "counter.h" +#include "ags.h" +#include "graphicsdevice.h" +#include "menu.h" +#include "music.h" +#include "music_client.h" +#include "savedata.h" +#include "scenario.h" +#include "variable.h" +#include "dri.h" +#include "ald_manager.h" +#include "filecheck.h" +#include "joystick.h" +#include "s39init.h" + +#ifdef ENABLE_MMX +#include "haveunit.h" +#endif + +static char *gameResorceFile = "xsystem35.gr"; +static void sys35_usage(boolean verbose); +static void sys35_init(); +static void sys35_remove(); +static boolean sys35_initGameDataResorce(); +static void sys35_ParseOption(int *argc, char **argv); +static void signal_handler(int sig_num); +static void signal_handler_segv(int sig_num); +static void check_profile(); +static void init_signalhandler(); + +/* for debugging */ +static FILE *fpdebuglog; +static int debuglv = DEBUGLEVEL; +int sys_nextdebuglv; + +/* game data file name */ +static char *gamefname[DRIFILETYPEMAX][DRIFILEMAX]; + +/* font name from rcfile */ +static char *fontname[FONTTYPEMAX]; +static char *fontname_tt[FONTTYPEMAX]; +static boolean isjix0213_tt[FONTTYPEMAX]; +static char fontface[FONTTYPEMAX]; + +#ifdef ENABLE_EDL +static fontdev_t fontdev = FONT_GTK; +#else +static fontdev_t fontdev = FONT_X11; +#endif + +/* antialias on from command line */ +static boolean font_antialias; +static boolean font_noantialias; + +/* fullscreen on from command line */ +static boolean fs_on; + +// for reboot +static int saved_argc; +static char **saved_argv; + +static void sys35_usage(boolean verbose) { + if (verbose) { + puts("System35 for X Window System [proj. Rainy Moon]"); + puts(" (C) Masaki Chikama(Wren) 1997-2002"); + puts(" Version "VERSION"\n"); + } + puts("Usage: xsystem35 [OPTIONS]\n"); + puts("OPTIONS"); + puts(" -gamefile file : set game resouce file to 'file'"); + puts(" -no-shm : don't use MIT-SHM (use in another display)"); + puts(" -devcd device : set cdrom device name to 'device'"); + puts(" -devmidi device: set midi device name to 'device'"); + puts(" -devdsp device : set audio device name to 'device'"); + +#ifdef ENABLE_OSS + puts(" : /dev/dsp : oss type (device name)"); +#endif +#ifdef ENABLE_ALSA +#ifdef ENABLE_ALSA05 + puts(" : 0:0 : alsa type (card and device)"); +#endif +#ifdef ENABLE_ALSA09 + puts(" : hw:0,0 : alsa hardware"); +#endif +#endif + + puts(" -O? : select output audio device"); +#ifdef ENABLE_OSS + puts(" -Oo : OSS mode"); +#endif +#ifdef ENABLE_ALSA + puts(" -Os : ALSA mode"); +#endif +#ifdef ENABLE_ESD + puts(" -Oe : Enlightened Sound Daemon mode"); +#endif + puts(" -O0 : Disable Audio output"); + + puts(" -M? : select output midi methos"); +#ifdef ENABLE_MIDI_EXTPLAYER + puts(" -Me : External midi player"); +#endif +#ifdef ENABLE_MIDI_RAWMIDI + puts(" -Mr : Raw Midi device"); +#endif +#ifdef ENABLE_MIDI_SEQMIDI + puts(" -Ms? : Sequenceer device (?:devicenumber)"); +#endif + puts(" -M0 : Disable MIDI output"); + puts(" -midiplayer cmd: set external midi player to 'cmd'"); + + puts(" -devmix device : set mixer device name to 'device' (effective only for oss)"); + puts(" -devjoy device : set joystic device name to 'device'"); + puts(" if 'device' is set to 'none', don't use the device"); + puts(" -savekanji # : kanji code of filename (0 or 1 ... 0:euc, 1:sjis)"); +#ifdef DEBUG + + puts(" -devfont device: select font device"); +#if defined(ENABLE_TTF) || defined(ENABLE_FT2) + puts(" -devfont ttf : FreerType (True Type Font)"); +#endif +#ifdef ENABLE_X11FONT + puts(" -devfont x11 : x11"); +#endif +#ifdef ENABLE_GTKFONT + puts(" -devfont gtk : gtk"); +#endif + +#ifdef ENABLE_EDL +#ifdef ENABLE_GTK + puts(" : default is gtk"); +#else + puts(" : default is ttf"); +#endif +#else + puts(" : default is x11"); +#endif + +#if defined(ENABLE_TTF) || defined(ENABLE_SDLTTF) || defined(ENABLE_FT2) + puts(" -ttfont_mincho: set TrueType font for mincho"); + puts(" -ttfont_gothic: set TrueType font for mincho"); +#endif + puts(" -font_mincho : set X11(gtk) font for mincho"); + puts(" -font_gothic : set X11(gtk) font for mincho"); + + puts(" -debuglv # : debug level"); + puts(" : 0: critical error message only "); + puts(" : 1: + waring message"); + puts(" : 2: + not implemented command message"); + puts(" : 5: + implemented command (write to logfile)"); + puts(" : 6: + message (write to logfile)"); +#endif + puts(" -antialias : always draw antialiased string (for !256 colors game)"); + puts(" -noantialias : nevser use antialiased string (for !256 colors game)"); + puts(" -fullscreen : start with fullscreen"); + puts(" -noimagecursor : disable image cursor"); + puts(" -version : show version"); + puts(" -h : show this message"); + puts(" --help : show this message"); + exit(1); +} + +void sys_message(char *format, ...) { + va_list args; + + va_start(args, format); +#ifdef DEBUG + if (debuglv >= sys_nextdebuglv) { + if (sys_nextdebuglv >= 5) { + vfprintf(fpdebuglog, format, args); + fflush(fpdebuglog); + } else { + vfprintf(stderr, format, args); + } + } +#else + if (debuglv >= sys_nextdebuglv) { + vfprintf(stderr, format, args); + } +#endif + va_end(args); + +} + +void sys_error(char *format, ...) { + va_list args; + + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); + sys35_remove(); + exit(1); +} + +void sys_exit(int code) { + sys35_remove(); + exit(code); +} + +static int check_fontdev(char *devname) { +#ifdef ENABLE_TTF + if (0 == strcmp(devname, "ttf")) { + return FONT_TTF; + } +#endif + +#ifdef ENABLE_FT2 + if (0 == strcmp(devname, "ft2")) { + return FONT_FT2; + } + if (0 == strcmp(devname, "ttf")) { + return FONT_FT2; + } +#endif + +#ifdef ENABLE_X11FONT + if (0 == strcmp(devname, "x11")) { + return FONT_X11; + } +#endif + +#ifdef ENABLE_GTKFONT + if (0 == strcmp(devname, "gtk")) { + return FONT_GTK; + } +#endif + +#ifdef ENABLE_SDL +#ifdef ENABLE_GTK + return FONT_GTK; +#else + return FONT_TTF; +#endif +#else + return FONT_X11; +#endif +} + +static void storeDataName(int type, int no, char *src) { + gamefname[type][no] = strdup(src); +} + +static void storeSaveName(int no, char *src) { + char *home_dir = ""; + char *path = NULL; + + if (*src == '~') { + home_dir = getenv("HOME"); + if (NULL == (path = malloc(strlen(home_dir) + strlen(src) + 1))) { + NOMEMERR(); + } + sprintf(path, "%s%s", home_dir, src+1); + save_register_file(path, no); + src = path; + } else { + save_register_file(src, no); + } + + if (no == 0) { + char *b = strrchr(src, '/'); + if (b == NULL) { + SYSERROR("Illigal save filename %s\n", src); + } + *b = '\0'; + save_set_path(src); + } + if (path) free(path); +} + +/* ゲームのデータファイルの情報をディレクトリから作成 thanx tajiri@wizard*/ +static boolean sys35_initGameDataDir(int* cnt) +{ + DIR* dir; + struct dirent* d; + char s1[256], s2[256]; + int dno; + int i; + + getcwd(s1,255); + if(NULL == (dir= opendir("."))) + { + SYSERROR("Game Resouce File open failed\n"); + } + while(NULL != (d = readdir(dir))){ + char *filename = d->d_name; + int len = strlen(filename); + sprintf(s2,"%s%c%s",s1,'/',filename); + if(strcasecmp(filename,"adisk.ald")==0){ + storeDataName(DRIFILE_SCO, 0, s2); + cnt[0] = max(1, cnt[0]); + } else if (strcasecmp(filename, "system39.ain") == 0) { + nact->ain.path_to_ain = strdup(filename); + } + else if(strcasecmp(filename+len-4,".ald")==0){ + dno = toupper(*(filename+len-5)) - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) continue; + switch(*(filename+len-6)){ + case 'S': + case 's': + storeDataName(DRIFILE_SCO, dno, s2); + cnt[0] = max(dno + 1, cnt[0]); + break; + case 'g': + case 'G': + storeDataName(DRIFILE_CG, dno, s2); + cnt[1] = max(dno + 1, cnt[1]); + break; + case 'W': + case 'w': + storeDataName(DRIFILE_WAVE, dno, s2); + cnt[2] = max(dno + 1, cnt[2]); + break; + case 'M': + case 'm': + storeDataName(DRIFILE_MIDI, dno, s2); + cnt[3] = max(dno + 1, cnt[3]); + break; + case 'D': + case 'd': + storeDataName(DRIFILE_DATA, dno, s2); + cnt[4] = max(dno + 1, cnt[4]); + break; + case 'R': + case 'r': + storeDataName(DRIFILE_RSC, dno, s2); + cnt[5] = max(dno + 1, cnt[5]); + break; + + } + } + } + for(i=0;i0) + return TRUE; + else + return FALSE; +} + + +/* ゲームのデータファイルの情報を読み込む */ +static boolean sys35_initGameDataResorce() { + int cnt[] = {0, 0, 0, 0, 0, 0, 0}; + int linecnt = 0, dno; + FILE *fp; + char s[256]; + char s1[256], s2[256]; + + if (NULL == (fp = fopen(gameResorceFile, "r"))) { + if(sys35_initGameDataDir(cnt)==TRUE) { + goto initdata; + } + sys35_usage(TRUE); + } + while(fgets(s, 255, fp) != NULL ) { + linecnt++; + if (s[0] == '#') continue; + s2[0] = '\0'; + sscanf(s,"%s %s", s1, s2); + if (s2[0] == '\0') continue; + if (0 == strncmp(s1, "Scenario", 8)) { + dno = s1[8] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeDataName(DRIFILE_SCO, dno, s2); + cnt[0] = max(dno + 1, cnt[0]); + } else if (0 == strncmp(s1, "Graphics", 8)) { + dno = s1[8] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeDataName(DRIFILE_CG, dno, s2); + cnt[1] = max(dno + 1, cnt[1]); + } else if (0 == strncmp(s1, "Wave", 4)) { + dno = s1[4] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeDataName(DRIFILE_WAVE, dno, s2); + cnt[2] = max(dno + 1, cnt[2]); + } else if (0 == strncmp(s1, "Midi", 4)) { + dno = s1[4] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeDataName(DRIFILE_MIDI, dno, s2); + cnt[3] = max(dno + 1, cnt[3]); + } else if (0 == strncmp(s1, "Data", 4)) { + dno = s1[4] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeDataName(DRIFILE_DATA, dno, s2); + cnt[4] = max(dno + 1, cnt[4]); + } else if (0 == strncmp(s1, "Resource", 8)) { + dno = s1[8] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeDataName(DRIFILE_RSC, dno, s2); + cnt[5] = max(dno + 1, cnt[5]); + } else if (0 == strncmp(s1, "BGM", 3)) { + dno = s1[3] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeDataName(DRIFILE_BGM, dno, s2); + cnt[6] = max(dno + 1, cnt[6]); + } else if (0 == strncmp(s1, "Save", 4)) { + dno = s1[4] - 'A'; + if (dno < 0 || dno >= DRIFILEMAX) goto errexit; + storeSaveName(dno, s2); + } else if (0 == strncmp(s1, "Ain", 3)) { + nact->ain.path_to_ain = strdup(s2); + } else if (0 == strncmp(s1, "WAIA", 4)) { + nact->files.wai = strdup(s2); + } else if (0 == strncmp(s1, "BGIA", 4)) { + nact->files.bgi = strdup(s2); + } else if (0 == strncmp(s1, "SACT01", 6)) { + nact->files.sact01 = strdup(s2); + } else if (0 == strncmp(s1, "Init", 4)) { + nact->files.init = strdup(s2); + } else if (0 == strncmp(s1, "ALK", 3)) { + dno = s1[4] - '0'; + if (dno < 0 || dno >= 10) goto errexit; + nact->files.alk[dno] = strdup(s2); + } else { + goto errexit; + } + } + fclose(fp); +initdata: + if (cnt[0] == 0) { + SYSERROR("No Scenario data available\n"); + } + + if (cnt[0] > 0) + ald_init(DRIFILE_SCO, gamefname[DRIFILE_SCO], cnt[0], TRUE); + if (cnt[1] > 0) + ald_init(DRIFILE_CG, gamefname[DRIFILE_CG], cnt[1], TRUE); + if (cnt[2] > 0) + ald_init(DRIFILE_WAVE, gamefname[DRIFILE_WAVE], cnt[2], TRUE); + if (cnt[3] > 0) + ald_init(DRIFILE_MIDI, gamefname[DRIFILE_MIDI], cnt[3], TRUE); + if (cnt[4] > 0) + ald_init(DRIFILE_DATA, gamefname[DRIFILE_DATA], cnt[4], TRUE); + if (cnt[5] > 0) + ald_init(DRIFILE_RSC, gamefname[DRIFILE_RSC], cnt[5], TRUE); + if (cnt[6] > 0) + ald_init(DRIFILE_BGM, gamefname[DRIFILE_BGM], cnt[6], TRUE); + + return 0; + + errexit: + SYSERROR("Illigal resouce at line(%d) file<%s>\n",linecnt, gameResorceFile); + return 0; +} + +static void sys35_init() { + int i; + + nact_init(); + + sl_init(); + + v_initVars(); + + nact->fontdev = fontdev; + + ags_init(); + + for (i = 0; i < FONTTYPEMAX; i++) { + switch(fontdev) { + case FONT_TTF: + case FONT_FT2: + case FONT_SDLTTF: + if (fontname_tt[i] == NULL) { + nact->ags.font->name[i] = strdup(FONT_DEFAULTNAME_TTF); + } else { + nact->ags.font->name[i] = fontname_tt[i]; + } + nact->ags.font->isJISX0213[i] = isjix0213_tt[i]; + nact->ags.font->face[i] = fontface[i]; + break; + + case FONT_X11: + case FONT_GTK: + if (fontname[i] == NULL) { + nact->ags.font->name[i] = strdup(FONT_DEFAULTNAME_X); + } else { + nact->ags.font->name[i] = fontname[i]; + } + break; + default: + break; + } + } + + ags_fullscreen(fs_on); + nact->noantialias = font_noantialias; + ags_setAntialiasedStringMode(font_antialias); + + + reset_counter(0); + + sgenrand(getpid()); + +#ifdef ENABLE_MMX + nact->mmx_is_ok = ((haveUNIT() & tMMX) ? TRUE : FALSE); +#endif + + msg_init(); + sel_init(); + + s39ain_init(); + s39ini_init(); +} + +static void sys35_remove() { + mus_exit(); + ags_remove(); + s39ini_remove(); + /* joy_close(); */ +#if DEBUG + if (debuglv >= 3) { + fclose(fpdebuglog); + } +#endif + if (0 != strcmp(nact->tmpdir, "/tmp")) { + rmdir(nact->tmpdir); + } +} + +void sys_reset() { + mus_exit(); + ags_remove(); + s39ini_remove(); + + if (0 != strcmp(nact->tmpdir, "/tmp")) { + rmdir(nact->tmpdir); + } + + execvp(saved_argv[0], saved_argv); + sys_error("exec fail"); +} + +static void signal_handler(int sig_num) { + sys35_remove(); + exit(1); +} + +static void signal_handler_segv(int sig_num) { + fprintf(stderr, "PID(%d), sigsegv caught @ %03d, %05x\n", (int)getpid(), sl_getPage(), sl_getIndex()); + sys35_remove(); + exit(1); +} + +static void sys35_ParseOption(int *argc, char **argv) { + int i; + FILE *fp; + for (i = 1; i < *argc; i++) { + if (!strcmp(argv[i], "-h")) { + sys35_usage(TRUE); + } + if (!strcmp(argv[i], "--help")) { + sys35_usage(TRUE); + } + } + for (i = 1; i < *argc; i++) { + if (0 == strcmp(argv[i], "-gamefile")) { + if (i == *argc - 1) { + fprintf(stderr, "xsystem35: The -gamefile option requires file value\n\n"); + sys35_usage(FALSE); + } + if (NULL == (fp = fopen(argv[i + 1],"r"))) { + fprintf(stderr, "xsystem35: gamefile '%s' not found\n\n", argv[i + 1]); + sys35_usage(FALSE); + } + fclose(fp); + gameResorceFile = argv[i + 1]; + } else if (0 == strcmp(argv[i], "-no-shm")) { + SetNoShmMode(); + } else if (0 == strcmp(argv[i], "-devcd")) { + if (argv[i + 1] != NULL) { + cd_set_devicename(argv[i + 1]); + } + } else if (0 == strcmp(argv[i], "-devmidi")) { + if (argv[i + 1] != NULL) { + midi_set_devicename(argv[i + 1]); + } + } else if (0 == strcmp(argv[i], "-midiplayer")) { + if (argv[i + 1] != NULL) { + midi_set_playername(argv[i + 1]); + } + } else if (0 == strncmp(argv[i], "-M", 2)) { + int subdev = 0; + if (argv[i][3] != '\0') { + subdev = (argv[i][3] - '0') << 8; + } + midi_set_output_device(argv[i][2] | subdev); + } else if (0 == strcmp(argv[i], "-devdsp")) { + if (argv[i + 1] != NULL) { + audio_set_pcm_devicename(argv[i + 1]); + } + } else if (0 == strncmp(argv[i], "-O", 2)) { + audio_set_output_device(argv[i][2]); + } else if (0 == strcmp(argv[i], "-devmix")) { + if (argv[i + 1] != NULL) { + audio_set_mixer_devicename(argv[i + 1]); + } + } else if (0 == strcmp(argv[i], "-devjoy")) { + if (argv[i + 1] != NULL) { + joy_set_devicename(argv[i + 1]); + } + } else if (0 == strcmp(argv[i], "-savekanji")) { + if (argv[i + 1] != NULL) { + fc_set_default_kanjicode(argv[i + 1][0] - '0'); + } + } else if (0 == strcmp(argv[i], "-fullscreen")) { + fs_on = TRUE; + } else if (0 == strcmp(argv[i], "-antialias")) { + font_antialias = TRUE; + } else if (0 == strcmp(argv[i], "-noantialias")) { + font_noantialias = TRUE; + } else if (0 == strcmp(argv[i], "-devfont")) { + if (argv[i + 1] != NULL) { + fontdev = check_fontdev(argv[i + 1]); + } + } else if (0 == strcmp(argv[i], "-font_gothic")) { + if (argv[i + 1] != NULL) { + fontname[FONT_GOTHIC] = argv[i + 1]; + } + } else if (0 == strcmp(argv[i], "-font_mincho")) { + if (argv[i + 1] != NULL) { + fontname[FONT_MINCHO] = argv[i + 1]; + } + } else if (0 == strcmp(argv[i], "-ttfont_gothic")) { + if (argv[i + 1] != NULL) { + fontname_tt[FONT_GOTHIC] = argv[i + 1]; + } + } else if (0 == strcmp(argv[i], "-ttfont_mincho")) { + if (argv[i + 1] != NULL) { + fontname_tt[FONT_MINCHO] = argv[i + 1]; + } + } else if (0 == strcmp(argv[i], "-noimagecursor")) { + nact->noimagecursor = TRUE; + } else if (0 == strcmp(argv[i], "-debuglv")) { + if (argv[i + 1] != NULL) { + debuglv = argv[i + 1][0] - '0'; + } + } else if (0 == strcmp(argv[i], "-version")) { + puts(VERSION); + exit(0); + } + } +} + +static void check_profile() { + char *param; + + /* フォントデバイスの選択 */ + param = get_profile("font_device"); + if (param) { + fontdev = check_fontdev(param); + } + /* ゴシックフォントの設定 */ + param = get_profile("font_gothic"); + if (param) { + fontname[FONT_GOTHIC] = param; + } + /* 明朝フォントの設定 */ + param = get_profile("font_mincho"); + if (param) { + fontname[FONT_MINCHO] = param; + } + /* ゴシックフォント(TT)の設定 */ + param = get_profile("ttfont_gothic"); + if (param) { + fontname_tt[FONT_GOTHIC] = param; + } + /* 明朝フォント(TT)の設定 */ + param = get_profile("ttfont_mincho"); + if (param) { + fontname_tt[FONT_MINCHO] = param; + } + /* ゴシックフォント(TT)のコード設定 */ + param = get_profile("ttfont_gothic_code"); + if (param) { + isjix0213_tt[FONT_GOTHIC] = (strcmp("jisx0213",param) == 0 ? TRUE : FALSE); + } + /* 明朝フォント(TT)のコード設定 */ + param = get_profile("ttfont_mincho_code"); + if (param) { + isjix0213_tt[FONT_MINCHO] = (strcmp("jisx0213",param) == 0 ? TRUE : FALSE); + } + /* ゴシックフォント(TT)のフェイス指定 */ + param = get_profile("ttfont_gothic_face"); + if (param) { + fontface[FONT_GOTHIC] = *param - '0'; + } + /* 明朝フォント(TT)のフェイス指定 */ + param = get_profile("ttfont_mincho_face"); + if (param) { + fontface[FONT_MINCHO] = *param - '0'; + } + /* CD-ROM device name の設定 */ + param = get_profile("cdrom_device"); + if (param) { + cd_set_devicename(param); + } + /* DSP device name の設定 */ + param = get_profile("dsp_device"); + if (param) { + audio_set_pcm_devicename(param); + } + /* mixer device name の設定 */ + param = get_profile("mixer_device"); + if (param) { + audio_set_mixer_devicename(param); + } + /* audio output device の設定 */ + param = get_profile("audio_output_device"); + if (param) { + audio_set_output_device(*param); + } + /* joystick device name の設定 */ + param = get_profile("joy_device"); + if (param) { + joy_set_devicename(param); + } + /* 外部MIDIプレーヤーの設定 */ + param = get_profile("midi_player"); + if (param) { + midi_set_playername(param); + } + /* Raw MIDI device name の設定 */ + param = get_profile("midi_device"); + if (param) { + midi_set_devicename(param); + } + /* MIDI output device の設定 */ + param = get_profile("midi_output_device"); + if (param) { + int subdev = 0; + if (*(param+1) != '\0') { + subdev = (*(param + 1) - '0') << 8; + } + midi_set_output_device(*param | subdev); + } + /* no-shm flag */ + param = get_profile("no_shm"); + if (param) { + if (0 == strcmp(param, "Yes")) { + SetNoShmMode(); + } + } + /* qe-kanjicode flag */ + param = get_profile("qe-kanjicode"); + if (param) { + fc_set_default_kanjicode(*param - '0'); + } + /* disable image cursor */ + param = get_profile("no_imagecursor"); + if (param) { + if (0 == strcmp(param, "Yes")) { + nact->noimagecursor = TRUE; + } + } +} + +void sys_set_signalhandler(int SIG, void (*handler)(int)) { + struct sigaction act; + sigset_t smask; + + sigemptyset(&smask); + sigaddset(&smask, SIG); + + act.sa_handler = handler; + act.sa_mask = smask; + act.sa_flags = 0; + + sigaction(SIG, &act, NULL); +} + +void init_signalhandler() { + sys_set_signalhandler(SIGINT, signal_handler); + sys_set_signalhandler(SIGTERM, signal_handler); + sys_set_signalhandler(SIGPIPE, SIG_IGN); + sys_set_signalhandler(SIGABRT, signal_handler); + sys_set_signalhandler(SIGSEGV, signal_handler_segv); +} + +int main(int argc, char **argv) { + char *homedir = getenv("HOME"), *rc_name, *rc_path; + sys_set_signalhandler(SIGINT, SIG_IGN); + + saved_argc = argc; + saved_argv = argv; + + load_profile(NULL); + check_profile(); + sys35_ParseOption(&argc, argv); + +#if DEBUG + if (debuglv >= 5) { + if (NULL == (fpdebuglog = fopen(DEBUGLOGFILE, "w"))) { + fpdebuglog = stderr; + } + } +#endif + sys35_initGameDataResorce(); + + init_signalhandler(); + + nact->tmpdir = strdup("/tmp/xsystem35-XXXXXX"); + if (NULL == mkdtemp(nact->tmpdir)) { + free(nact->tmpdir); + nact->tmpdir = strdup("/tmp"); + } + + mus_init(); + +#ifdef ENABLE_NLS + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain(PACKAGE); +#endif + +#ifdef ENABLE_GTK + gtk_set_locale(); + gtk_init(&argc, &argv); +#endif + + sys35_init(); + +#ifdef ENABLE_GTK + rc_name = get_profile("gtkrc_path"); + if (!rc_name) { + rc_name = GTK_RC_NAME; + } + rc_path = (char *)g_malloc(sizeof(char) * (strlen(homedir) + strlen(rc_name)) + 2); + strcpy(rc_path, homedir); + strcat(rc_path, "/"); + strcat(rc_path, rc_name); + + gtk_rc_parse(rc_path); + g_free(rc_path); + menu_init(); +#endif + + nact_main(); + sys35_remove(); + + return 0; +} diff --git a/src/xsystem35.h b/src/xsystem35.h new file mode 100644 index 0000000..f0ccf90 --- /dev/null +++ b/src/xsystem35.h @@ -0,0 +1,75 @@ +/* + * xsystem35.h SYSTEM35 デコーダ + * + * Copyright (C) 1997-1998 Masaki Chikama (Wren) + * 1998- + * + * 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 + * +*/ +/* $Id: xsystem35.h,v 1.26 2003/04/22 16:34:29 chikama Exp $ */ + +#ifndef __XSYSTEM35__ +#define __XSYSTEM35__ + +#include "config.h" +#include "portab.h" +#include "scenario.h" +#include "system.h" +#include "nact.h" +#include "variable.h" +#include "ald_manager.h" +#include "gametitle.h" + +/* logfile when debug level >= 5 */ +#define DEBUGLOGFILE "./xsystem35.log" + +/* + debug level in xsystem35 + 0: critical error message only (output to terminal or message box) + 1: warning only(output to terminal) [stable release default] + 2: add not inplement message (output to terminal) [devel relase default] + 5: add command message (output to terminal or FILE) + 6: add message(output to terminal or FILE) +*/ + +#define DEBUG_SHOWSCOADR sys_message("%d,%x: ", sl_getPage(), sl_getIndex()) +#ifdef DEBUG +#define DEBUG_COMMAND_YET sys_nextdebuglv = 2, DEBUG_SHOWSCOADR, sys_message +#define DEBUG_COMMAND sys_nextdebuglv = 5, DEBUG_SHOWSCOADR, sys_message +#define DEBUG_MESSAGE sys_nextdebuglv = 6, sys_message +#else +#define DEBUG_MESSAGE +#define DEBUG_COMMAND +#define DEBUG_COMMAND_YET +#endif + +/* 配列外参照チェック/cali異常値検出 */ +#define DEBUG_CHECKALING + +/* defined in cali.c */ +extern int preVarPage; /* 直前にアクセスした変数のページ */ +extern int preVarIndex; /* 直前にアクセスした変数のINDEX */ +extern int preVarNo; /* 直前にアクセスした変数の番号 */ + +#define System_idle(msec) usleep(1000l * (msec)); +// extern void System_idle(int msec); + +/* system35 画面デフォルト */ +#define SYS35_DEFAULT_WIDTH 640 +#define SYS35_DEFAULT_HEIGHT 480 +#define SYS35_DEFAULT_DEPTH 8 + +#endif /* !__XSYSTEM35__ */ diff --git a/xsystem35.spec b/xsystem35.spec new file mode 100644 index 0000000..3bcaeb6 --- /dev/null +++ b/xsystem35.spec @@ -0,0 +1,133 @@ +%define ver 1.7.3 +%define rel 1 + +Summary: system35 scenario decoder on X +Name: xsystem35 +Version: %{ver}pre5 +Release: %{rel} +License: GPL +Group: Amusements/Games +Source: http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/down/xsystem35-1.7.3pre5.tar.gz +# Source: http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/down/test/xsystem35-%{ver}-pre5.tar.gz +Requires: gtk+ >= 1.0.0 +BuildPreReq: gtk+-devel +URL: http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/index.html +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +system35 scenario decoder on X +Xsystem35 enables Alice Soft's games on X. + +%description -l ja +アリスソフトのゲームをX上で実行するためのプログラムです。 +最初に実行する前に ドキュメントディレクトリの xsys35rc.sample +をホームディレクトリに.xsys35rcとしてコピーしてお使い下さい。 + +%changelog + +%prep + +%setup -q +# %setup -q -n %{name}-%{ver}-pre5 + +#%patch -p1 + +rm -rf %{buildroot} + + +%build + +./configure --prefix=/usr --enable-audio=oss,alsa,esd --enable-cdrom=linux,mp3 --enable-midi=extp,raw,seq --disable-debug --enable-qmidi +make + +%install + +%makeinstall + +%clean +rm -rf %{buildroot} + +%pre + +%post + +%preun + +%postun + +%files +%defattr(-, root, root) +%doc ABOUT-NLS COPYING INSTALL doc/* src/xsys35rc.sample +%doc contrib +%doc patch +%{_libdir}/xsystem35/* +%{_bindir}/xsystem35 +%{_datadir}/locale/*/LC_MESSAGES/xsystem35* + +%changelog +* Sun Dec 21 2003 CHIKAMA Masaki + [xsystem35-1.7.2] +- version 1.7.2 + +* Sun Aug 31 2003 CHIKAMA Masaki + [xsystem35-1.7.1] +- version 1.7.1 + +* Thu May 01 2003 CHIKAMA Masaki + [xsystem35-1.7.0] +- version 1.7.0 preX + +* Sat Feb 01 2003 CHIKAMA Masaki + [xsystem35-1.6.0] +- version 1.6.0 + +* Sun Jan 05 2003 CHIKAMA Masaki + [xsystem35-1.6.0] +- 1.6.0 preX + +* Tue May 14 2002 CHIKAMA Masaki + [xsystem35-1.5.x] +- revised for xsystem35-1.5.x + +* Sun May 1 2001 CHIKAMA Masaki + [xsystem35-1.4.0] +- update to xsystem35-1.4.0 + +* Sun Apr 1 2001 CHIKAMA Masaki + [xsystem35-1.3.4] +- update to xsystem35-1.3.4 + +* Sun Nov 26 2000 CHIKAMA Masaki + [xsystem35-1.3.3] +- import spec file from JRPM to tar ball. (Grate thanks to Toshiya Takagi) + +* Sun Dec 4 1999 Toshiya Takagi + [xsystem35-1.2.4-1] +- Updated to xsystem35-1.2.4 + +* Sun Sep 5 1999 Toshiya Takagi + [xsystem35-1.2.3-2] +- Use TiMidity and mp3 instead of CD-DA + +* Thu Aug 26 1999 Toshiya Takagi + [xsystem35-1.2.3-1] +- Updated to xsystem35-1.2.3 + +* Sat Jul 24 1999 Toshiya Takagi + [xsystem35-1.2.2-1] +- Updated to xsystem35-1.2.2 + +* Thu Jun 10 1999 Toshiya Takagi + [xsystem35-1.2.1-1] +- Updated to xsystem35-1.2.1 + +* Mon May 24 1999 Toshiya Takagi + [xsystem35-1.2.0-1] +- Updated to xsystem35-1.2.0 + +* Thu May 13 1999 Toshiya Takagi +- Changed /usr/local/lib/xsystem35 to /usr/X11R6/lib/xsystem35 + +* Mon May 3 1999 Toshiya Takagi +- First release against glibc + diff --git a/xsystem35.spec.in b/xsystem35.spec.in new file mode 100644 index 0000000..92969a3 --- /dev/null +++ b/xsystem35.spec.in @@ -0,0 +1,133 @@ +%define ver @VERSION_MA@ +%define rel 1 + +Summary: system35 scenario decoder on X +Name: xsystem35 +Version: %{ver}@VERSION_MI@ +Release: %{rel} +License: GPL +Group: Amusements/Games +Source: http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/down/xsystem35-@VERSION@.tar.gz +# Source: http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/down/test/xsystem35-%{ver}-@VERSION_MI@.tar.gz +Requires: gtk+ >= 1.0.0 +BuildPreReq: gtk+-devel +URL: http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/index.html +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +system35 scenario decoder on X +Xsystem35 enables Alice Soft's games on X. + +%description -l ja +アリスソフトのゲームをX上で実行するためのプログラムです。 +最初に実行する前に ドキュメントディレクトリの xsys35rc.sample +をホームディレクトリに.xsys35rcとしてコピーしてお使い下さい。 + +%changelog + +%prep + +%setup -q +# %setup -q -n %{name}-%{ver}-@VERSION_MI@ + +#%patch -p1 + +rm -rf %{buildroot} + + +%build + +./configure --prefix=/usr --enable-audio=oss,alsa,esd --enable-cdrom=linux,mp3 --enable-midi=extp,raw,seq --disable-debug --enable-qmidi +make + +%install + +%makeinstall + +%clean +rm -rf %{buildroot} + +%pre + +%post + +%preun + +%postun + +%files +%defattr(-, root, root) +%doc ABOUT-NLS COPYING INSTALL doc/* src/xsys35rc.sample +%doc contrib +%doc patch +%{_libdir}/xsystem35/* +%{_bindir}/xsystem35 +%{_datadir}/locale/*/LC_MESSAGES/xsystem35* + +%changelog +* Sun Dec 21 2003 CHIKAMA Masaki + [xsystem35-1.7.2] +- version 1.7.2 + +* Sun Aug 31 2003 CHIKAMA Masaki + [xsystem35-1.7.1] +- version 1.7.1 + +* Thu May 01 2003 CHIKAMA Masaki + [xsystem35-1.7.0] +- version 1.7.0 preX + +* Sat Feb 01 2003 CHIKAMA Masaki + [xsystem35-1.6.0] +- version 1.6.0 + +* Sun Jan 05 2003 CHIKAMA Masaki + [xsystem35-1.6.0] +- 1.6.0 preX + +* Tue May 14 2002 CHIKAMA Masaki + [xsystem35-1.5.x] +- revised for xsystem35-1.5.x + +* Sun May 1 2001 CHIKAMA Masaki + [xsystem35-1.4.0] +- update to xsystem35-1.4.0 + +* Sun Apr 1 2001 CHIKAMA Masaki + [xsystem35-1.3.4] +- update to xsystem35-1.3.4 + +* Sun Nov 26 2000 CHIKAMA Masaki + [xsystem35-1.3.3] +- import spec file from JRPM to tar ball. (Grate thanks to Toshiya Takagi) + +* Sun Dec 4 1999 Toshiya Takagi + [xsystem35-1.2.4-1] +- Updated to xsystem35-1.2.4 + +* Sun Sep 5 1999 Toshiya Takagi + [xsystem35-1.2.3-2] +- Use TiMidity and mp3 instead of CD-DA + +* Thu Aug 26 1999 Toshiya Takagi + [xsystem35-1.2.3-1] +- Updated to xsystem35-1.2.3 + +* Sat Jul 24 1999 Toshiya Takagi + [xsystem35-1.2.2-1] +- Updated to xsystem35-1.2.2 + +* Thu Jun 10 1999 Toshiya Takagi + [xsystem35-1.2.1-1] +- Updated to xsystem35-1.2.1 + +* Mon May 24 1999 Toshiya Takagi + [xsystem35-1.2.0-1] +- Updated to xsystem35-1.2.0 + +* Thu May 13 1999 Toshiya Takagi +- Changed /usr/local/lib/xsystem35 to /usr/X11R6/lib/xsystem35 + +* Mon May 3 1999 Toshiya Takagi +- First release against glibc +